1 |
C $Header: /u/gcmpack/MITgcm/pkg/showflops/showflops_insolve.F,v 1.3 2007/09/20 20:58:37 ce107 Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "SHOWFLOPS_OPTIONS.h" |
5 |
|
6 |
CBOP |
7 |
C !ROUTINE: SHOWFLOPS_INSOLVE |
8 |
C !INTERFACE: |
9 |
SUBROUTINE SHOWFLOPS_INSOLVE( myThid ) |
10 |
|
11 |
C !DESCRIPTION: \bv |
12 |
C *================================================================* |
13 |
C | SUBROUTINE showflops_insolve |
14 |
C | o Do runtime timing |
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 note: under the multi-threaded model myiter and |
29 |
C mytime are local variables passed around as routine |
30 |
C arguments. Although this is fiddly it saves the need to |
31 |
C impose additional synchronisation points when they are |
32 |
C updated. |
33 |
C myThid - thread number for this instance of the routine. |
34 |
integer iloop |
35 |
INTEGER myThid |
36 |
|
37 |
C !FUNCTIONS: |
38 |
C == Functions == |
39 |
#ifdef ALLOW_RUNCLOCK |
40 |
LOGICAL RUNCLOCK_CONTINUE |
41 |
LOGICAL RC_CONT |
42 |
#endif |
43 |
|
44 |
C !LOCAL VARIABLES: |
45 |
C == Local variables == |
46 |
|
47 |
CEOP |
48 |
|
49 |
#ifdef ALLOW_DEBUG |
50 |
IF (debugMode) CALL DEBUG_ENTER('SHOWFLOPS_INSOLVE',myThid) |
51 |
#endif |
52 |
|
53 |
#ifdef TIME_PER_TIMESTEP_SFP |
54 |
CCE107 Time per timestep information |
55 |
_BEGIN_MASTER( myThid ) |
56 |
CALL TIMER_GET_TIME( utnew, stnew, wtnew ) |
57 |
C Only output timing information after the 1st timestep |
58 |
IF ( wtold .NE. 0.0D0 ) THEN |
59 |
WRITE(msgBuf,'(A34,3F10.6)') |
60 |
$ 'User, system and wallclock time:', utnew - utold, |
61 |
$ stnew - stold, wtnew - wtold |
62 |
CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1) |
63 |
ENDIF |
64 |
utold = utnew |
65 |
stold = stnew |
66 |
wtold = wtnew |
67 |
_END_MASTER( myThid ) |
68 |
#endif |
69 |
#ifdef USE_PAPI_FLOPS_SFP |
70 |
CCE107 PAPI summary performance |
71 |
_BEGIN_MASTER( myThid ) |
72 |
#ifdef USE_FLIPS |
73 |
call PAPIF_flips(real_time, proc_time, flpops, mflops, check) |
74 |
#else |
75 |
call PAPIF_flops(real_time, proc_time, flpops, mflops, check) |
76 |
#endif |
77 |
WRITE(msgBuf,'(A34,F12.6,A,F12.6)') |
78 |
$ 'Mflop/s during this timestep:', mflops, ' ', mflops |
79 |
$ *proc_time/(real_time + 1E-36) |
80 |
CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1) |
81 |
#ifdef PAPI_VERSION |
82 |
call PAPIF_ipc(real_time, proc_time, instr, ipc, check) |
83 |
WRITE(msgBuf,'(A34,F12.6,A,F12.6)') |
84 |
$ 'IPC during this timestep:', ipc, ' ', ipc*proc_time |
85 |
$ /(real_time + 1E-36) |
86 |
CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1) |
87 |
#endif |
88 |
_END_MASTER( myThid ) |
89 |
#else |
90 |
#ifdef USE_PCL_FLOPS_SFP |
91 |
CCE107 PCL summary performance |
92 |
_BEGIN_MASTER( myThid ) |
93 |
PCLstop(descr, i_result, fp_result, nevents) |
94 |
do ipcl = 1, nevents |
95 |
WRITE(msgBuf,'(A22,A26,F12.6)'), |
96 |
$ pcl_counter_name(pcl_counter_list(ipcl)), |
97 |
$ 'during this timestep:', fp_results(ipcl) |
98 |
CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1) |
99 |
enddo |
100 |
PCLstart(descr, pcl_counter_list, nevents, flags) |
101 |
_END_MASTER( myThid ) |
102 |
#endif |
103 |
#endif |
104 |
|
105 |
#ifdef ALLOW_DEBUG |
106 |
IF (debugMode) CALL DEBUG_LEAVE('SHOWFLOPS_INSOLVE',myThid) |
107 |
#endif |
108 |
|
109 |
END |
110 |
|