| |
| #include "mpi.h" |
| |
| double start[64], elapsed[64]; |
| |
| /*****************************************************************/ |
| /****** T I M E R _ C L E A R ******/ |
| /*****************************************************************/ |
| void timer_clear( int n ) |
| { |
| elapsed[n] = 0.0; |
| } |
| |
| |
| /*****************************************************************/ |
| /****** T I M E R _ S T A R T ******/ |
| /*****************************************************************/ |
| void timer_start( int n ) |
| { |
| start[n] = MPI_Wtime(); |
| } |
| |
| |
| /*****************************************************************/ |
| /****** T I M E R _ S T O P ******/ |
| /*****************************************************************/ |
| void timer_stop( int n ) |
| { |
| double t, now; |
| |
| now = MPI_Wtime(); |
| t = now - start[n]; |
| elapsed[n] += t; |
| |
| } |
| |
| |
| /*****************************************************************/ |
| /****** T I M E R _ R E A D ******/ |
| /*****************************************************************/ |
| double timer_read( int n ) |
| { |
| return( elapsed[n] ); |
| } |
| |