The MPI Timer


Up: Tools for evaluating programs Next: Profiling Previous: Tools for evaluating programs

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 value returned by a single call to MPI_Wtime has little value.

127 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.



Up: Tools for evaluating programs Next: Profiling Previous: Tools for evaluating programs