SCALAPACK 2.2.2
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ sltimer()

subroutine sltimer ( integer  i)

Definition at line 46 of file sltimer.f.

47*
48* -- ScaLAPACK tools routine (version 1.7) --
49* University of Tennessee, Knoxville, Oak Ridge National Laboratory,
50* and University of California, Berkeley.
51* May 1, 1997
52*
53* .. Scalar Arguments ..
54 INTEGER I
55* ..
56*
57* Purpose
58* =======
59*
60* SLtimer provides a "stopwatch" functionality cpu/wall timer
61* (in seconds). Up to 64 separate timers can be functioning at once.
62* The first call starts the timer, and the second stops it. This
63* routine can be disenabled, so that calls to the timer are ignored.
64* This feature can be used to make sure certain sections of code do
65* not affect timings, even if they call routines which have SLtimer
66* calls in them.
67*
68* Arguments
69* =========
70*
71* I (global input) INTEGER
72* The timer to stop/start.
73*
74* =====================================================================
75*
76* .. Parameters ..
77 INTEGER NTIMER
78 parameter( ntimer = 64 )
79 DOUBLE PRECISION STARTFLAG
80 parameter( startflag = -5.0d+0 )
81* ..
82* .. External Functions ..
83 DOUBLE PRECISION DCPUTIME00, DWALLTIME00
84 EXTERNAL dcputime00, dwalltime00
85* ..
86* .. Common Blocks ..
87 LOGICAL DISABLED
88 DOUBLE PRECISION CPUSEC( NTIMER ), CPUSTART( NTIMER ),
89 $ WALLSEC( NTIMER ), WALLSTART( NTIMER )
90 COMMON /sltimer00/ cpusec, wallsec, cpustart, wallstart, disabled
91* ..
92* .. Executable Statements ..
93*
94* If timing disabled, return
95*
96 IF( disabled )
97 $ RETURN
98*
99 IF( wallstart( i ).EQ.startflag ) THEN
100*
101* If timer has not been started, start it
102*
103 wallstart( i ) = dwalltime00()
104 cpustart( i ) = dcputime00()
105*
106 ELSE
107*
108* Stop timer and add interval to count
109*
110 cpusec( i ) = cpusec( i ) + dcputime00() - cpustart( i )
111 wallsec( i ) = wallsec( i ) + dwalltime00() - wallstart( i )
112 wallstart( i ) = startflag
113*
114 END IF
115*
116 RETURN
117*
118* End of SLTIMER
119*