C $Header: /home/ubuntu/mnt/e9_copy/MITgcm_contrib/heimbach/OpenAD/code_ad_moc/Attic/timptim_init.F,v 1.2 2008/11/18 17:40:23 utke dead $ C $Name: $ #include "PACKAGES_CONFIG.h" #include "CPP_OPTIONS.h" CBOP C !ROUTINE: TIMPTIM_INIT C !INTERFACE: SUBROUTINE TIMPTIM_INIT( myThid ) C !DESCRIPTION: \bv C *================================================================* C | SUBROUTINE timptim_init C | o Initialise runtime timers. C *================================================================* C \ev C !USES: IMPLICIT NONE C == Global variables == #include "SIZE.h" #include "EEPARAMS.h" #include "PARAMS.h" C !INPUT/OUTPUT PARAMETERS: C == Routine arguments == C myThid - thread number for this instance of the routine. INTEGER myThid C !FUNCTIONS: C == Functions == #ifdef ALLOW_RUNCLOCK LOGICAL RUNCLOCK_CONTINUE LOGICAL RC_CONT #endif C !LOCAL VARIABLES: C == Local variables == integer iloop #if defined(TIME_PER_TIMESTEP) || defined(USE_PAPI_FLOPS) || defined(USE_PCL_FLOPS) CHARACTER*(MAX_LEN_MBUF) msgBuf #ifdef TIME_PER_TIMESTEP CCE107 common block for per timestep timing C !TIMING VARIABLES C == Timing variables == REAL*8 utnew, utold, stnew, stold, wtnew, wtold DATA utnew, utold, stnew, stold, wtnew, wtold /6*0.0D0/ #endif #ifdef USE_PAPI_FLOPS CCE107 common block for PAPI summary performance #include INTEGER*8 flpops, instr DATA flpops, instr /2*0/ INTEGER check REAL*4 real_time, proc_time, mflops, ipc DATA real_time, proc_time, mflops, ipc /4*0.0E0/ #else #ifdef USE_PCL_FLOPS CCE107 common block for PCL summary performance #include INTEGER pcl_counter_list(5), flags, nevents, res, ipcl INTEGER*8 i_result(5), descr REAL*8 fp_result(5) COMMON /pclvars/ i_result, descr, fp_result, pcl_counter_list, $ flags, nevents INTEGER nmaxevents PARAMETER (nmaxevents = 61) CHARACTER*22 pcl_counter_name(0:nmaxevents-1) COMMON /pclnames/ pcl_counter_name #endif #endif #endif CEOP #ifdef ALLOW_DEBUG IF (debugMode) CALL DEBUG_ENTER('TIMPTIM_INIT',myThid) #endif #ifdef TIME_PER_TIMESTEP CCE107 Initial call for timers _BEGIN_MASTER( myThid ) CALL TIMER_GET_TIME( utold, stold, wtold ) _END_MASTER( myThid ) #endif #ifdef USE_PAPI_FLOPS CCE107 Initial call for PAPI _BEGIN_MASTER( myThid ) #ifdef USE_FLIPS call PAPIF_flips(real_time, proc_time, flpops, mflops, check) #else call PAPIF_flops(real_time, proc_time, flpops, mflops, check) #endif WRITE(msgBuf,'(A34,F10.6,A,F10.6)') $ 'Mflop/s before timestepping:', mflops, ' ', mflops*proc_time $ /(real_time + 1E-36) CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1) #ifdef PAPI_VERSION call PAPIF_ipc(real_time, proc_time, instr, ipc, check) WRITE(msgBuf,'(A34,F10.6,A,F10.6)') $ 'IPC before timestepping:', ipc, ' ', ipc*proc_time $ /(real_time + 1E-36) CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1) #endif _END_MASTER( myThid ) #else #ifdef USE_PCL_FLOPS CCE107 Initial call for PCL _BEGIN_MASTER( myThid ) res = PCLstop(descr, i_result, fp_result, nevents) do ipcl = 1, nevents WRITE(msgBuf,'(A22,A26,F10.6)'), $ pcl_counter_name(pcl_counter_list(ipcl)), $ 'before timestepping:', fp_result(ipcl) CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1) enddo res = PCLstart(descr, pcl_counter_list, nevents, flags) _END_MASTER( myThid ) #endif #endif #ifdef ALLOW_DEBUG IF (debugMode) CALL DEBUG_LEAVE('TIMPTIM_INIT',myThid) #endif END