-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtimers.c
More file actions
53 lines (43 loc) · 1.42 KB
/
timers.c
File metadata and controls
53 lines (43 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#include "timers.h"
#include "mpi.h"
/*****************************************************************/
/****** 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 papi_start( int n )
//{
// start_p[n] = PAPI_get_virt_usec();
//}
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;
}
//void papi_stop(int n) {
// long long now = PAPI_get_virt_usec();
// long long t = now - start[n];
// elapsed_p[n] += t;
//}
/*****************************************************************/
/****** T I M E R _ R E A D ******/
/*****************************************************************/
//long long papi_read( int n )
//{
// return elapsed_p[n];
//}
double timer_read(int n) {
return( elapsed[n] );
}