How to measure execution times:
in MPI framework:
double start, stop, elapsed;
.
.
start = MPI_Wtime();
/* begin section to be measured */
.
.
/* end section to be measured */
stop = MPI_Wtime();
/* time used in seconds */
elapsed = stop-start;
.
.
in a sequential program:
#include<time.h>
.
.
clock_t start, stop;
double elapsed;
.
.
start = clock();
/* begin section to be measured */
.
.
/* end section to be measured */
stop = clock();
/* time used in seconds */
elapsed = (stop - start)/((double) CLOCKS_PER_SEC);
.
.
Back