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