Actual source code: ex30.c

petsc-3.13.6 2020-09-29
Report Typos and Errors

  2: static char help[] = "Tests nested events.\n\n";

  4:  #include <petscsys.h>

  6: int main(int argc,char **argv)
  7: {
  8:   int            event1,event2,event3;

 11:   PetscInitialize(&argc,&argv,(char*)0,help);if (ierr) return ierr;
 12:   PetscLogEventRegister("Event2",0,&event2);
 13:   PetscLogEventRegister("Event1",0,&event1);
 14:   PetscLogEventRegister("Event3",0,&event3);

 16:   PetscLogEventBegin(event1,0,0,0,0);
 17:   PetscSleep(1.0);
 18:   PetscLogEventBegin(event2,0,0,0,0);
 19:   PetscSleep(1.0);
 20:   PetscLogEventBegin(event3,0,0,0,0);
 21:   PetscSleep(1.0);
 22:   PetscLogEventEnd(event3,0,0,0,0);
 23:   PetscLogEventEnd(event2,0,0,0,0);
 24:   PetscLogEventEnd(event1,0,0,0,0);
 25:   PetscFinalize();
 26:   return ierr;
 27: }