Actual source code: ex6.c

petsc-dev 2014-04-16
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;

 18:   PetscInitialize(&argc,&argv,(char*)0,help);

 20:   if (PetscLikely(flg)) {
 21:     /* do something */
 22:   }

 24:   if (PetscUnlikely(flg)) {
 25:     /* do something */
 26:   }
 27:   PetscFinalize();
 28:   return 0;
 29: }