subroutine init_nonLAstats c ***----------------------------------------------------------*** c * 'init_nonLAstats' sets all variables in the nonLAstats * c * common block to zero. * c ***----------------------------------------------------------*** integer resid_count, defect_count, newmat_count real resid_time, defect_time, newmat_time common /nonLAstats/ resid_time, defect_time, newmat_time, * resid_count, defect_count, newmat_count c resid_time = 0. defect_time = 0. newmat_time = 0. resid_count = 0 defect_count = 0 newmat_count = 0 return end c subroutine update_nonLAstats (call_type) c integer call_type c ***----------------------------------------------------------*** c * 'update_nonLAstats' updates timing and count statistics * c * for various non-linear algebra components of MirkDC. * c * 'call_type' is used to start the timer or identify what * c * has just been timed: * c * * c * call_type = 0 => start the timer * c * call_type = 1 => parallel loop in resid * c * call_type = 2 => parallel loop in defect_estimate * c * call_type = 3 => parallel loop in newmat * c * * c * (This routine properly maintains `total_time'.) * c ***----------------------------------------------------------*** integer resid_count, defect_count, newmat_count real resid_time, defect_time, newmat_time common /nonLAstats/ resid_time, defect_time, newmat_time, * resid_count, defect_count, newmat_count c real total_time common /TOTALstats/ total_time c real elapsed_time, tarray(2), dtime c if (call_type .eq. 0) then c ***----------------------------------------------------------*** c * Start timing this program segment, or, more precisely, * c * stop timing `total_time', update `total_time', and start * c * timing this program segment. * c ***----------------------------------------------------------*** elapsed_time = dtime(tarray) total_time = total_time + elapsed_time return else c ***----------------------------------------------------------*** c * Stop timing this program segment and record statistics. * c * Update and resume timing `total_time'. * c ***----------------------------------------------------------*** elapsed_time = dtime(tarray) total_time = total_time + elapsed_time if (call_type .eq. 1) then resid_time = resid_time + elapsed_time resid_count = resid_count + 1 else if (call_type .eq. 2) then defect_time = defect_time + elapsed_time defect_count = defect_count + 1 else if (call_type .eq. 3) then newmat_time = newmat_time + elapsed_time newmat_count = newmat_count + 1 else write(6,*) ' *** nonLAstats: invalid call_type! ' end if end if return end c subroutine display_nonLAstats c ***----------------------------------------------------------*** c * 'display_nonLAstats' prints a summary of the statistics * c * collected in the nonLAstats common block. * c ***----------------------------------------------------------*** integer resid_count, defect_count, newmat_count real resid_time, defect_time, newmat_time common /nonLAstats/ resid_time, defect_time, newmat_time, * resid_count, defect_count, newmat_count c write(6,9997) write(6,9999) ' resid ', resid_count, resid_time write(6,9999) ' defect_estimate ', defect_count, defect_time write(6,9999) ' newmat ', newmat_count, newmat_time write(6,9996) resid_time + defect_time + newmat_time return 9999 format (1x, a17, 1x, i4, 4x, e9.2) 9997 format (/1x, ' MIRKDC NON-(LINEAR ALGEBRA) STATISTICS: ' * /1x, ' ---------------------------------------' * /3x, ' PRG_SEGMENT', 2x, ' #CALLs', 2x, ' ACCUM_TIME' * /1x, ' ---------------------------------------') 9996 format ( 1x, ' ---------------------------------------' * /1x, ' Total monitored non-LA time: ', f6.2, ' secs.') end