1 |
heimbach |
1.1 |
C $Header: /u/gcmpack/MITgcm_contrib/heimbach/OpenAD/code_heat_transport/timptim_init.F,v 1.1 2007/05/12 22:13:25 heimbach Exp $ |
2 |
|
|
C $Name: $ |
3 |
|
|
|
4 |
|
|
#include "SHOWFLOPS_OPTIONS.h" |
5 |
|
|
|
6 |
|
|
CBOP |
7 |
|
|
C !ROUTINE: SHOWFLOPS_INIT |
8 |
|
|
C !INTERFACE: |
9 |
|
|
SUBROUTINE SHOWFLOPS_INIT( myThid ) |
10 |
|
|
|
11 |
|
|
C !DESCRIPTION: \bv |
12 |
|
|
C *================================================================* |
13 |
|
|
C | SUBROUTINE showflops_init |
14 |
|
|
C | o Initialise runtime timers. |
15 |
|
|
C *================================================================* |
16 |
|
|
C \ev |
17 |
|
|
|
18 |
|
|
C !USES: |
19 |
|
|
IMPLICIT NONE |
20 |
|
|
C == Global variables == |
21 |
|
|
#include "SIZE.h" |
22 |
|
|
#include "EEPARAMS.h" |
23 |
|
|
#include "PARAMS.h" |
24 |
|
|
#include "SHOWFLOPS.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 |
|
|
CEOP |
43 |
|
|
|
44 |
|
|
#ifdef ALLOW_DEBUG |
45 |
|
|
IF (debugMode) CALL DEBUG_ENTER('SHOWFLOPS_INIT',myThid) |
46 |
|
|
#endif |
47 |
|
|
|
48 |
|
|
#ifdef TIME_PER_TIMESTEP |
49 |
|
|
CCE107 Initial call for timers |
50 |
|
|
_BEGIN_MASTER( myThid ) |
51 |
|
|
CALL TIMER_GET_TIME( utold, stold, wtold ) |
52 |
|
|
_END_MASTER( myThid ) |
53 |
|
|
#endif |
54 |
|
|
#ifdef USE_PAPI_FLOPS |
55 |
|
|
CCE107 Initial call for PAPI |
56 |
|
|
_BEGIN_MASTER( myThid ) |
57 |
|
|
#ifdef USE_FLIPS |
58 |
|
|
call PAPIF_flips(real_time, proc_time, flpops, mflops, check) |
59 |
|
|
#else |
60 |
|
|
call PAPIF_flops(real_time, proc_time, flpops, mflops, check) |
61 |
|
|
#endif |
62 |
|
|
WRITE(msgBuf,'(A34,F10.6,A,F10.6)') |
63 |
|
|
$ 'Mflop/s before timestepping:', mflops, ' ', mflops*proc_time |
64 |
|
|
$ /(real_time + 1E-36) |
65 |
|
|
CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1) |
66 |
|
|
#ifdef PAPI_VERSION |
67 |
|
|
call PAPIF_ipc(real_time, proc_time, instr, ipc, check) |
68 |
|
|
WRITE(msgBuf,'(A34,F10.6,A,F10.6)') |
69 |
|
|
$ 'IPC before timestepping:', ipc, ' ', ipc*proc_time |
70 |
|
|
$ /(real_time + 1E-36) |
71 |
|
|
CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1) |
72 |
|
|
#endif |
73 |
|
|
_END_MASTER( myThid ) |
74 |
|
|
#else |
75 |
|
|
#ifdef USE_PCL_FLOPS |
76 |
|
|
CCE107 Initial call for PCL |
77 |
|
|
_BEGIN_MASTER( myThid ) |
78 |
|
|
res = PCLstop(descr, i_result, fp_result, nevents) |
79 |
|
|
do ipcl = 1, nevents |
80 |
|
|
WRITE(msgBuf,'(A22,A26,F10.6)'), |
81 |
|
|
$ pcl_counter_name(pcl_counter_list(ipcl)), |
82 |
|
|
$ 'before timestepping:', fp_result(ipcl) |
83 |
|
|
CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1) |
84 |
|
|
enddo |
85 |
|
|
res = PCLstart(descr, pcl_counter_list, nevents, flags) |
86 |
|
|
_END_MASTER( myThid ) |
87 |
|
|
#endif |
88 |
|
|
#endif |
89 |
|
|
|
90 |
|
|
#ifdef ALLOW_DEBUG |
91 |
|
|
IF (debugMode) CALL DEBUG_LEAVE('SHOWFLOPS_INIT',myThid) |
92 |
|
|
#endif |
93 |
|
|
|
94 |
|
|
END |
95 |
|
|
|
96 |
|
|
#ifdef TIME_PER_TIMESTEP_SFP |
97 |
|
|
CCE107 Initialization of common block for per timestep timing |
98 |
|
|
BLOCK DATA settimers |
99 |
|
|
C !TIMING VARIABLES |
100 |
|
|
C == Timing variables == |
101 |
|
|
REAL*8 utnew, utold, stnew, stold, wtnew, wtold |
102 |
|
|
COMMON /timevars/ utnew, utold, stnew, stold, wtnew, wtold |
103 |
|
|
DATA utnew, utold, stnew, stold, wtnew, wtold /6*0.0D0/ |
104 |
|
|
END |
105 |
|
|
#endif |
106 |
|
|
#ifdef USE_PAPI_FLOPS_SFP |
107 |
|
|
CCE107 Initialization of common block for PAPI summary performance |
108 |
|
|
BLOCK DATA setpapis |
109 |
|
|
INTEGER*8 flpops, instr |
110 |
|
|
REAL real_time, proc_time, mflops, ipc |
111 |
|
|
COMMON /papivars/ flpops, instr, real_time, proc_time, mflops, ipc |
112 |
|
|
DATA flpops, instr, real_time, proc_time, mflops, ipc /2*0,4*0.E0/ |
113 |
|
|
END |
114 |
|
|
#endif |