1 |
C $Header: /u/gcmpack/MITgcm/eesupp/src/timers.F,v 1.27 2007/03/23 00:04:42 jmc Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "CPP_EEOPTIONS.h" |
5 |
#ifdef USE_LIBHPM |
6 |
# include "f_hpm.h" |
7 |
#endif |
8 |
|
9 |
C-- File utils.F: General purpose support routines |
10 |
C-- Contents |
11 |
C-- TIMER_INDEX - Returns index associated with timer name. |
12 |
C-- M TIMER_CONTROL - Implements timer functions for given machine. |
13 |
C-- TIMER_PRINT - Print CPU timer statitics. |
14 |
C-- TIMER_PRINTALL - Prints all CPU timers statistics. |
15 |
C-- TIMER_START - Starts CPU timer for code section. |
16 |
C-- TIMER_STOP - Stop CPU tier for code section. |
17 |
C-- Routines marked "M" contain specific machine dependent code. |
18 |
C-- Routines marked "U" contain UNIX OS calls. |
19 |
|
20 |
CGG Modified following A. Biastoch for use with SP3. Is backwards |
21 |
CGG compatible. G. Gebbie, gebbie@mit.edu, 20 Oct 2001, Scripps. |
22 |
|
23 |
CBOP |
24 |
C !ROUTINE: TIMER_INDEX |
25 |
|
26 |
C !INTERFACE: |
27 |
INTEGER FUNCTION TIMER_INDEX ( |
28 |
I name,timerNames,maxTimers,nTimers ) |
29 |
IMPLICIT NONE |
30 |
|
31 |
C !DESCRIPTION: |
32 |
C *==========================================================* |
33 |
C | FUNCTION TIMER\_INDEX |
34 |
C | o Timing support routine. |
35 |
C *==========================================================* |
36 |
C | Return index in timer data structure of timer named |
37 |
C | by the function argument "name". |
38 |
C *==========================================================* |
39 |
|
40 |
C !INPUT/OUTPUT PARAMETERS: |
41 |
C == Routine arguements == |
42 |
C maxTimers :: Total number of timers allowed |
43 |
C nTimers :: Current number of timers |
44 |
C name :: Name of timer to find |
45 |
C timerNames :: List of valid timer names |
46 |
INTEGER maxTimers |
47 |
INTEGER nTimers |
48 |
CHARACTER*(*) name |
49 |
CHARACTER*(*) timerNames(maxTimers) |
50 |
|
51 |
C !LOCAL VARIABLES: |
52 |
C == Local variables == |
53 |
C I :: Index variable |
54 |
INTEGER I |
55 |
CEOP |
56 |
C |
57 |
TIMER_INDEX = 0 |
58 |
IF ( name .EQ. ' ' ) THEN |
59 |
TIMER_INDEX = -1 |
60 |
ELSE |
61 |
DO 10 I = 1, nTimers |
62 |
IF ( name .NE. timerNames(I) ) GOTO 10 |
63 |
TIMER_INDEX = I |
64 |
GOTO 11 |
65 |
10 CONTINUE |
66 |
11 CONTINUE |
67 |
ENDIF |
68 |
RETURN |
69 |
END |
70 |
|
71 |
CBOP |
72 |
C !ROUTINE: TIMER_CONTROL |
73 |
|
74 |
C !INTERFACE: |
75 |
SUBROUTINE TIMER_CONTROL ( name , action , callProc , myThreadId ) |
76 |
IMPLICIT NONE |
77 |
|
78 |
C !DESCRIPTION: |
79 |
C *==========================================================* |
80 |
C | SUBROUTINE TIMER\_CONTROL | |
81 |
C | o Timing routine. | |
82 |
C *==========================================================* |
83 |
C | User callable interface to timing routines. Timers are | |
84 |
C | created, stopped, started and queried only through this | |
85 |
C | rtouine. | |
86 |
C *==========================================================* |
87 |
|
88 |
C !USES: |
89 |
#include "SIZE.h" |
90 |
#include "EEPARAMS.h" |
91 |
#include "EESUPPORT.h" |
92 |
INTEGER TIMER_INDEX |
93 |
INTEGER IFNBLNK |
94 |
INTEGER ILNBLNK |
95 |
EXTERNAL TIMER_INDEX |
96 |
EXTERNAL IFNBLNK |
97 |
EXTERNAL ILNBLNK |
98 |
|
99 |
C !INPUT/OUTPUT PARAMETERS: |
100 |
C name :: name of the timer |
101 |
C action :: operation to perform with this timer |
102 |
C callProc :: procedure calling this routine |
103 |
C myThreadId :: instance number of this thread |
104 |
CHARACTER*(*) name |
105 |
CHARACTER*(*) action |
106 |
CHARACTER*(*) callProc |
107 |
INTEGER myThreadId |
108 |
C |
109 |
C !LOCAL VARIABLES: |
110 |
C maxTimers :: Total numer of timer allowed |
111 |
C maxString :: Max length of a timer name |
112 |
INTEGER maxTimers |
113 |
INTEGER maxString |
114 |
PARAMETER ( maxTimers = 50 ) |
115 |
PARAMETER ( maxString = 80 ) |
116 |
C timerStarts :: Timer counters for each timer and each thread |
117 |
C timerStops |
118 |
C timerUser |
119 |
C timerWall |
120 |
C timerSys |
121 |
C timerT0User |
122 |
C timerT0Wall |
123 |
C timerT0Sys |
124 |
C timerStatus :: START/STOP/RUNNING Status of the timer |
125 |
C timerNameLen :: Length of timer name |
126 |
C timerNames :: Table of timer names |
127 |
C nTimers :: Number of active timers |
128 |
INTEGER timerStarts( maxTimers , MAX_NO_THREADS) |
129 |
SAVE timerStarts |
130 |
INTEGER timerStops ( maxTimers , MAX_NO_THREADS) |
131 |
SAVE timerStops |
132 |
Real*8 timerUser ( maxTimers , MAX_NO_THREADS) |
133 |
SAVE timerUser |
134 |
Real*8 timerWall ( maxTimers , MAX_NO_THREADS) |
135 |
SAVE timerWall |
136 |
Real*8 timerSys ( maxTimers , MAX_NO_THREADS) |
137 |
SAVE timerSys |
138 |
Real*8 timerT0User( maxTimers , MAX_NO_THREADS) |
139 |
SAVE timerT0User |
140 |
Real*8 timerT0Wall( maxTimers , MAX_NO_THREADS) |
141 |
SAVE timerT0Wall |
142 |
Real*8 timerT0Sys ( maxTimers , MAX_NO_THREADS) |
143 |
SAVE timerT0Sys |
144 |
INTEGER timerStatus( maxTimers , MAX_NO_THREADS) |
145 |
SAVE timerStatus |
146 |
INTEGER timerNameLen( maxTimers , MAX_NO_THREADS) |
147 |
SAVE timerNameLen |
148 |
CHARACTER*(maxString) timerNames( maxTimers , MAX_NO_THREADS) |
149 |
SAVE timerNames |
150 |
INTEGER nTimers(MAX_NO_THREADS) |
151 |
CHARACTER*(maxString) tmpName |
152 |
CHARACTER*(maxString) tmpAction |
153 |
INTEGER iTimer |
154 |
INTEGER ISTART |
155 |
INTEGER IEND |
156 |
INTEGER STOPPED |
157 |
PARAMETER ( STOPPED = 0 ) |
158 |
INTEGER RUNNING |
159 |
PARAMETER ( RUNNING = 1 ) |
160 |
CHARACTER*(*) STOP |
161 |
PARAMETER ( STOP = 'STOP' ) |
162 |
CHARACTER*(*) START |
163 |
PARAMETER ( START = 'START' ) |
164 |
CHARACTER*(*) PRINT |
165 |
PARAMETER ( PRINT = 'PRINT' ) |
166 |
CHARACTER*(*) PRINTALL |
167 |
PARAMETER ( PRINTALL = 'PRINTALL' ) |
168 |
#if defined(USE_PAPI) || defined(USE_PCL_FLOPS_SFP) || defined(USE_PCL_FLOPS) || defined (USE_PCL) |
169 |
CHARACTER*(*) INIT |
170 |
PARAMETER ( INIT = 'INIT' ) |
171 |
#ifdef USE_PAPI |
172 |
INTEGER nmaxevents |
173 |
PARAMETER (nmaxevents = 18) |
174 |
INTEGER neventsmax, nevents |
175 |
SAVE neventsmax, nevents |
176 |
INTEGER*8 values(nmaxevents, maxTimers , MAX_NO_THREADS), |
177 |
$ values1(nmaxevents, maxTimers, MAX_NO_THREADS), |
178 |
$ values2(nmaxevents, maxTimers, MAX_NO_THREADS) |
179 |
COMMON /papivalues/ values, values1, values2 |
180 |
#include <fpapi.h> |
181 |
CHARACTER(13) EventName |
182 |
INTEGER EventCode(nmaxevents) |
183 |
INTEGER Check, EventSet |
184 |
INTEGER papiunit |
185 |
SAVE EventCode, EventSet |
186 |
#else |
187 |
#if defined(USE_PCL_FLOPS_SFP) || defined(USE_PCL_FLOPS) || defined(USE_PCL) |
188 |
#include <pclh.f> |
189 |
INTEGER nmaxevents |
190 |
PARAMETER (nmaxevents = 61) |
191 |
INTEGER flags, res, nevents |
192 |
INTEGER*8 descr |
193 |
CHARACTER*22 pcl_counter_name(0:nmaxevents-1) |
194 |
#ifdef USE_PCL |
195 |
INTEGER pcl_counter_list(nmaxevents) |
196 |
INTEGER*8 i_result(nmaxevents, maxTimers, MAX_NO_THREADS) |
197 |
INTEGER*8 i_result1(nmaxevents, maxTimers, MAX_NO_THREADS) |
198 |
INTEGER*8 i_result2(nmaxevents, maxTimers, MAX_NO_THREADS) |
199 |
REAL*8 fp_result(nmaxevents, maxTimers, MAX_NO_THREADS) |
200 |
#else |
201 |
INTEGER pcl_counter_list(5), alt_counter_list(5) |
202 |
INTEGER*8 i_result(5) |
203 |
REAL*8 fp_result(5) |
204 |
SAVE alt_counter_list |
205 |
DATA alt_counter_list /PCL_MFLOPS, PCL_IPC, PCL_L1DCACHE_MISSRATE, |
206 |
$ PCL_L2DCACHE_MISSRATE, PCL_MEM_FP_RATIO/ |
207 |
#endif |
208 |
COMMON /pclvars/ i_result, descr, fp_result, pcl_counter_list, |
209 |
$ flags, nevents |
210 |
COMMON /pclnames/ pcl_counter_name |
211 |
INTEGER pclunit |
212 |
#endif |
213 |
#endif |
214 |
#endif |
215 |
INTEGER I, J |
216 |
Real*8 userTime |
217 |
Real*8 systemTime |
218 |
Real*8 wallClockTime |
219 |
CHARACTER*(MAX_LEN_MBUF) msgBuffer |
220 |
DATA nTimers /MAX_NO_THREADS*0/ |
221 |
SAVE nTimers |
222 |
CEOP |
223 |
C |
224 |
ISTART = IFNBLNK(name) |
225 |
IEND = ILNBLNK(name) |
226 |
IF ( IEND - ISTART + 1 .GT. maxString ) GOTO 901 |
227 |
IF ( ISTART .NE. 0 ) THEN |
228 |
tmpName = name(ISTART:IEND) |
229 |
CALL UCASE( tmpName ) |
230 |
ELSE |
231 |
tmpName = ' ' |
232 |
ENDIF |
233 |
ISTART = IFNBLNK(action) |
234 |
IEND = ILNBLNK(action) |
235 |
IF ( ISTART .EQ. 0 ) GOTO 902 |
236 |
IF ( IEND - ISTART + 1 .GT. maxString ) GOTO 903 |
237 |
tmpAction = action(ISTART:IEND) |
238 |
CALL UCASE( tmpAction ) |
239 |
C |
240 |
iTimer=TIMER_INDEX(tmpName,timerNames(1,myThreadId), |
241 |
& maxTimers,nTimers(myThreadId)) |
242 |
C |
243 |
IF ( tmpAction .EQ. START ) THEN |
244 |
IF ( iTimer .EQ. 0 ) THEN |
245 |
IF ( nTimers(myThreadId) .EQ. maxTimers ) GOTO 904 |
246 |
nTimers(myThreadId) = nTimers(myThreadId) + 1 |
247 |
iTimer = nTimers(myThreadId) |
248 |
timerNames(iTimer,myThreadId) = tmpName |
249 |
timerNameLen(iTimer,myThreadId) = |
250 |
& ILNBLNK(tmpName)-IFNBLNK(tmpName)+1 |
251 |
timerUser(iTimer,myThreadId) = 0. |
252 |
timerSys (iTimer,myThreadId) = 0. |
253 |
timerWall(iTimer,myThreadId) = 0. |
254 |
timerStarts(iTimer,myThreadId) = 0 |
255 |
timerStops (iTimer,myThreadId) = 0 |
256 |
timerStatus(iTimer,myThreadId) = STOPPED |
257 |
ENDIF |
258 |
IF ( timerStatus(iTimer,myThreadId) .NE. RUNNING ) THEN |
259 |
CALL TIMER_GET_TIME( userTime, systemTime, wallClockTime ) |
260 |
timerT0User(iTimer,myThreadId) = userTime |
261 |
timerT0Sys(iTimer,myThreadId) = systemTime |
262 |
timerT0Wall(iTimer,myThreadId) = wallClockTime |
263 |
timerStatus(iTimer,myThreadId) = RUNNING |
264 |
timerStarts(iTimer,myThreadId) = |
265 |
& timerStarts(iTimer,myThreadId)+1 |
266 |
#ifdef USE_PAPI |
267 |
CCE107 PAPI - Read event counts |
268 |
call PAPIF_read(EventSet, values1(1,iTimer,myThreadId), Check) |
269 |
#else |
270 |
#ifdef USE_PCL |
271 |
CCE107 PCL - Read event counts |
272 |
res = PCLread(descr, i_result1(1,iTimer,myThreadId), |
273 |
$ fp_result(1,iTimer,myThreadId), nevents) |
274 |
#endif |
275 |
#endif |
276 |
ENDIF |
277 |
#ifdef USE_LIBHPM |
278 |
#ifdef TARGET_BGL |
279 |
CALL f_hpmstart((myThreadId-1)*100+iTimer,tmpName) |
280 |
#else |
281 |
CALL f_hpmtstart((myThreadId-1)*100+iTimer,tmpName) |
282 |
#endif |
283 |
#endif |
284 |
ELSEIF ( tmpAction .EQ. STOP ) THEN |
285 |
IF ( iTimer .EQ. 0 ) GOTO 905 |
286 |
#ifdef USE_LIBHPM |
287 |
#ifdef TARGET_BGL |
288 |
CALL f_hpmstop((myThreadId-1)*100+iTimer) |
289 |
#else |
290 |
CALL f_hpmtstop((myThreadId-1)*100+iTimer) |
291 |
#endif |
292 |
#endif |
293 |
IF ( timerStatus(iTimer,myThreadId) .EQ. RUNNING ) THEN |
294 |
#ifdef USE_PAPI |
295 |
CCE107 PAPI - Read event counts |
296 |
call PAPIF_read(EventSet, values2(1,iTimer,myThreadId), Check) |
297 |
#else |
298 |
#ifdef USE_PCL |
299 |
CCE107 PCL - Read event counts |
300 |
res = PCLread(descr, i_result2(1,iTimer,myThreadId), |
301 |
$ fp_result(1,iTimer,myThreadId), nevents) |
302 |
#endif |
303 |
#endif |
304 |
CALL TIMER_GET_TIME( userTime, systemTime, wallClockTime ) |
305 |
timerUser(iTimer,myThreadId) = |
306 |
& timerUser(iTimer,myThreadId) + |
307 |
& userTime - |
308 |
& timerT0User(iTimer,myThreadId) |
309 |
timerSys (iTimer,myThreadId) = |
310 |
& timerSys(iTimer,myThreadId) + |
311 |
& systemTime - |
312 |
& timerT0Sys(iTimer,myThreadId) |
313 |
timerWall(iTimer,myThreadId) = |
314 |
& timerWall(iTimer,myThreadId) + |
315 |
& wallClockTime - |
316 |
& timerT0Wall(iTimer,myThreadId) |
317 |
#ifdef USE_PAPI |
318 |
do i=1,nevents |
319 |
values(i,iTimer,myThreadId) = values(i,iTimer,myThreadId) + |
320 |
$ values2(i,iTimer,myThreadId) - values1(i,iTimer,myThreadId) |
321 |
enddo |
322 |
#else |
323 |
#ifdef USE_PCL |
324 |
do i=1,nevents |
325 |
i_result(i,iTimer,myThreadId) = i_result(i,iTimer |
326 |
$ ,myThreadId) + i_result2(i,iTimer,myThreadId) - |
327 |
$ i_result1(i,iTimer,myThreadId) |
328 |
enddo |
329 |
#endif |
330 |
#endif |
331 |
timerStatus(iTimer,myThreadId) = STOPPED |
332 |
timerStops (iTimer,myThreadId) = |
333 |
& timerStops (iTimer,myThreadId)+1 |
334 |
ENDIF |
335 |
#if defined (USE_PAPI) || defined (USE_PCL_FLOPS_SFP) || defined(USE_PCL_FLOPS) || defined(USE_PCL) |
336 |
ELSEIF ( tmpAction .EQ. INIT ) THEN |
337 |
#ifdef USE_PAPI |
338 |
CCE107 PAPI - Check PAPI version, find the maximum number of events and |
339 |
C initialize the library, read the suggested events and create |
340 |
C EventSet, prepare counter for use |
341 |
Check = PAPI_VER_CURRENT |
342 |
call PAPIF_library_init(Check) |
343 |
if (Check .NE. PAPI_VER_CURRENT) then |
344 |
WRITE(msgBuffer,*) "PAPI Library Version is out of Date" |
345 |
CALL PRINT_MESSAGE(msgBuffer,errorMessageUnit, |
346 |
& SQUEEZE_RIGHT,myThreadId) |
347 |
CALL ABORT |
348 |
endif |
349 |
call PAPIF_num_counters(neventsmax) |
350 |
if (neventsmax .GT. nmaxevents) then |
351 |
WRITE(msgBuffer,*) "Fix the nmaxevents in the code to ", |
352 |
$ neventsmax |
353 |
CALL PRINT_MESSAGE(msgBuffer,errorMessageUnit, |
354 |
& SQUEEZE_RIGHT,myThreadId) |
355 |
CALL ABORT |
356 |
endif |
357 |
_BEGIN_MASTER(myThreadId) |
358 |
CALL mdsFindUnit (papiunit, myThreadId) |
359 |
OPEN(UNIT=papiunit,FILE='data.papi',STATUS='OLD') |
360 |
read(papiunit,*) nevents |
361 |
C reset to reasonable values |
362 |
if (nevents .gt. neventsmax) then |
363 |
nevents = neventsmax |
364 |
WRITE(msgBuffer,*) |
365 |
$ "resetting the number of PAPI events to the maximum" |
366 |
CALL PRINT_MESSAGE(msgBuffer,errorMessageUnit, |
367 |
& SQUEEZE_RIGHT,myThreadId) |
368 |
endif |
369 |
do i = 1,nevents |
370 |
read(papiunit,*) EventName |
371 |
if ((EventName .eq. 'PAPI_FLOPS') .or. |
372 |
$ (EventName .eq. 'PAPI_IPS')) then |
373 |
WRITE(msgBuffer,*) "Abort! Rate events are not supported:" |
374 |
$ ,EventName |
375 |
CALL PRINT_MESSAGE(msgBuffer,errorMessageUnit, |
376 |
& SQUEEZE_RIGHT,myThreadId) |
377 |
CALL ABORT |
378 |
endif |
379 |
|
380 |
call PAPIF_event_name_to_code(EventName, EventCode(i), Check) |
381 |
end do |
382 |
close(papiunit) |
383 |
_END_MASTER(myThid) |
384 |
EventSet = PAPI_NULL |
385 |
call PAPIF_create_eventset(EventSet, Check) |
386 |
do i = 1,nevents |
387 |
call PAPIF_add_event(EventSet, EventCode(i), Check) |
388 |
if (Check .NE. PAPI_OK) then |
389 |
CALL PAPIF_event_code_to_name(EventCode(i), EventName, |
390 |
$ Check) |
391 |
WRITE(msgBuffer,*) "Abort After PAPIF_add_event: ", |
392 |
$ EventName |
393 |
CALL PRINT_MESSAGE(msgBuffer,errorMessageUnit, |
394 |
& SQUEEZE_RIGHT,myThreadId) |
395 |
CALL ABORT |
396 |
endif |
397 |
enddo |
398 |
CCE107 - Start counting events |
399 |
call PAPIF_start(EventSet, Check) |
400 |
#else |
401 |
#if defined(USE_PCL_FLOPS_SFP) || defined(USE_PCL_FLOPS) || defined(USE_PCL) |
402 |
CCE107 PCL - initialize the library, read the suggested events |
403 |
C and check them |
404 |
res = PCLinit(descr) |
405 |
|
406 |
#ifdef USE_PCL |
407 |
_BEGIN_MASTER(myThreadId) |
408 |
CALL mdsFindUnit (pclunit, myThreadId) |
409 |
OPEN(UNIT=pclunit,FILE='data.pcl',STATUS='OLD') |
410 |
read(pclunit,*) nevents |
411 |
C reset to reasonable values |
412 |
if (nevents .gt. nmaxevents) then |
413 |
nevents = nmaxevents |
414 |
WRITE(msgBuffer,*) |
415 |
$ "resetting the number of PCL events to the maximum" |
416 |
CALL PRINT_MESSAGE(msgBuffer,errorMessageUnit, |
417 |
& SQUEEZE_RIGHT,myThreadId) |
418 |
endif |
419 |
do i = 1,nevents |
420 |
read(pclunit,*) pcl_counter_list(i) |
421 |
if ((pcl_counter_list(i) .ge. PCL_MFLOPS) .or. |
422 |
$ (pcl_counter_list(i) .lt. 1)) then |
423 |
if ((pcl_counter_list(i) .ge. PCL_MFLOPS) .and. |
424 |
$ (pcl_counter_list(i) .le. nmaxevents)) then |
425 |
WRITE(msgBuffer,*) |
426 |
$ "Abort! Rate events are not relevant:", |
427 |
$ pcl_counter_name(pcl_counter_list(i)) |
428 |
else |
429 |
WRITE(msgBuffer,*) |
430 |
$ "Abort! Events are not defined:", |
431 |
$ pcl_counter_list(i) |
432 |
endif |
433 |
CALL PRINT_MESSAGE(msgBuffer,errorMessageUnit, |
434 |
& SQUEEZE_RIGHT,myThreadId) |
435 |
CALL ABORT |
436 |
endif |
437 |
enddo |
438 |
close(pclunit) |
439 |
_END_MASTER(myThid) |
440 |
|
441 |
do i = 1,nevents |
442 |
CCE107 check to see that event are supported in the order asked |
443 |
res = PCLquery(descr, pcl_counter_list, i, flags) |
444 |
IF(res .NE. PCL_SUCCESS) THEN |
445 |
WRITE(msgBuffer,*) "Abort! No support when adding event: " |
446 |
$ , pcl_counter_name(pcl_counter_list(i)) |
447 |
CALL PRINT_MESSAGE(msgBuffer,errorMessageUnit, |
448 |
& SQUEEZE_RIGHT,myThreadId) |
449 |
CALL ABORT |
450 |
endif |
451 |
enddo |
452 |
#else |
453 |
do i = 1,5 |
454 |
CCE107 check to see which rate events are supported. |
455 |
res = PCLquery(descr, pcl_counter_list, nevents+1, flags) |
456 |
if ((res .ne. PCL_SUCCESS) .and. (i .lt. 5)) then |
457 |
pcl_counter_list(nevents+1) = alt_counter_list(i+1) |
458 |
else |
459 |
if (i .lt. 5) then |
460 |
nevents = nevents + 1 |
461 |
endif |
462 |
endif |
463 |
enddo |
464 |
if (nevents .eq. 0) then |
465 |
WRITE(msgBuffer,*) |
466 |
$ "No PCL rate events supported: Please recompile!" |
467 |
CALL PRINT_MESSAGE(msgBuffer,errorMessageUnit, |
468 |
& SQUEEZE_RIGHT,myThreadId) |
469 |
CALL ABORT |
470 |
endif |
471 |
#endif |
472 |
|
473 |
CCE107 - Start counting events |
474 |
res = PCLstart(descr, pcl_counter_list, nevents, flags) |
475 |
IF(res .NE. PCL_SUCCESS) THEN |
476 |
WRITE(msgBuffer,*) "PCL counting failed - please recompile!" |
477 |
CALL PRINT_MESSAGE(msgBuffer,errorMessageUnit, |
478 |
& SQUEEZE_RIGHT,myThreadId) |
479 |
CALL ABORT |
480 |
ENDIF |
481 |
#endif |
482 |
#endif |
483 |
#endif |
484 |
ELSEIF ( tmpAction .EQ. PRINT ) THEN |
485 |
IF ( iTimer .EQ. 0 ) GOTO 905 |
486 |
WRITE(msgBuffer,*) |
487 |
& ' Seconds in section "', |
488 |
& timerNames(iTimer,myThreadId)(1:timerNameLen(iTimer,myThreadId)) |
489 |
& ,'":' |
490 |
CALL PRINT_MESSAGE(msgBuffer,standardMessageUnit, |
491 |
& SQUEEZE_RIGHT,myThreadId) |
492 |
WRITE(msgBuffer,*) ' User time:', |
493 |
& timerUser(iTimer,myThreadId) |
494 |
CALL PRINT_MESSAGE(msgBuffer,standardMessageUnit, |
495 |
& SQUEEZE_RIGHT,myThreadId) |
496 |
WRITE(msgBuffer,*) ' System time:', |
497 |
& timerSys(iTimer,myThreadId) |
498 |
CALL PRINT_MESSAGE(msgBuffer,standardMessageUnit, |
499 |
& SQUEEZE_RIGHT,myThreadId) |
500 |
WRITE(msgBuffer,*) ' Wall clock time:', |
501 |
& timerWall(iTimer,myThreadId) |
502 |
CALL PRINT_MESSAGE(msgBuffer,standardMessageUnit, |
503 |
& SQUEEZE_RIGHT,myThreadId) |
504 |
WRITE(msgBuffer,*) ' No. starts:', |
505 |
& timerStarts(iTimer,myThreadId) |
506 |
CALL PRINT_MESSAGE(msgBuffer,standardMessageUnit, |
507 |
& SQUEEZE_RIGHT,myThreadId) |
508 |
WRITE(msgBuffer,*) ' No. stops:', |
509 |
& timerStops(iTimer,myThreadId) |
510 |
CALL PRINT_MESSAGE(msgBuffer,standardMessageUnit, |
511 |
& SQUEEZE_RIGHT,myThreadId) |
512 |
#ifdef USE_PAPI |
513 |
do i = 1,nevents |
514 |
call PAPIF_event_code_to_name(EventCode(i), EventName, Check) |
515 |
WRITE(msgBuffer,71) Eventname, |
516 |
$ values(i,iTimer,myThreadId)/timerUser(iTimer,myThreadId) |
517 |
$ ,values(i,iTimer,myThreadId)/timerWall(iTimer,myThreadId |
518 |
$ ),1.D0*values(i,iTimer,myThreadId) |
519 |
CALL PRINT_MESSAGE(msgBuffer,standardMessageUnit, |
520 |
& SQUEEZE_RIGHT,myThreadId) |
521 |
enddo |
522 |
#else |
523 |
#ifdef USE_PCL |
524 |
do i = 1,nevents |
525 |
WRITE(msgBuffer,71) pcl_counter_name(pcl_counter_list(i)), |
526 |
$ i_result(i,iTimer,myThreadId)/timerUser(iTimer |
527 |
$ ,myThreadId),i_result(i,iTimer,myThreadId) |
528 |
$ /timerWall(iTimer,myThreadId),1.D0*i_result(i,iTimer |
529 |
$ ,myThreadId) |
530 |
CALL PRINT_MESSAGE(msgBuffer,standardMessageUnit, |
531 |
& SQUEEZE_RIGHT,myThreadId) |
532 |
enddo |
533 |
#endif |
534 |
#endif |
535 |
ELSEIF ( tmpAction .EQ. PRINTALL ) THEN |
536 |
DO 10 I = 1, nTimers(myThreadId) |
537 |
WRITE(msgBuffer,*) ' Seconds in section "', |
538 |
& timerNames(I,myThreadId)(1:timerNameLen(I,myThreadId)) |
539 |
& ,'":' |
540 |
CALL PRINT_MESSAGE(msgBuffer,standardMessageUnit, |
541 |
& SQUEEZE_RIGHT,myThreadId) |
542 |
WRITE(msgBuffer,*) ' User time:', |
543 |
& timerUser(I,myThreadId) |
544 |
CALL PRINT_MESSAGE(msgBuffer,standardMessageUnit, |
545 |
& SQUEEZE_RIGHT,myThreadId) |
546 |
WRITE(msgBuffer,*) ' System time:', |
547 |
& timerSys(I,myThreadId) |
548 |
CALL PRINT_MESSAGE(msgBuffer,standardMessageUnit, |
549 |
& SQUEEZE_RIGHT,myThreadId) |
550 |
WRITE(msgBuffer,*) ' Wall clock time:', |
551 |
& timerWall(I,myThreadId) |
552 |
CALL PRINT_MESSAGE(msgBuffer,standardMessageUnit, |
553 |
& SQUEEZE_RIGHT,myThreadId) |
554 |
WRITE(msgBuffer,*) ' No. starts:', |
555 |
& timerStarts(I,myThreadId) |
556 |
CALL PRINT_MESSAGE(msgBuffer,standardMessageUnit, |
557 |
& SQUEEZE_RIGHT,myThreadId) |
558 |
WRITE(msgBuffer,*) ' No. stops:', |
559 |
& timerStops(I,myThreadId) |
560 |
CALL PRINT_MESSAGE(msgBuffer,standardMessageUnit, |
561 |
& SQUEEZE_RIGHT,myThreadId) |
562 |
#ifdef USE_PAPI |
563 |
do j = 1,nevents |
564 |
call PAPIF_event_code_to_name(EventCode(j), EventName, Check) |
565 |
WRITE(msgBuffer,71) Eventname, |
566 |
$ values(j,I,myThreadId)/timerUser(I,myThreadId), |
567 |
$ values(j,I,myThreadId)/timerWall(I,myThreadId), |
568 |
$ 1.D0*values(j,I,myThreadId) |
569 |
CALL PRINT_MESSAGE(msgBuffer,standardMessageUnit, |
570 |
& SQUEEZE_RIGHT,myThreadId) |
571 |
enddo |
572 |
#else |
573 |
#ifdef USE_PCL |
574 |
do j = 1,nevents |
575 |
WRITE(msgBuffer,71) pcl_counter_name(pcl_counter_list(j)), |
576 |
$ i_result(j,I,myThreadId)/timerUser(I,myThreadId) |
577 |
$ ,i_result(j,I,myThreadId)/timerWall(I,myThreadId),1.D0 |
578 |
$ *i_result(j,I,myThreadId) |
579 |
CALL PRINT_MESSAGE(msgBuffer,standardMessageUnit, |
580 |
& SQUEEZE_RIGHT,myThreadId) |
581 |
enddo |
582 |
#endif |
583 |
#endif |
584 |
10 CONTINUE |
585 |
ELSE |
586 |
GOTO 903 |
587 |
ENDIF |
588 |
C |
589 |
1000 CONTINUE |
590 |
C |
591 |
RETURN |
592 |
901 CONTINUE |
593 |
WRITE(msgBuffer,'(A)') |
594 |
&' ' |
595 |
CALL PRINT_MESSAGE(msgBuffer,errorMessageUnit, |
596 |
& SQUEEZE_RIGHT,myThreadId) |
597 |
WRITE(msgBuffer,*) |
598 |
&'*** WARNING WARNING WARNING WARNING WARNING WARNING ***' |
599 |
CALL PRINT_MESSAGE(msgBuffer,errorMessageUnit, |
600 |
& SQUEEZE_RIGHT,myThreadId) |
601 |
WRITE(msgBuffer,*) |
602 |
&'procedure: "',callProc,'".' |
603 |
CALL PRINT_MESSAGE(msgBuffer,errorMessageUnit, |
604 |
& SQUEEZE_RIGHT,myThreadId) |
605 |
WRITE(msgBuffer,*) |
606 |
&'Timer name "',name(ISTART:IEND),'" is invalid.' |
607 |
CALL PRINT_MESSAGE(msgBuffer,errorMessageUnit, |
608 |
& SQUEEZE_RIGHT,myThreadId) |
609 |
WRITE(msgBuffer,*) |
610 |
&' Names must have fewer than',maxString+1,' characters.' |
611 |
CALL PRINT_MESSAGE(msgBuffer,errorMessageUnit, |
612 |
& SQUEEZE_RIGHT,myThreadId) |
613 |
WRITE(msgBuffer,*) |
614 |
&'*******************************************************' |
615 |
CALL PRINT_MESSAGE(msgBuffer,errorMessageUnit, |
616 |
& SQUEEZE_RIGHT,myThreadId) |
617 |
GOTO 1000 |
618 |
902 CONTINUE |
619 |
WRITE(msgBuffer,*) |
620 |
&' ' |
621 |
CALL PRINT_MESSAGE(msgBuffer,errorMessageUnit, |
622 |
& SQUEEZE_RIGHT,myThreadId) |
623 |
WRITE(msgBuffer,*) |
624 |
&'*** WARNING WARNING WARNING WARNING WARNING WARNING ***' |
625 |
CALL PRINT_MESSAGE(msgBuffer,errorMessageUnit, |
626 |
& SQUEEZE_RIGHT,myThreadId) |
627 |
WRITE(msgBuffer,*) |
628 |
&'procedure: "',callProc,'".' |
629 |
CALL PRINT_MESSAGE(msgBuffer,errorMessageUnit, |
630 |
& SQUEEZE_RIGHT,myThreadId) |
631 |
WRITE(msgBuffer,*) |
632 |
&' No timer action specified.' |
633 |
CALL PRINT_MESSAGE(msgBuffer,errorMessageUnit, |
634 |
& SQUEEZE_RIGHT,myThreadId) |
635 |
WRITE(msgBuffer,*) |
636 |
&' Valid actions are:' |
637 |
CALL PRINT_MESSAGE(msgBuffer,errorMessageUnit, |
638 |
& SQUEEZE_RIGHT,myThreadId) |
639 |
WRITE(msgBuffer,*) |
640 |
&' "START", "STOP", "PRINT" and "PRINTALL".' |
641 |
CALL PRINT_MESSAGE(msgBuffer,errorMessageUnit, |
642 |
& SQUEEZE_RIGHT,myThreadId) |
643 |
WRITE(msgBuffer,*) |
644 |
&'*******************************************************' |
645 |
CALL PRINT_MESSAGE(msgBuffer,errorMessageUnit, |
646 |
& SQUEEZE_RIGHT,myThreadId) |
647 |
GOTO 1000 |
648 |
903 CONTINUE |
649 |
WRITE(msgBuffer,*) |
650 |
&' ' |
651 |
CALL PRINT_MESSAGE(msgBuffer,errorMessageUnit, |
652 |
& SQUEEZE_RIGHT,myThreadId) |
653 |
WRITE(msgBuffer,*) |
654 |
&'*** WARNING WARNING WARNING WARNING WARNING WARNING ***' |
655 |
CALL PRINT_MESSAGE(msgBuffer,errorMessageUnit, |
656 |
& SQUEEZE_RIGHT,myThreadId) |
657 |
WRITE(msgBuffer,*) |
658 |
&'procedure: "',callProc,'".' |
659 |
CALL PRINT_MESSAGE(msgBuffer,errorMessageUnit, |
660 |
& SQUEEZE_RIGHT,myThreadId) |
661 |
WRITE(msgBuffer,*) |
662 |
&'Timer action"',name(ISTART:IEND),'" is invalid.' |
663 |
CALL PRINT_MESSAGE(msgBuffer,errorMessageUnit, |
664 |
& SQUEEZE_RIGHT,myThreadId) |
665 |
WRITE(msgBuffer,*) |
666 |
&' Valid actions are:' |
667 |
CALL PRINT_MESSAGE(msgBuffer,errorMessageUnit, |
668 |
& SQUEEZE_RIGHT,myThreadId) |
669 |
WRITE(msgBuffer,*) |
670 |
&' "START", "STOP", "PRINT" and "PRINTALL".' |
671 |
CALL PRINT_MESSAGE(msgBuffer,errorMessageUnit, |
672 |
& SQUEEZE_RIGHT,myThreadId) |
673 |
WRITE(msgBuffer,*) |
674 |
&'*******************************************************' |
675 |
CALL PRINT_MESSAGE(msgBuffer,errorMessageUnit, |
676 |
& SQUEEZE_RIGHT,myThreadId) |
677 |
GOTO 1000 |
678 |
904 CONTINUE |
679 |
WRITE(msgBuffer,*) |
680 |
&' ' |
681 |
CALL PRINT_MESSAGE(msgBuffer,errorMessageUnit, |
682 |
& SQUEEZE_RIGHT,myThreadId) |
683 |
WRITE(msgBuffer,*) |
684 |
&'*** WARNING WARNING WARNING WARNING WARNING WARNING ***' |
685 |
CALL PRINT_MESSAGE(msgBuffer,errorMessageUnit, |
686 |
& SQUEEZE_RIGHT,myThreadId) |
687 |
WRITE(msgBuffer,*) |
688 |
&'procedure: "',callProc,'".' |
689 |
CALL PRINT_MESSAGE(msgBuffer,errorMessageUnit, |
690 |
& SQUEEZE_RIGHT,myThreadId) |
691 |
WRITE(msgBuffer,*) |
692 |
&'Timer "',name(ISTART:IEND),'" cannot be created.' |
693 |
CALL PRINT_MESSAGE(msgBuffer,errorMessageUnit, |
694 |
& SQUEEZE_RIGHT,myThreadId) |
695 |
WRITE(msgBuffer,*) |
696 |
&' Only ',maxTimers,' timers are allowed.' |
697 |
CALL PRINT_MESSAGE(msgBuffer,errorMessageUnit, |
698 |
& SQUEEZE_RIGHT,myThreadId) |
699 |
WRITE(msgBuffer,*) |
700 |
&'*******************************************************' |
701 |
CALL PRINT_MESSAGE(msgBuffer,errorMessageUnit, |
702 |
& SQUEEZE_RIGHT,myThreadId) |
703 |
GOTO 1000 |
704 |
905 CONTINUE |
705 |
WRITE(msgBuffer,*) |
706 |
&' ' |
707 |
CALL PRINT_MESSAGE(msgBuffer,errorMessageUnit, |
708 |
& SQUEEZE_RIGHT,myThreadId) |
709 |
WRITE(msgBuffer,*) |
710 |
&'*** WARNING WARNING WARNING WARNING WARNING WARNING ***' |
711 |
CALL PRINT_MESSAGE(msgBuffer,errorMessageUnit, |
712 |
& SQUEEZE_RIGHT,myThreadId) |
713 |
WRITE(msgBuffer,*) |
714 |
&'procedure: "',callProc,'".' |
715 |
CALL PRINT_MESSAGE(msgBuffer,errorMessageUnit, |
716 |
& SQUEEZE_RIGHT,myThreadId) |
717 |
WRITE(msgBuffer,*) |
718 |
&'Timer name is blank.' |
719 |
CALL PRINT_MESSAGE(msgBuffer,errorMessageUnit, |
720 |
& SQUEEZE_RIGHT,myThreadId) |
721 |
WRITE(msgBuffer,*) |
722 |
&' A name must be used with "START", "STOP" or "PRINT".' |
723 |
CALL PRINT_MESSAGE(msgBuffer,errorMessageUnit, |
724 |
& SQUEEZE_RIGHT,myThreadId) |
725 |
WRITE(msgBuffer,*) |
726 |
&'*******************************************************' |
727 |
CALL PRINT_MESSAGE(msgBuffer,errorMessageUnit, |
728 |
& SQUEEZE_RIGHT,myThreadId) |
729 |
GOTO 1000 |
730 |
|
731 |
71 FORMAT(A,' per sec ',D13.7,' ',D13.7,', number ', D13.7) |
732 |
72 FORMAT(A,D13.7) |
733 |
END |
734 |
|
735 |
CBOP |
736 |
C !ROUTINE: TIMER_GET_TIME |
737 |
|
738 |
C !INTERFACE: |
739 |
SUBROUTINE TIMER_GET_TIME( |
740 |
O userTime, |
741 |
O systemTime, |
742 |
O wallClockTime ) |
743 |
IMPLICIT NONE |
744 |
|
745 |
C !DESCRIPTION: |
746 |
C *==========================================================* |
747 |
C | SUBROUTINE TIMER\_GET\_TIME |
748 |
C | o Query system timer routines. |
749 |
C *==========================================================* |
750 |
C | Routine returns total elapsed time for program so far. |
751 |
C | Three times are returned that conventionally are used as |
752 |
C | user time, system time and wall-clock time. Not all these |
753 |
C | numbers are available on all machines. |
754 |
C *==========================================================* |
755 |
|
756 |
C !INPUT/OUTPUT PARAMETERS: |
757 |
C userTime :: User time returned |
758 |
C systemTime :: System time returned |
759 |
C wallClockTime :: Wall clock time returned |
760 |
|
761 |
Real*8 userTime |
762 |
Real*8 systemTime |
763 |
Real*8 wallClockTime |
764 |
|
765 |
C The following was seriously hacked around by Mark Hadfield |
766 |
C October 2006 |
767 |
|
768 |
#ifdef IGNORE_TIME |
769 |
|
770 |
userTime = 0. |
771 |
systemTime = 0. |
772 |
wallClockTime = 0. |
773 |
|
774 |
#else |
775 |
|
776 |
C Declarations follow the same preprocessor structure as the |
777 |
C executable code below. |
778 |
|
779 |
# if defined (TARGET_AIX) || defined (TARGET_BGL) |
780 |
Real*4 etime_ |
781 |
Real*8 timenow |
782 |
external etime_, timenow |
783 |
Real*4 actual, tarray(2) |
784 |
# elif (defined TARGET_T3E || defined TARGET_CRAY_VECTOR) |
785 |
real second, secondr |
786 |
external second, secondr |
787 |
# else |
788 |
# ifdef HAVE_ETIME |
789 |
Real*4 etime |
790 |
EXTERNAL etime |
791 |
Real*4 actual, tarray(2) |
792 |
# else |
793 |
Real*8 csystemtime, cusertime |
794 |
external csystemtime, cusertime |
795 |
# endif |
796 |
# if defined HAVE_CLOC |
797 |
Real*8 wtime |
798 |
# elif (defined (ALLOW_USE_MPI) && defined (USE_MPI_WTIME)) |
799 |
C No declarations necessary |
800 |
# else |
801 |
Real*8 timenow |
802 |
external timenow |
803 |
# endif /* HAVE_CLOC */ |
804 |
# endif |
805 |
CEOP |
806 |
|
807 |
C Executable code |
808 |
|
809 |
CCE107 Fixed for AIX and UNICOS |
810 |
# if defined(TARGET_AIX) || defined(TARGET_BGL) |
811 |
ACTUAL = ETIME_(TARRAY) |
812 |
userTime = TARRAY(1) |
813 |
systemTime = TARRAY(2) |
814 |
wallClockTime = timenow() |
815 |
# elif (defined (TARGET_T3E) || defined (TARGET_CRAY_VECTOR)) |
816 |
userTime = SECOND() |
817 |
systemTime = 0. |
818 |
wallClockTime = SECONDR() |
819 |
# else |
820 |
# ifdef HAVE_ETIME |
821 |
actual = etime(tarray) |
822 |
userTime = tarray(1) |
823 |
systemTime = tarray(2) |
824 |
# else |
825 |
userTime = cusertime() |
826 |
systemTime = csystemtime() |
827 |
# endif |
828 |
# if defined HAVE_CLOC |
829 |
CALL cloc(wTime) |
830 |
wallClockTime = wtime |
831 |
# elif (defined (ALLOW_USE_MPI) && defined (USE_MPI_WTIME)) |
832 |
wallClockTime = MPI_Wtime() |
833 |
# else |
834 |
wallClockTime = timenow() |
835 |
# endif |
836 |
# endif |
837 |
#endif |
838 |
|
839 |
RETURN |
840 |
END |
841 |
|
842 |
|
843 |
|
844 |
|
845 |
CBOP |
846 |
|
847 |
C !ROUTINE: TIMER_PRINTALL |
848 |
|
849 |
C !INTERFACE: |
850 |
SUBROUTINE TIMER_PRINTALL( myThreadId ) |
851 |
IMPLICIT NONE |
852 |
|
853 |
C !DESCRIPTION: |
854 |
C *==========================================================* |
855 |
C | SUBROUTINE TIMER\_PRINTALL |
856 |
C | o Print timer information |
857 |
C *==========================================================* |
858 |
C | Request print out of table of timing from all timers. |
859 |
C *==========================================================* |
860 |
|
861 |
C !INPUT PARAMETERS: |
862 |
C myThreadId :: This threads number |
863 |
INTEGER myThreadId |
864 |
CEOP |
865 |
|
866 |
CALL TIMER_CONTROL( ' ', 'PRINTALL', 'TIMER_PRINTALL' , |
867 |
& myThreadId ) |
868 |
C |
869 |
RETURN |
870 |
END |
871 |
|
872 |
CBOP |
873 |
C !ROUTINE: TIMER_START |
874 |
|
875 |
C !INTERFACE: |
876 |
SUBROUTINE TIMER_START ( string , myThreadId ) |
877 |
IMPLICIT NONE |
878 |
|
879 |
C !DESCRIPTION: |
880 |
C Start timer named "string". |
881 |
|
882 |
C !INPUT PARAMETERS: |
883 |
C string :: Name of timer |
884 |
C myThreadId :: My thread number |
885 |
CHARACTER*(*) string |
886 |
INTEGER myThreadId |
887 |
CEOP |
888 |
C |
889 |
CALL TIMER_CONTROL( string, 'START', 'TIMER_START' , myThreadId) |
890 |
C |
891 |
RETURN |
892 |
END |
893 |
CBOP |
894 |
C !ROUTINE: TIMER_STOP |
895 |
|
896 |
C !INTERFACE: |
897 |
SUBROUTINE TIMER_STOP ( string , myThreadId ) |
898 |
IMPLICIT NONE |
899 |
|
900 |
C !DESCRIPTION: |
901 |
C Stop timer named "string". |
902 |
|
903 |
C !INPUT PARAMETERS: |
904 |
C string :: Name of timer |
905 |
C myThreadId :: My thread number |
906 |
CHARACTER*(*) string |
907 |
INTEGER myThreadId |
908 |
CEOP |
909 |
C |
910 |
CALL TIMER_CONTROL( string, 'STOP', 'TIMER_STOP' , myThreadId ) |
911 |
C |
912 |
RETURN |
913 |
END |
914 |
C*********************************************************************** |
915 |
|
916 |
#ifdef USE_PAPI |
917 |
CCE107 Initialization of common block for PAPI timers |
918 |
BLOCK DATA setpapivalues |
919 |
#include "EEPARAMS.h" |
920 |
INTEGER maxTimers |
921 |
PARAMETER (maxTimers = 50) |
922 |
INTEGER nmaxevents |
923 |
PARAMETER (nmaxevents = 18) |
924 |
INTEGER size |
925 |
PARAMETER (size = 3*nmaxevents*maxTimers*MAX_NO_THREADS) |
926 |
INTEGER*8 values(nmaxevents, maxTimers , MAX_NO_THREADS), |
927 |
$ values1(nmaxevents, maxTimers, MAX_NO_THREADS), |
928 |
$ values2(nmaxevents, maxTimers, MAX_NO_THREADS) |
929 |
COMMON /papivalues/ values, values1, values2 |
930 |
DATA values, values1, values2 /size*0/ |
931 |
END |
932 |
#endif |
933 |
#if defined(USE_PCL_FLOPS_SFP) || defined(USE_PCL_FLOPS) || defined(USE_PCL) |
934 |
CCE107 Initialization of common block for PCL event names |
935 |
BLOCK DATA setpclnames |
936 |
INTEGER nmaxevents |
937 |
PARAMETER (nmaxevents = 61) |
938 |
CHARACTER*22 pcl_counter_name(0:nmaxevents-1) |
939 |
COMMON /pclnames/ pcl_counter_name |
940 |
DATA pcl_counter_name(0) /'PCL_L1CACHE_READ'/ |
941 |
DATA pcl_counter_name(1) /'PCL_L1CACHE_WRITE'/ |
942 |
DATA pcl_counter_name(2) /'PCL_L1CACHE_READWRITE'/ |
943 |
DATA pcl_counter_name(3) /'PCL_L1CACHE_HIT'/ |
944 |
DATA pcl_counter_name(4) /'PCL_L1CACHE_MISS'/ |
945 |
DATA pcl_counter_name(5) /'PCL_L1DCACHE_READ'/ |
946 |
DATA pcl_counter_name(6) /'PCL_L1DCACHE_WRITE'/ |
947 |
DATA pcl_counter_name(7) /'PCL_L1DCACHE_READWRITE'/ |
948 |
DATA pcl_counter_name(8) /'PCL_L1DCACHE_HIT'/ |
949 |
DATA pcl_counter_name(9) /'PCL_L1DCACHE_MISS'/ |
950 |
DATA pcl_counter_name(10) /'PCL_L1ICACHE_READ'/ |
951 |
DATA pcl_counter_name(11) /'PCL_L1ICACHE_WRITE'/ |
952 |
DATA pcl_counter_name(12) /'PCL_L1ICACHE_READWRITE'/ |
953 |
DATA pcl_counter_name(13) /'PCL_L1ICACHE_HIT'/ |
954 |
DATA pcl_counter_name(14) /'PCL_L1ICACHE_MISS'/ |
955 |
DATA pcl_counter_name(15) /'PCL_L2CACHE_READ'/ |
956 |
DATA pcl_counter_name(16) /'PCL_L2CACHE_WRITE'/ |
957 |
DATA pcl_counter_name(17) /'PCL_L2CACHE_READWRITE'/ |
958 |
DATA pcl_counter_name(18) /'PCL_L2CACHE_HIT'/ |
959 |
DATA pcl_counter_name(19) /'PCL_L2CACHE_MISS'/ |
960 |
DATA pcl_counter_name(20) /'PCL_L2DCACHE_READ'/ |
961 |
DATA pcl_counter_name(21) /'PCL_L2DCACHE_WRITE'/ |
962 |
DATA pcl_counter_name(22) /'PCL_L2DCACHE_READWRITE'/ |
963 |
DATA pcl_counter_name(23) /'PCL_L2DCACHE_HIT'/ |
964 |
DATA pcl_counter_name(24) /'PCL_L2DCACHE_MISS'/ |
965 |
DATA pcl_counter_name(25) /'PCL_L2ICACHE_READ'/ |
966 |
DATA pcl_counter_name(26) /'PCL_L2ICACHE_WRITE'/ |
967 |
DATA pcl_counter_name(27) /'PCL_L2ICACHE_READWRITE'/ |
968 |
DATA pcl_counter_name(28) /'PCL_L2ICACHE_HIT'/ |
969 |
DATA pcl_counter_name(29) /'PCL_L2ICACHE_MISS'/ |
970 |
DATA pcl_counter_name(30) /'PCL_TLB_HIT'/ |
971 |
DATA pcl_counter_name(31) /'PCL_TLB_MISS'/ |
972 |
DATA pcl_counter_name(32) /'PCL_ITLB_HIT'/ |
973 |
DATA pcl_counter_name(33) /'PCL_ITLB_MISS'/ |
974 |
DATA pcl_counter_name(34) /'PCL_DTLB_HIT'/ |
975 |
DATA pcl_counter_name(35) /'PCL_DTLB_MISS'/ |
976 |
DATA pcl_counter_name(36) /'PCL_CYCLES'/ |
977 |
DATA pcl_counter_name(37) /'PCL_ELAPSED_CYCLES'/ |
978 |
DATA pcl_counter_name(38) /'PCL_INTEGER_INSTR'/ |
979 |
DATA pcl_counter_name(39) /'PCL_FP_INSTR'/ |
980 |
DATA pcl_counter_name(40) /'PCL_LOAD_INSTR'/ |
981 |
DATA pcl_counter_name(41) /'PCL_STORE_INSTR'/ |
982 |
DATA pcl_counter_name(42) /'PCL_LOADSTORE_INSTR'/ |
983 |
DATA pcl_counter_name(43) /'PCL_INSTR'/ |
984 |
DATA pcl_counter_name(44) /'PCL_JUMP_SUCCESS'/ |
985 |
DATA pcl_counter_name(45) /'PCL_JUMP_UNSUCCESS'/ |
986 |
DATA pcl_counter_name(46) /'PCL_JUMP'/ |
987 |
DATA pcl_counter_name(47) /'PCL_ATOMIC_SUCCESS'/ |
988 |
DATA pcl_counter_name(48) /'PCL_ATOMIC_UNSUCCESS'/ |
989 |
DATA pcl_counter_name(49) /'PCL_ATOMIC'/ |
990 |
DATA pcl_counter_name(50) /'PCL_STALL_INTEGER'/ |
991 |
DATA pcl_counter_name(51) /'PCL_STALL_FP'/ |
992 |
DATA pcl_counter_name(52) /'PCL_STALL_JUMP'/ |
993 |
DATA pcl_counter_name(53) /'PCL_STALL_LOAD'/ |
994 |
DATA pcl_counter_name(54) /'PCL_STALL_STORE'/ |
995 |
DATA pcl_counter_name(55) /'PCL_STALL'/ |
996 |
DATA pcl_counter_name(56) /'PCL_MFLOPS'/ |
997 |
DATA pcl_counter_name(57) /'PCL_IPC'/ |
998 |
DATA pcl_counter_name(58) /'PCL_L1DCACHE_MISSRATE'/ |
999 |
DATA pcl_counter_name(59) /'PCL_L2DCACHE_MISSRATE'/ |
1000 |
DATA pcl_counter_name(60) /'PCL_MEM_FP_RATIO'/ |
1001 |
END |
1002 |
|
1003 |
|
1004 |
#ifdef USE_PCL |
1005 |
CCE107 Initialization of common block for PCL summary performance |
1006 |
BLOCK DATA setpcls |
1007 |
#include "EEPARAMS.h" |
1008 |
INTEGER maxTimers |
1009 |
PARAMETER (maxTimers = 50) |
1010 |
INTEGER nmaxevents |
1011 |
PARAMETER (nmaxevents = 61) |
1012 |
INTEGER size |
1013 |
PARAMETER (size = nmaxevents*maxTimers*MAX_NO_THREADS) |
1014 |
INTEGER PCL_CYCLES, PCL_MODE_USER_SYSTEM |
1015 |
PARAMETER (PCL_CYCLES=36, PCL_MODE_USER_SYSTEM=3) |
1016 |
INTEGER pcl_counter_list(nmaxevents) |
1017 |
INTEGER flags, nevents |
1018 |
INTEGER*8 i_result(nmaxevents, maxTimers, MAX_NO_THREADS) |
1019 |
INTEGER*8 i_result1(nmaxevents, maxTimers, MAX_NO_THREADS) |
1020 |
INTEGER*8 i_result2(nmaxevents, maxTimers, MAX_NO_THREADS) |
1021 |
INTEGER*8 descr |
1022 |
REAL*8 fp_result(nmaxevents, maxTimers, MAX_NO_THREADS) |
1023 |
COMMON /pclvars/ i_result, descr, fp_result, pcl_counter_list, |
1024 |
$ flags, nevents |
1025 |
DATA fp_result /size*0.0D0/ |
1026 |
DATA i_result /size*0/ |
1027 |
DATA i_result1 /size*0/ |
1028 |
DATA i_result2 /size*0/ |
1029 |
DATA descr /0/ |
1030 |
DATA nevents /nmaxevents/ |
1031 |
DATA pcl_counter_list /nmaxevents*PCL_CYCLES/ |
1032 |
DATA flags /PCL_MODE_USER_SYSTEM/ |
1033 |
END |
1034 |
#else |
1035 |
CCE107 Initialization of common block for PCL summary performance |
1036 |
BLOCK DATA setpcls |
1037 |
INTEGER PCL_MFLOPS, PCL_IPC, PCL_L1DCACHE_MISSRATE, |
1038 |
$ PCL_L2DCACHE_MISSRATE, PCL_MEM_FP_RATIO |
1039 |
PARAMETER (PCL_MFLOPS=56, PCL_IPC=57, PCL_L1DCACHE_MISSRATE=58, |
1040 |
$ PCL_L2DCACHE_MISSRATE=59, PCL_MEM_FP_RATIO=60) |
1041 |
INTEGER PCL_MODE_USER_SYSTEM |
1042 |
PARAMETER (PCL_MODE_USER_SYSTEM=3) |
1043 |
INTEGER pcl_counter_list(5), flags, nevents |
1044 |
INTEGER*8 i_result(5), descr |
1045 |
REAL*8 fp_result(5) |
1046 |
COMMON /pclvars/ i_result, descr, fp_result, pcl_counter_list, |
1047 |
$ flags, nevents |
1048 |
DATA fp_result /5*0.0D0/ |
1049 |
DATA i_result /5*0/ |
1050 |
DATA descr /0/ |
1051 |
DATA nevents /0/ |
1052 |
DATA pcl_counter_list /PCL_MFLOPS, PCL_IPC, PCL_L1DCACHE_MISSRATE, |
1053 |
$ PCL_L2DCACHE_MISSRATE, PCL_MEM_FP_RATIO/ |
1054 |
DATA flags /PCL_MODE_USER_SYSTEM/ |
1055 |
END |
1056 |
#endif |
1057 |
#endif |