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
cc36b35673 Jean*0001 #include "SHOWFLOPS_OPTIONS.h"
5c2ca1df79 Patr*0002 
                0003 CBOP
                0004 C     !ROUTINE: SHOWFLOPS_INLOOP
                0005 C     !INTERFACE:
                0006       SUBROUTINE SHOWFLOPS_INLOOP( iloop, myThid )
                0007 
                0008 C     !DESCRIPTION: \bv
                0009 C     *================================================================*
                0010 C     | SUBROUTINE showflops_inloop
                0011 C     | o Do runtime timing
                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 ==
cc36b35673 Jean*0025 C     note: under the multi-threaded model myiter and
                0026 C           mytime are local variables passed around as routine
                0027 C           arguments. Although this is fiddly it saves the need to
                0028 C           impose additional synchronisation points when they are
5c2ca1df79 Patr*0029 C           updated.
                0030 C     myThid - thread number for this instance of the routine.
                0031       integer iloop
cc36b35673 Jean*0032       INTEGER myThid
5c2ca1df79 Patr*0033 
                0034 C     !FUNCTIONS:
                0035 C     == Functions ==
                0036 #ifdef ALLOW_RUNCLOCK
                0037       LOGICAL RUNCLOCK_CONTINUE
                0038       LOGICAL RC_CONT
                0039 #endif
                0040 
                0041 C     !LOCAL VARIABLES:
                0042 C     == Local variables ==
                0043 
                0044 CEOP
                0045 
                0046 #ifdef ALLOW_DEBUG
                0047       IF (debugMode) CALL DEBUG_ENTER('SHOWFLOPS_INLOOP',myThid)
                0048 #endif
                0049 
                0050 #ifdef ALLOW_RUNCLOCK
                0051         IF (useRunClock) THEN
                0052          RC_CONT=RUNCLOCK_CONTINUE( myThid )
                0053          IF (.NOT.RC_CONT) RETURN
                0054         ENDIF
                0055 #endif /* ALLOW_RUNCLOCK */
                0056 #ifdef TIME_PER_TIMESTEP
                0057 CCE107 Time per timestep information
                0058       _BEGIN_MASTER( myThid )
                0059       CALL TIMER_GET_TIME( utnew, stnew, wtnew )
                0060       WRITE(msgBuf,'(A34,3F10.6,I8)')
                0061      $        'User, system and wallclock time:', utnew - utold,
                0062      $        stnew - stold, wtnew - wtold, iloop
                0063       CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1)
                0064       utold = utnew
                0065       stold = stnew
                0066       wtold = wtnew
                0067       _END_MASTER( myThid )
                0068 #endif
                0069 #ifdef USE_PAPI_FLOPS
                0070 CCE107 PAPI summary performance
                0071       _BEGIN_MASTER( myThid )
                0072 #ifdef USE_FLIPS
                0073       call PAPIF_flips(real_time, proc_time, flpops, mflops, check)
                0074 #else
                0075       call PAPIF_flops(real_time, proc_time, flpops, mflops, check)
                0076 #endif
a17e0c893f Cons*0077       WRITE(msgBuf,'(F12.6,A,F12.6,A34,I8)')
5c2ca1df79 Patr*0078      $     mflops, ' ', mflops*proc_time/(real_time + 1E-36),
cc36b35673 Jean*0079      $     'Mflop/s during timestep ', iloop
5c2ca1df79 Patr*0080       CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1)
                0081 #ifdef PAPI_VERSION
                0082       call PAPIF_ipc(real_time, proc_time, instr, ipc, check)
a17e0c893f Cons*0083       WRITE(msgBuf,'(F12.6,A,F12.6,A34,I8)')
5c2ca1df79 Patr*0084      $     ipc, ' ', ipc*proc_time/(real_time + 1E-36),
cc36b35673 Jean*0085      $     'IPC during timestep ', iloop
5c2ca1df79 Patr*0086       CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1)
                0087 #endif
                0088       _END_MASTER( myThid )
                0089 #else
                0090 #ifdef USE_PCL_FLOPS
                0091 CCE107 PCL summary performance
                0092       _BEGIN_MASTER( myThid )
                0093       res = PCLstop(descr, i_result, fp_result, nevents)
                0094       do ipcl = 1, nevents
a17e0c893f Cons*0095          WRITE(msgBuf,'(F12.6,A2,A22,A17,I8)'), fp_result(ipcl),
5c2ca1df79 Patr*0096      $        ' ', pcl_counter_name(pcl_counter_list(ipcl)),
                0097      $        'during timestep ', iloop
                0098          CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1)
                0099       enddo
                0100        res = PCLstart(descr, pcl_counter_list, nevents, flags)
                0101       _END_MASTER( myThid )
                0102 #endif
                0103 #endif
                0104 
                0105 #ifdef ALLOW_DEBUG
                0106       IF (debugMode) CALL DEBUG_LEAVE('SHOWFLOPS_INLOOP',myThid)
                0107 #endif
                0108 
                0109       END
                0110