Actual source code: MPI_Wtime.c

  1: /*$Id: MPI_Wtime.c,v 1.18 2001/08/29 20:59:42 balay Exp $*/

 3:  #include petsc.h

  7: int main(int argc,char **argv)
  8: {
  9:   double x,y;
 10:   int    ierr;
 11: 
 12:   PetscInitialize(&argc,&argv,0,0);
 13:  /* To take care of paging effects */
 14:   y = MPI_Wtime();

 16:   x = MPI_Wtime();
 17:   y = MPI_Wtime();
 18:   y = MPI_Wtime();
 19:   y = MPI_Wtime();
 20:   y = MPI_Wtime();
 21:   y = MPI_Wtime();
 22:   y = MPI_Wtime();
 23:   y = MPI_Wtime();
 24:   y = MPI_Wtime();
 25:   y = MPI_Wtime();
 26:   y = MPI_Wtime();

 28:   fprintf(stdout,"%-15s : %e sec\n","MPI_Wtime",(y-x)/10.0);
 29:   y = MPI_Wtick();
 30:   fprintf(stdout,"%-15s : %e sec\n","MPI_Wtick",y);

 32:   x = MPI_Wtime();
 33:   PetscSleep(10);
 34:   y = MPI_Wtime();
 35:   fprintf(stdout,"%-15s : %e sec - Slept for 10 sec \n","MPI_Wtime",(y-x));

 37:   PetscFinalize();
 38:   return(0);
 39: }