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