1 |
#include "CPP_EEOPTIONS.h" |
2 |
|
3 |
SUBROUTINE COMM_STATS |
4 |
C /==========================================================\ |
5 |
C | SUBROUTINE COMM_STATS | |
6 |
C | o Print out statistics from communication routines. | |
7 |
C \==========================================================/ |
8 |
IMPLICIT NONE |
9 |
|
10 |
C == Global variables == |
11 |
#include "SIZE.h" |
12 |
#include "EEPARAMS.h" |
13 |
#include "EESUPPORT.h" |
14 |
#include "EXCH.h" |
15 |
#include "BAR2.h" |
16 |
|
17 |
C == Local variables == |
18 |
INTEGER bi, bj, I |
19 |
CHARACTER*(MAX_LEN_MBUF) msgBuf |
20 |
CHARACTER*8 orientation |
21 |
|
22 |
C o For each tile print its excange statistics |
23 |
WRITE(msgBuf,'(A)') |
24 |
& '// ======================================================' |
25 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
26 |
& SQUEEZE_RIGHT , 1) |
27 |
WRITE(msgBuf,'(A)') '// Tile <-> Tile communication statistics' |
28 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
29 |
& SQUEEZE_RIGHT , 1) |
30 |
WRITE(msgBuf,'(A)') |
31 |
& '// ======================================================' |
32 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
33 |
& SQUEEZE_RIGHT , 1) |
34 |
|
35 |
IF ( exchCollectStatistics ) THEN |
36 |
DO bj=1,nSy |
37 |
DO bi=1,nSx |
38 |
WRITE(msgBuf,'(A,A,I6.6)') |
39 |
& '//',' o Tile number: ',tileNo(bi,bj) |
40 |
CALL PRINT_MESSAGE(msgBuf,standardMessageUnit, |
41 |
& SQUEEZE_RIGHT , 1) |
42 |
C o X exchange stats. |
43 |
WRITE(msgBuf,'(A,A,I15)') |
44 |
& '//',' No. X exchanges =',exchRecvXExchCount(1,bi,bj) |
45 |
CALL PRINT_MESSAGE(msgBuf,standardMessageUnit, |
46 |
& SQUEEZE_RIGHT , 1) |
47 |
WRITE(msgBuf,'(A,A,I15)') |
48 |
& '//',' Max. X spins =',exchRecvXSpinMax (1,bi,bj) |
49 |
CALL PRINT_MESSAGE(msgBuf,standardMessageUnit, |
50 |
& SQUEEZE_RIGHT , 1) |
51 |
WRITE(msgBuf,'(A,A,I15)') |
52 |
& '//',' Min. X spins =',exchRecvXSpinMin (1,bi,bj) |
53 |
CALL PRINT_MESSAGE(msgBuf,standardMessageUnit, |
54 |
& SQUEEZE_RIGHT , 1) |
55 |
WRITE(msgBuf,'(A,A,I15)') |
56 |
& '//',' Total. X spins =',exchRecvXSpinCount(1,bi,bj) |
57 |
CALL PRINT_MESSAGE(msgBuf,standardMessageUnit, |
58 |
& SQUEEZE_RIGHT , 1) |
59 |
IF ( FLOAT(exchRecvXExchCount(1,bi,bj)) .NE. 0. ) THEN |
60 |
WRITE(msgBuf,'(A,A,1PE15.2)') |
61 |
& '//',' Avg. X spins =', |
62 |
& FLOAT(exchRecvXSpinCount(1,bi,bj))/FLOAT(exchRecvXExchCount(1,bi,bj)) |
63 |
ELSE |
64 |
WRITE(msgBuf,'(A,A,1PE15.2)') |
65 |
& '//',' Avg. X spins =', |
66 |
& 0. |
67 |
ENDIF |
68 |
CALL PRINT_MESSAGE(msgBuf,standardMessageUnit, |
69 |
& SQUEEZE_RIGHT , 1) |
70 |
C o Y exchange stats. |
71 |
WRITE(msgBuf,'(A,A,I15)') |
72 |
& '//',' No. Y exchanges =',exchRecvYExchCount(1,bi,bj) |
73 |
CALL PRINT_MESSAGE(msgBuf,standardMessageUnit, |
74 |
& SQUEEZE_RIGHT , 1) |
75 |
WRITE(msgBuf,'(A,A,I15)') |
76 |
& '//',' Max. Y spins =',exchRecvYSpinMax (1,bi,bj) |
77 |
CALL PRINT_MESSAGE(msgBuf,standardMessageUnit, |
78 |
& SQUEEZE_RIGHT , 1) |
79 |
WRITE(msgBuf,'(A,A,I15)') |
80 |
& '//',' Min. Y spins =',exchRecvYSpinMin (1,bi,bj) |
81 |
CALL PRINT_MESSAGE(msgBuf,standardMessageUnit, |
82 |
& SQUEEZE_RIGHT , 1) |
83 |
WRITE(msgBuf,'(A,A,I15)') |
84 |
& '//',' Total. Y spins =',exchRecvYSpinCount(1,bi,bj) |
85 |
CALL PRINT_MESSAGE(msgBuf,standardMessageUnit, |
86 |
& SQUEEZE_RIGHT , 1) |
87 |
IF ( FLOAT(exchRecvYExchCount(1,bi,bj)) .NE. 0. ) THEN |
88 |
WRITE(msgBuf,'(A,A,1PE15.2)') |
89 |
& '//',' Avg. Y spins =', |
90 |
& FLOAT(exchRecvYSpinCount(1,bi,bj))/FLOAT(exchRecvYExchCount(1,bi,bj)) |
91 |
ELSE |
92 |
WRITE(msgBuf,'(A,A,1PE15.2)') |
93 |
& '//',' Avg. Y spins =', |
94 |
& 0. |
95 |
ENDIF |
96 |
CALL PRINT_MESSAGE(msgBuf,standardMessageUnit, |
97 |
& SQUEEZE_RIGHT , 1) |
98 |
|
99 |
ENDDO |
100 |
ENDDO |
101 |
ENDIF |
102 |
|
103 |
IF ( bar2CollectStatistics ) THEN |
104 |
DO I=1,nThreads |
105 |
WRITE(msgBuf,'(A,A,I6.6)') |
106 |
& '//',' o Thread number: ',I |
107 |
CALL PRINT_MESSAGE(msgBuf,standardMessageUnit, |
108 |
& SQUEEZE_RIGHT , 1) |
109 |
WRITE(msgBuf,'(A,A,I15)') |
110 |
& '//',' No. barriers =',BAR2_barrierCount(1,I) |
111 |
CALL PRINT_MESSAGE(msgBuf,standardMessageUnit, |
112 |
& SQUEEZE_RIGHT , 1) |
113 |
WRITE(msgBuf,'(A,A,I15)') |
114 |
& '//',' Max. barrier spins =',BAR2_spinsMax(1,I) |
115 |
CALL PRINT_MESSAGE(msgBuf,standardMessageUnit, |
116 |
& SQUEEZE_RIGHT , 1) |
117 |
WRITE(msgBuf,'(A,A,I15)') |
118 |
& '//',' Min. barrier spins =',BAR2_spinsMin(1,I) |
119 |
CALL PRINT_MESSAGE(msgBuf,standardMessageUnit, |
120 |
& SQUEEZE_RIGHT , 1) |
121 |
WRITE(msgBuf,'(A,A,I15)') |
122 |
& '//',' Total barrier spins =',BAR2_spinsCount(1,I) |
123 |
CALL PRINT_MESSAGE(msgBuf,standardMessageUnit, |
124 |
& SQUEEZE_RIGHT , 1) |
125 |
IF ( FLOAT(BAR2_spinsCount(1,I)) .NE. 0. ) THEN |
126 |
WRITE(msgBuf,'(A,A,1PE15.2)') |
127 |
& '//',' Avg. barrier spins =', |
128 |
& FLOAT(BAR2_spinsCount(1,I))/FLOAT(BAR2_barrierCount(1,I)) |
129 |
ELSE |
130 |
WRITE(msgBuf,'(A,A,1PE15.2)') |
131 |
& '//',' Avg. barrier spins =', |
132 |
& 0. |
133 |
ENDIF |
134 |
CALL PRINT_MESSAGE(msgBuf,standardMessageUnit, |
135 |
& SQUEEZE_RIGHT , 1) |
136 |
ENDDO |
137 |
ENDIF |
138 |
|
139 |
C |
140 |
RETURN |
141 |
END |
142 |
|