Back to home page

MITgcm

 
 

    


File indexing completed on 2018-03-02 18:44:01 UTC

view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
5c2ca1df79 Patr*0001 #include "SHOWFLOPS_OPTIONS.h"
                0002 
                0003 CBOP
                0004 C     !ROUTINE: SHOWFLOPS_INIT
                0005 C     !INTERFACE:
                0006       SUBROUTINE SHOWFLOPS_INIT( myThid )
                0007 
                0008 C     !DESCRIPTION: \bv
                0009 C     *================================================================*
                0010 C     | SUBROUTINE showflops_init
                0011 C     | o Initialise runtime timers.
                0012 C     *================================================================*
                0013 C     \ev
                0014 
                0015 C     !USES:
                0016       IMPLICIT NONE
                0017 C     == Global variables ==
                0018 #include "SIZE.h"
                0019 #include "EEPARAMS.h"
                0020 #include "PARAMS.h"
                0021 #include "SHOWFLOPS.h"
                0022 
                0023 C     !INPUT/OUTPUT PARAMETERS:
                0024 C     == Routine arguments ==
                0025 C     myThid - thread number for this instance of the routine.
                0026       INTEGER myThid 
                0027 
                0028 C     !FUNCTIONS:
                0029 C     == Functions ==
                0030 #ifdef ALLOW_RUNCLOCK
                0031       LOGICAL RUNCLOCK_CONTINUE
                0032       LOGICAL RC_CONT
                0033 #endif
                0034 
                0035 C     !LOCAL VARIABLES:
                0036 C     == Local variables ==
                0037       integer iloop
                0038 
                0039 CEOP
                0040 
                0041 #ifdef ALLOW_DEBUG
                0042       IF (debugMode) CALL DEBUG_ENTER('SHOWFLOPS_INIT',myThid)
                0043 #endif
                0044 
                0045 #ifdef TIME_PER_TIMESTEP
                0046 CCE107 Initial call for timers
                0047       _BEGIN_MASTER( myThid )
                0048       CALL TIMER_GET_TIME( utold, stold, wtold )
                0049       _END_MASTER( myThid )
                0050 #endif
                0051 #ifdef USE_PAPI_FLOPS
                0052 CCE107 Initial call for PAPI
                0053       _BEGIN_MASTER( myThid )
                0054 #ifdef USE_FLIPS
                0055       call PAPIF_flips(real_time, proc_time, flpops, mflops, check)
                0056 #else
                0057       call PAPIF_flops(real_time, proc_time, flpops, mflops, check)
                0058 #endif
                0059       WRITE(msgBuf,'(A34,F10.6,A,F10.6)')
                0060      $     'Mflop/s before timestepping:', mflops, ' ', mflops*proc_time
                0061      $     /(real_time + 1E-36)
                0062       CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1)
                0063 #ifdef PAPI_VERSION
                0064       call PAPIF_ipc(real_time, proc_time, instr, ipc, check)
                0065       WRITE(msgBuf,'(A34,F10.6,A,F10.6)')
                0066      $     'IPC before timestepping:', ipc, ' ', ipc*proc_time
                0067      $     /(real_time + 1E-36)
                0068       CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1)
                0069 #endif
                0070       _END_MASTER( myThid )
                0071 #else
                0072 #ifdef USE_PCL_FLOPS
                0073 CCE107 Initial call for PCL
                0074       _BEGIN_MASTER( myThid )
                0075       res = PCLstop(descr, i_result, fp_result, nevents)
                0076       do ipcl = 1, nevents
                0077          WRITE(msgBuf,'(A22,A26,F10.6)'),
                0078      $        pcl_counter_name(pcl_counter_list(ipcl)),
                0079      $        'before timestepping:', fp_result(ipcl)
                0080          CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1)
                0081       enddo
                0082       res = PCLstart(descr, pcl_counter_list, nevents, flags)
                0083       _END_MASTER( myThid )
                0084 #endif
                0085 #endif
                0086 
                0087 #ifdef ALLOW_DEBUG
                0088       IF (debugMode) CALL DEBUG_LEAVE('SHOWFLOPS_INIT',myThid)
                0089 #endif
                0090 
                0091       END
                0092 
                0093 #ifdef TIME_PER_TIMESTEP_SFP
                0094 CCE107 Initialization of common block for per timestep timing
                0095       BLOCK DATA settimers
                0096 C     !TIMING VARIABLES
                0097 C     == Timing variables ==
                0098       REAL*8 utnew, utold, stnew, stold, wtnew, wtold
                0099       COMMON /timevars/ utnew, utold, stnew, stold, wtnew, wtold
                0100       DATA utnew, utold, stnew, stold, wtnew, wtold /6*0.0D0/
                0101       END
                0102 #endif
                0103 #ifdef USE_PAPI_FLOPS_SFP
                0104 CCE107 Initialization of common block for PAPI summary performance
                0105       BLOCK DATA setpapis
                0106       INTEGER*8 flpops, instr
                0107       REAL real_time, proc_time, mflops, ipc
                0108       COMMON /papivars/ flpops, instr, real_time, proc_time, mflops, ipc
                0109       DATA flpops, instr, real_time, proc_time, mflops, ipc /2*0,4*0.E0/
                0110       END
                0111 #endif