24 use fv_mp_nlm_mod,
only: is_master, mp_reduce_max, mp_reduce_min, mp_barrier
32 parameter(
nblks = 100)
39 real(kind=8) ,
external :: mpi_wtime
46 real (kind=8) :: usr, sys
87 # if defined( IRIX64 ) || ( defined FFC ) 90 CALL system_clock(count=c, count_rate=r, count_max=m)
91 wclk =
REAL(C) /
REAL(R)
107 character(len=*) :: blk_name
111 character(len=20) :: UC_blk_name
112 character(len=20) :: ctmp
117 real (kind=8) :: wclk
125 uc_blk_name = blk_name
127 call upper(uc_blk_name,len_trim(uc_blk_name))
129 ctmp=trim(uc_blk_name)
134 if ( ctmp .EQ.
blkname(i) )
then 139 if ( iblk .eq. 0 )
then 142 call upper(uc_blk_name,len_trim(uc_blk_name))
144 blkname(iblk)=trim(uc_blk_name)
151 last(iblk)%sys = wclk
152 if (trim(uc_blk_name) ==
'COMM_TOTAL')
call mp_barrier()
157 last(iblk)%usr = wclk
159 # if defined( IRIX64 ) || ( defined FFC ) 164 CALL system_clock(count=c, count_rate=r, count_max=m)
165 wclk =
REAL(C) /
REAL(R)
166 last(iblk)%usr = wclk
180 character(len=*) :: blk_name
182 character(len=20) :: UC_blk_name
183 character(len=20) :: ctmp
187 real (kind=8) :: wclk
191 uc_blk_name = blk_name
193 call upper(uc_blk_name,len_trim(uc_blk_name))
195 ctmp=trim(uc_blk_name)
199 if ( ctmp .EQ.
blkname(i) )
then 205 if ( iblk .eq. 0 )
then 206 call mpp_error(fatal,
'fv_timing_nlm_mod: timing_off called before timing_on for: ' 214 last(iblk)%usr = wclk
215 if (trim(uc_blk_name) ==
'COMM_TOTAL')
then 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
261 tmpmax =
accum(n)%usr
262 call mp_reduce_max(tmpmax)
264 tmpmax =
accum(n)%usr
265 call mp_reduce_min(tmpmax)
268 if ( is_master() )
then 271 tmp(n)%usr =
accum(n)%usr
272 tmp(n)%sys =
accum(n)%sys
278 ' -----------------------------------------------------' 280 ' Block Max time Min Time Load Imbalance' 282 ' -----------------------------------------------------' 285 print
'(3x,a20,2x,3(1x,f12.4))',
blkname(n), &
286 tmp(n)%usr, tmp(n)%sys, tmp(n)%usr - tmp(n)%sys
297 subroutine upper(string,length)
316 character (len=*),
intent(inout) :: string
318 integer,
intent(in) :: length
323 dist = ichar(
'A') - a
327 if (ichar(char1) .ge. a .and. &
328 ichar(char1) .le. z)
then 329 string(i:i) = char(ichar(char1)+dist)
type(tms), dimension(nblks), private accum
subroutine timing_clear()
real(kind=8), public comm_timer
logical, private module_initialized
real(kind=8), public wait_timer
subroutine upper(string, length)
subroutine timing_prt(gid)
subroutine timing_on(blk_name)
character(len=20), dimension(nblks), private blkname
real(kind=8), private totim
type(tms), dimension(nblks), private last
real, dimension(nblks, 2), private us_tmp1
real, dimension(2), private tarray
real, dimension(nblks, 2), private us_tmp2
subroutine timing_off(blk_name)