/[MITgcm]/MITgcm_contrib/heimbach/OpenAD/code_ad_moc/timptim_init.F
ViewVC logotype

Contents of /MITgcm_contrib/heimbach/OpenAD/code_ad_moc/timptim_init.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (show annotations) (download)
Tue Nov 18 17:40:23 2008 UTC (17 years, 11 months ago) by utke
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
don't need this either

1 C $Header: /u/gcmpack/MITgcm_contrib/heimbach/OpenAD/code_ad_moc/timptim_init.F,v 1.1 2008/09/15 22:16:01 utke Exp $
2 C $Name: $
3
4 #include "PACKAGES_CONFIG.h"
5 #include "CPP_OPTIONS.h"
6
7 CBOP
8 C !ROUTINE: TIMPTIM_INIT
9 C !INTERFACE:
10 SUBROUTINE TIMPTIM_INIT( myThid )
11
12 C !DESCRIPTION: \bv
13 C *================================================================*
14 C | SUBROUTINE timptim_init
15 C | o Initialise runtime timers.
16 C *================================================================*
17 C \ev
18
19 C !USES:
20 IMPLICIT NONE
21 C == Global variables ==
22 #include "SIZE.h"
23 #include "EEPARAMS.h"
24 #include "PARAMS.h"
25
26 C !INPUT/OUTPUT PARAMETERS:
27 C == Routine arguments ==
28 C myThid - thread number for this instance of the routine.
29 INTEGER myThid
30
31 C !FUNCTIONS:
32 C == Functions ==
33 #ifdef ALLOW_RUNCLOCK
34 LOGICAL RUNCLOCK_CONTINUE
35 LOGICAL RC_CONT
36 #endif
37
38 C !LOCAL VARIABLES:
39 C == Local variables ==
40 integer iloop
41
42 #if defined(TIME_PER_TIMESTEP) || defined(USE_PAPI_FLOPS) || defined(USE_PCL_FLOPS)
43 CHARACTER*(MAX_LEN_MBUF) msgBuf
44 #ifdef TIME_PER_TIMESTEP
45 CCE107 common block for per timestep timing
46 C !TIMING VARIABLES
47 C == Timing variables ==
48 REAL*8 utnew, utold, stnew, stold, wtnew, wtold
49 DATA utnew, utold, stnew, stold, wtnew, wtold /6*0.0D0/
50 #endif
51 #ifdef USE_PAPI_FLOPS
52 CCE107 common block for PAPI summary performance
53 #include <fpapi.h>
54 INTEGER*8 flpops, instr
55 DATA flpops, instr /2*0/
56 INTEGER check
57 REAL*4 real_time, proc_time, mflops, ipc
58 DATA real_time, proc_time, mflops, ipc /4*0.0E0/
59 #else
60 #ifdef USE_PCL_FLOPS
61 CCE107 common block for PCL summary performance
62 #include <pclh.f>
63 INTEGER pcl_counter_list(5), flags, nevents, res, ipcl
64 INTEGER*8 i_result(5), descr
65 REAL*8 fp_result(5)
66 COMMON /pclvars/ i_result, descr, fp_result, pcl_counter_list,
67 $ flags, nevents
68 INTEGER nmaxevents
69 PARAMETER (nmaxevents = 61)
70 CHARACTER*22 pcl_counter_name(0:nmaxevents-1)
71 COMMON /pclnames/ pcl_counter_name
72 #endif
73 #endif
74 #endif
75
76 CEOP
77
78 #ifdef ALLOW_DEBUG
79 IF (debugMode) CALL DEBUG_ENTER('TIMPTIM_INIT',myThid)
80 #endif
81
82 #ifdef TIME_PER_TIMESTEP
83 CCE107 Initial call for timers
84 _BEGIN_MASTER( myThid )
85 CALL TIMER_GET_TIME( utold, stold, wtold )
86 _END_MASTER( myThid )
87 #endif
88 #ifdef USE_PAPI_FLOPS
89 CCE107 Initial call for PAPI
90 _BEGIN_MASTER( myThid )
91 #ifdef USE_FLIPS
92 call PAPIF_flips(real_time, proc_time, flpops, mflops, check)
93 #else
94 call PAPIF_flops(real_time, proc_time, flpops, mflops, check)
95 #endif
96 WRITE(msgBuf,'(A34,F10.6,A,F10.6)')
97 $ 'Mflop/s before timestepping:', mflops, ' ', mflops*proc_time
98 $ /(real_time + 1E-36)
99 CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1)
100 #ifdef PAPI_VERSION
101 call PAPIF_ipc(real_time, proc_time, instr, ipc, check)
102 WRITE(msgBuf,'(A34,F10.6,A,F10.6)')
103 $ 'IPC before timestepping:', ipc, ' ', ipc*proc_time
104 $ /(real_time + 1E-36)
105 CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1)
106 #endif
107 _END_MASTER( myThid )
108 #else
109 #ifdef USE_PCL_FLOPS
110 CCE107 Initial call for PCL
111 _BEGIN_MASTER( myThid )
112 res = PCLstop(descr, i_result, fp_result, nevents)
113 do ipcl = 1, nevents
114 WRITE(msgBuf,'(A22,A26,F10.6)'),
115 $ pcl_counter_name(pcl_counter_list(ipcl)),
116 $ 'before timestepping:', fp_result(ipcl)
117 CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1)
118 enddo
119 res = PCLstart(descr, pcl_counter_list, nevents, flags)
120 _END_MASTER( myThid )
121 #endif
122 #endif
123
124 #ifdef ALLOW_DEBUG
125 IF (debugMode) CALL DEBUG_LEAVE('TIMPTIM_INIT',myThid)
126 #endif
127
128 END
129

  ViewVC Help
Powered by ViewVC 1.1.22