Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
a3af153d29d78c9a583b203f7ec555e8bc5d4e25
[simgrid.git] / examples / smpi / NAS / common / c_timers.c
1 #include "mpi.h"
2
3 double start[64], elapsed[64];
4
5 void timer_clear( int n )
6 {
7     elapsed[n] = 0.0;
8 }
9
10 void timer_start( int n )
11 {
12     start[n] = MPI_Wtime();
13 }
14
15 void timer_stop( int n )
16 {
17     double t, now;
18     now = MPI_Wtime();
19     t = now - start[n];
20     elapsed[n] += t;
21 }
22
23 double timer_read( int n )
24 {
25     return( elapsed[n] );
26 }
27