Actual source code: ex6.c

petsc-master 2016-09-28
Report Typos and Errors
  2: static char help[] = "Example of using PetscLikely() and PetscUnlikely().\n\n";

  4: /*T
  5:    Concepts: optimization^likely
  6:    Concepts: optimization^unlikely
  7:    Processors: n
  8: T*/

 10:  #include <petscsys.h>

 14: int main(int argc,char **argv)
 15: {
 16:   PetscBool      flg = PETSC_TRUE;

 19:   PetscInitialize(&argc,&argv,(char*)0,help);if (ierr) return ierr;
 20:   if (PetscLikely(flg)) {
 21:     /* do something */
 22:   }
 23:   if (PetscUnlikely(flg)) {
 24:     /* do something */
 25:   }
 26:   PetscFinalize();
 27:   return ierr;
 28: }