This version is outdated by a newer approved version.DiffThis version (2015/03/26 16:18) is a draft.
Approvals: 0/1

This is an old revision of the document!


Timers and performance debugging

In MPI, timers are defined because existing timers are either inconvenient or do not provide adequate access to high resolution timers (See also Section 8.6 Timers and Synchronization in mpi-3.0 Standard.).

MPI_WTIME()

double MPI_Wtime(void)
DOUBLE PRECISION MPI_Wtime() BIND(C)
DOUBLE PRECISION MPI_WTIME()

MPI_WTIME returns a floating-point number of seconds, representing elapsed wallclock time since some time in the past and may be used as follows:

{
double starttime, endtime;
starttime = MPI_Wtime();
.... stuff to be timed ...
endtime = MPI_Wtime();
printf("That took %f seconds\n",endtime-starttime);
}

The times returned are local to the node that called them. Di fferent nodes need not to be synchronized. (MPI_WTIME_IS_GLOBAL is a Boolean variable that is 1 if synchronized and 0 if not.)

MPI_WTICK()

double MPI_Wtick(void)
DOUBLE PRECISION MPI_Wtick() BIND(C)
DOUBLE PRECISION MPI_WTICK()

MPI_WTICK returns the resolution of MPI_WTIME in seconds. That is, it returns, as a double precision value, the number of seconds between successive clock ticks. For example, if the clock is implemented by the hardware as a counter that is incremented every millisecond, the value returned by MPI_WTICK should be 10􀀀3.

  • doku/time.1427386686.txt.gz
  • Last modified: 2015/03/26 16:18
  • by ir