Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Try to activate coverity for simgrid
[simgrid.git] / examples / smpi / NAS / common / timers.f
1 c---------------------------------------------------------------------
2 c---------------------------------------------------------------------
3       
4       subroutine timer_clear(n)
5
6 c---------------------------------------------------------------------
7 c---------------------------------------------------------------------
8
9       implicit none
10       integer n
11       
12       double precision start(64), elapsed(64)
13       common /tt/ start, elapsed
14
15       elapsed(n) = 0.0
16       return
17       end
18
19
20 c---------------------------------------------------------------------
21 c---------------------------------------------------------------------
22
23       subroutine timer_start(n)
24
25 c---------------------------------------------------------------------
26 c---------------------------------------------------------------------
27
28       implicit none
29       integer n
30       include 'mpif.h'
31       double precision start(64), elapsed(64)
32       common /tt/ start, elapsed
33
34       start(n) = MPI_Wtime()
35
36       return
37       end
38       
39
40 c---------------------------------------------------------------------
41 c---------------------------------------------------------------------
42
43       subroutine timer_stop(n)
44
45 c---------------------------------------------------------------------
46 c---------------------------------------------------------------------
47
48       implicit none
49       integer n
50       include 'mpif.h'
51       double precision start(64), elapsed(64)
52       common /tt/ start, elapsed
53       double precision t, now
54       now = MPI_Wtime()
55       t = now - start(n)
56       elapsed(n) = elapsed(n) + t
57
58       return
59       end
60
61
62 c---------------------------------------------------------------------
63 c---------------------------------------------------------------------
64
65       double precision function timer_read(n)
66
67 c---------------------------------------------------------------------
68 c---------------------------------------------------------------------
69
70       implicit none
71       integer n
72       double precision start(64), elapsed(64)
73       common /tt/ start, elapsed
74       
75       timer_read = elapsed(n)
76       return
77       end
78