The MPI Timer
The elapsed (wall-clock) time between two points in an MPI program can be computed using MPI_Wtime:
- double t1, t2;
- t1 = MPI_Wtime ( );
- . . .
- t2 = MPI_Wtime ( );
- printf (“Elapsed time is %f \n”, t2-t1 );
The times are local; the attribute MPI_WTIME_IS_GLOBAL may be used to determine if the times are also synchronized with each other for all processes in MPI_COMM_WORLD.