Actual source code: ex6.c

petsc-3.10.5 2019-03-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>

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

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



 30: /*TEST

 32:    test:

 34: TEST*/