40 use mpp_mod
, only: mpp_error, fatal
42 use fv_mp_mod, only: is_master, mp_reduce_max
50 parameter(
nblks = 100)
57 real(kind=8) ,
external :: mpi_wtime
64 real (kind=8) :: usr, sys
102 # if defined( IRIX64 ) || ( defined FFC ) 105 CALL system_clock(count=c, count_rate=r, count_max=m)
106 wclk =
REAL(C) /
REAL(r)
118 character(len=*) :: blk_name
122 character(len=20) :: UC_blk_name
123 character(len=20) :: ctmp
128 real (kind=8) :: wclk
136 uc_blk_name = blk_name
138 call upper(uc_blk_name,len_trim(uc_blk_name))
140 ctmp=trim(uc_blk_name)
145 if ( ctmp .EQ.
blkname(i) )
then 150 if ( iblk .eq. 0 )
then 153 call upper(uc_blk_name,len_trim(uc_blk_name))
155 blkname(iblk)=trim(uc_blk_name)
161 last(iblk)%usr = wclk
164 # if defined( IRIX64 ) || ( defined FFC ) 169 CALL system_clock(count=c, count_rate=r, count_max=m)
170 wclk =
REAL(C) /
REAL(r)
171 last(iblk)%usr = wclk
181 character(len=*) :: blk_name
183 character(len=20) :: UC_blk_name
184 character(len=20) :: ctmp
188 real (kind=8) :: wclk
192 uc_blk_name = blk_name
194 call upper(uc_blk_name,len_trim(uc_blk_name))
196 ctmp=trim(uc_blk_name)
200 if ( ctmp .EQ.
blkname(i) )
then 206 if ( iblk .eq. 0 )
then 207 call mpp_error(fatal,
'fv_timing_mod: timing_off called before timing_on for: ' 215 accum(iblk)%sys = 0.0
216 last(iblk)%usr = wclk
219 # if defined( IRIX64 ) || ( defined FFC ) 228 CALL system_clock(count=c, count_rate=r, count_max=m)
229 wclk =
REAL(C) /
REAL(r)
231 accum(iblk)%sys = 0.0
232 last(iblk)%usr = wclk
258 tmpmax =
accum(n)%usr
259 call mp_reduce_max(tmpmax)
261 tmpmax =
accum(n)%sys
262 call mp_reduce_max(tmpmax)
265 if ( is_master() )
then 268 tmp(n)%usr =
accum(n)%usr
269 tmp(n)%sys =
accum(n)%sys
275 ' -----------------------------------------------------' 277 ' Block User time System Time Total Time GID ' 279 ' -----------------------------------------------------' 282 print
'(3x,a20,2x,3(1x,f12.4), 2x, I6)',
blkname(n), &
283 tmp(n)%usr, tmp(n)%sys, tmp(n)%usr + tmp(n)%sys, gid
294 subroutine upper(string,length)
313 character (len=*),
intent(inout) :: string
315 integer,
intent(in) :: length
320 dist = ichar(
'A') - a
324 if (ichar(char1) .ge. a .and. &
325 ichar(char1) .le. z)
then 326 string(i:i) = char(ichar(char1)+dist)
The module 'fv_mp_mod' is a single program multiple data (SPMD) parallel decompostion/communication m...
subroutine timing_off(blk_name)
The subroutine 'timing_off' stops a timer.
type(tms), dimension(nblks), private last
real, dimension(nblks, 2), private us_tmp2
real(kind=8), private totim
real, dimension(nblks, 2), private us_tmp1
real, dimension(2), private tarray
The module 'fv_timing' contains FV3 timers.
character(len=20), dimension(nblks), private blkname
subroutine timing_clear()
The subroutine 'timing_clear' resets a timer.
logical, private module_initialized
subroutine upper(string, length)
subroutine timing_on(blk_name)
The subroutine 'timing_on' starts a timer.
subroutine timing_prt(gid)
The subroutine 'timing_prt' prints all timers.
subroutine timing_init
The subroutine 'timing_init' initializes timers.
type(tms), dimension(nblks), private accum