/[MITgcm]/MITgcm/eesupp/inc/EXCH.h
ViewVC logotype

Contents of /MITgcm/eesupp/inc/EXCH.h

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.5 - (show annotations) (download)
Fri Apr 2 15:33:58 2004 UTC (19 years, 11 months ago) by cnh
Branch: MAIN
Changes since 1.4: +42 -2 lines
File MIME type: text/plain
Changes that allow JPL Kalman filter to use 32-bit or 64-bit exchanges independent of
what _RS and _RL are

1 C $Header: /u/u0/gcmpack/MITgcm/eesupp/inc/EXCH.h,v 1.4 2001/09/21 03:54:35 cnh Exp $
2 C $Name: $
3 C
4 CBOP
5 C !ROUTINE: EXCH.h
6 C !INTERFACE:
7 C include "EXCH.h"
8 C
9 C !DESCRIPTION:
10 C *==========================================================*
11 C | EXCH.h
12 C *==========================================================*
13 C | Support data structures for the MITgcm UV "exchange
14 C | routines" code. This data should be private to the
15 C | execution environment routines.
16 C *==========================================================*
17 CEOP
18
19 #ifndef _RL
20 #define _RL Real*8
21 #endif
22
23 #ifndef _RS
24 #define _RS Real*4
25 #endif
26
27 #ifndef _tileCommModeW
28 #define _tileCommModeW(a,b) tileCommModeW(a,b)
29 #endif
30
31 #ifndef _tileCommModeE
32 #define _tileCommModeE(a,b) tileCommModeE(a,b)
33 #endif
34
35 #ifndef _tileBiE
36 #define _tileBiE(a,b) tileBiE(a,b)
37 #endif
38
39 #ifndef _tileBiW
40 #define _tileBiW(a,b) tileBiW(a,b)
41 #endif
42
43 #ifndef _tileBjE
44 #define _tileBjE(a,b) tileBjE(a,b)
45 #endif
46
47 #ifndef _tileBjW
48 #define _tileBjW(a,b) tileBjW(a,b)
49 #endif
50
51 #ifndef _mpiPidW
52 #define _mpiPidW(a,b) pidW(a,b)
53 #endif
54
55 #ifndef _mpiIdE
56 #define _mpiIdE(a,b) pidE(a,b)
57 #endif
58
59 #ifndef _tileTagSendW
60 #define _tileTagSendW(a,b) tileTagSendW(a,b)
61 #endif
62
63 #ifndef _tileTagSendE
64 #define _tileTagSendE(a,b) tileTagSendE(a,b)
65 #endif
66
67 #ifndef _tileTagRecvW
68 #define _tileTagRecvW(a,b) tileTagRecvW(a,b)
69 #endif
70
71 #ifndef _tileTagRecvE
72 #define _tileTagRecvE(a,b) tileTagRecvE(a,b)
73 #endif
74
75 #ifndef _tileCommModeS
76 #define _tileCommModeS(a,b) tileCommModeS(a,b)
77 #endif
78
79 #ifndef _tileCommModeN
80 #define _tileCommModeN(a,b) tileCommModeN(a,b)
81 #endif
82
83 #ifndef _tileBiN
84 #define _tileBiN(a,b) tileBiN(a,b)
85 #endif
86
87 #ifndef _tileBiS
88 #define _tileBiS(a,b) tileBiS(a,b)
89 #endif
90
91 #ifndef _tileBjN
92 #define _tileBjN(a,b) tileBjN(a,b)
93 #endif
94
95 #ifndef _tileBjS
96 #define _tileBjS(a,b) tileBjS(a,b)
97 #endif
98
99 #ifndef _mpiPidS
100 #define _mpiPidS(a,b) pidS(a,b)
101 #endif
102
103 #ifndef _mpiIdN
104 #define _mpiIdN(a,b) pidN(a,b)
105 #endif
106
107 #ifndef _tileTagSendS
108 #define _tileTagSendS(a,b) tileTagSendS(a,b)
109 #endif
110
111 #ifndef _tileTagSendN
112 #define _tileTagSendN(a,b) tileTagSendN(a,b)
113 #endif
114
115 #ifndef _tileTagRecvS
116 #define _tileTagRecvS(a,b) tileTagRecvS(a,b)
117 #endif
118
119 #ifndef _tileTagRecvN
120 #define _tileTagRecvN(a,b) tileTagRecvN(a,b)
121 #endif
122
123 #ifndef _theSimulationMode
124 #define _theSimulationMode theSimulationMode
125 #endif
126
127 #ifndef _EXCH_SPIN_LIMIT
128 #define _EXCH_SPIN_LIMIT EXCH_SPIN_LIMIT
129 #endif
130
131 C MAX_OLX_EXCH - Maximum overlap region allowed in X
132 C MAX_OLY_EXCH - Maximum overlap region allowed in Y
133 C MAX_NR_EXCH - Maximum number of vertical levels allowed
134 C NUMBER_OF_BUFFER_LEVELS - Number of levels of buffer allowed.
135 C EXCH_SPIN_LIMIT - Error trapping threshold for deadlocked exchange
136 INTEGER MAX_OLX_EXCH
137 PARAMETER ( MAX_OLX_EXCH = MAX_OLX )
138 INTEGER MAX_OLY_EXCH
139 PARAMETER ( MAX_OLY_EXCH = MAX_OLY )
140 INTEGER MAX_NR_EXCH
141 PARAMETER ( MAX_NR_EXCH = nR + 1 )
142 INTEGER NUMBER_OF_BUFFER_LEVELS
143 PARAMETER ( NUMBER_OF_BUFFER_LEVELS = 1 )
144 INTEGER EXCH_SPIN_LIMIT
145 PARAMETER ( EXCH_SPIN_LIMIT = 100000000 )
146
147 C
148 C L_BUFFER[XY] - Maximum size for exchange buffer in
149 C L_WBUFFER west,
150 C L_EBUFFER east,
151 C L_SBUFFER south,
152 C L_NBUFFER north.
153 INTEGER L_BUFFERX
154 PARAMETER ( L_BUFFERX =
155 & (sNy+2*MAX_OLY_EXCH)*MAX_OLX_EXCH*MAX_NR_EXCH )
156 INTEGER L_BUFFERY
157 PARAMETER ( L_BUFFERY =
158 & (sNx+2*MAX_OLX_EXCH)*MAX_OLY_EXCH*MAX_NR_EXCH )
159 INTEGER L_WBUFFER
160 INTEGER L_EBUFFER
161 INTEGER L_SBUFFER
162 INTEGER L_NBUFFER
163 PARAMETER ( L_WBUFFER = L_BUFFERX,
164 & L_EBUFFER = L_BUFFERX,
165 & L_SBUFFER = L_BUFFERY,
166 & L_NBUFFER = L_BUFFERY )
167
168 C-- COMMON / EXCH_L / LOGICAL number common arrays for exchanges
169 C exchNeedsMemSync - TRUE if memory sync. required to ensure
170 C memory consistency during exchange
171 C exchUsesBarrier - TRUE if we use a call to BAR to do sync.
172 C between processes. On some machines we wont
173 C spin on the Ack setting ( the T90 ),
174 C instead we will use s system barrier.
175 C On the T90 the system barrier is very fast and
176 C switches out the thread while it waits. On most
177 C machines the system barrier is much too slow and if
178 C we own the machine and have one thread per process
179 C preemption is not a problem.
180 C exchCollectStatistics - Turns exchange statistics collecting on and off.
181
182 COMMON / EXCH_L / exchNeedsMemSync, exchUsesBarrier,
183 & exchCollectStatistics
184 LOGICAL exchNeedsMemSync
185 LOGICAL exchUsesBarrier
186 LOGICAL exchCollectStatistics
187
188 C-- COMMON / EXCH_R / REAL number common arrays for exchanges
189 C xxxxSendBuf - Buffer used for sending data to another tile.
190 C xxxxRecvBuf - Buffer used for receiving data from another tile.
191 COMMON / EXCH_R /
192 & westSendBuf_RL, eastSendBuf_RL,
193 & southSendBuf_RL, northSendBuf_RL,
194 & westRecvBuf_RL, eastRecvBuf_RL,
195 & southRecvBuf_RL, northRecvBuf_RL,
196 & westSendBuf_RS, eastSendBuf_RS,
197 & southSendBuf_RS, northSendBuf_RS,
198 & westRecvBuf_RS, eastRecvBuf_RS,
199 & southRecvBuf_RS, northRecvBuf_RS,
200 & westSendBuf_R8, eastSendBuf_R8,
201 & southSendBuf_R8, northSendBuf_R8,
202 & westRecvBuf_R8, eastRecvBuf_R8,
203 & southRecvBuf_R8, northRecvBuf_R8,
204 & westSendBuf_R4, eastSendBuf_R4,
205 & southSendBuf_R4, northSendBuf_R4,
206 & westRecvBuf_R4, eastRecvBuf_R4,
207 & southRecvBuf_R4, northRecvBuf_R4
208 _RL westSendBuf_RL( L_WBUFFER, NUMBER_OF_BUFFER_LEVELS,
209 & nSx, nSy )
210 _RL eastSendBuf_RL( L_EBUFFER, NUMBER_OF_BUFFER_LEVELS,
211 & nSx, nSy )
212 _RL southSendBuf_RL( L_SBUFFER, NUMBER_OF_BUFFER_LEVELS,
213 & nSx, nSy )
214 _RL northSendBuf_RL( L_NBUFFER, NUMBER_OF_BUFFER_LEVELS,
215 & nSx, nSy )
216 _RL westRecvBuf_RL( L_WBUFFER, NUMBER_OF_BUFFER_LEVELS,
217 & nSx, nSy )
218 _RL eastRecvBuf_RL( L_EBUFFER, NUMBER_OF_BUFFER_LEVELS,
219 & nSx, nSy )
220 _RL southRecvBuf_RL( L_SBUFFER, NUMBER_OF_BUFFER_LEVELS,
221 & nSx, nSy )
222 _RL northRecvBuf_RL( L_NBUFFER, NUMBER_OF_BUFFER_LEVELS,
223 & nSx, nSy )
224 _RS westSendBuf_RS( L_WBUFFER, NUMBER_OF_BUFFER_LEVELS,
225 & nSx, nSy )
226 _RS eastSendBuf_RS( L_EBUFFER, NUMBER_OF_BUFFER_LEVELS,
227 & nSx, nSy )
228 _RS southSendBuf_RS( L_SBUFFER, NUMBER_OF_BUFFER_LEVELS,
229 & nSx, nSy )
230 _RS northSendBuf_RS( L_NBUFFER, NUMBER_OF_BUFFER_LEVELS,
231 & nSx, nSy )
232 _RS westRecvBuf_RS( L_WBUFFER, NUMBER_OF_BUFFER_LEVELS,
233 & nSx, nSy )
234 _RS eastRecvBuf_RS( L_EBUFFER, NUMBER_OF_BUFFER_LEVELS,
235 & nSx, nSy )
236 _RS southRecvBuf_RS( L_SBUFFER, NUMBER_OF_BUFFER_LEVELS,
237 & nSx, nSy )
238 _RS northRecvBuf_RS( L_NBUFFER, NUMBER_OF_BUFFER_LEVELS,
239 & nSx, nSy )
240 _R8 westSendBuf_R8( L_WBUFFER, NUMBER_OF_BUFFER_LEVELS,
241 & nSx, nSy )
242 _R8 eastSendBuf_R8( L_EBUFFER, NUMBER_OF_BUFFER_LEVELS,
243 & nSx, nSy )
244 _R8 southSendBuf_R8( L_SBUFFER, NUMBER_OF_BUFFER_LEVELS,
245 & nSx, nSy )
246 _R8 northSendBuf_R8( L_NBUFFER, NUMBER_OF_BUFFER_LEVELS,
247 & nSx, nSy )
248 _R8 westRecvBuf_R8( L_WBUFFER, NUMBER_OF_BUFFER_LEVELS,
249 & nSx, nSy )
250 _R8 eastRecvBuf_R8( L_EBUFFER, NUMBER_OF_BUFFER_LEVELS,
251 & nSx, nSy )
252 _R8 southRecvBuf_R8( L_SBUFFER, NUMBER_OF_BUFFER_LEVELS,
253 & nSx, nSy )
254 _R8 northRecvBuf_R8( L_NBUFFER, NUMBER_OF_BUFFER_LEVELS,
255 & nSx, nSy )
256 _R4 westSendBuf_R4( L_WBUFFER, NUMBER_OF_BUFFER_LEVELS,
257 & nSx, nSy )
258 _R4 eastSendBuf_R4( L_EBUFFER, NUMBER_OF_BUFFER_LEVELS,
259 & nSx, nSy )
260 _R4 southSendBuf_R4( L_SBUFFER, NUMBER_OF_BUFFER_LEVELS,
261 & nSx, nSy )
262 _R4 northSendBuf_R4( L_NBUFFER, NUMBER_OF_BUFFER_LEVELS,
263 & nSx, nSy )
264 _R4 westRecvBuf_R4( L_WBUFFER, NUMBER_OF_BUFFER_LEVELS,
265 & nSx, nSy )
266 _R4 eastRecvBuf_R4( L_EBUFFER, NUMBER_OF_BUFFER_LEVELS,
267 & nSx, nSy )
268 _R4 southRecvBuf_R4( L_SBUFFER, NUMBER_OF_BUFFER_LEVELS,
269 & nSx, nSy )
270 _R4 northRecvBuf_R4( L_NBUFFER, NUMBER_OF_BUFFER_LEVELS,
271 & nSx, nSy )
272
273 C-- COMMON / EXCH_I / INTEGER common arrays for exchanges
274 C xxxxSendAck - Flag indicating ready to send data.
275 C xxxxRecvAck - Falg indicating receive data is ready.
276 C exchBufferLevel - Current cyclic buffer level.
277 C exchNReqsX, exchNReqsY - Pending message counts
278 C exchReqIdX, exchReqIdY -Pending message identifiers
279 C *Spin* - Exchange statistics holder
280 C Count - No. spins for each thread
281 C Max - Maximum spins for an exchange
282 C Min - Minimum spins for an exchange
283 COMMON / EXCH_I /
284 & westSendAck, eastSendAck, southSendAck, northSendAck,
285 & westRecvAck, eastRecvAck, southRecvAck, northRecvAck,
286 & exchangeBufLevel,
287 & exchNReqsX, exchNReqsY, exchReqIdX, exchReqIdY,
288 & exchRecvXSpinCount, exchRecvXSpinMax, exchRecvXSpinMin,
289 & exchRecvXExchCount,
290 & exchRecvYSpinCount, exchRecvYSpinMax, exchRecvYSpinMin,
291 & exchRecvYExchCount
292 INTEGER westSendAck( NUMBER_OF_BUFFER_LEVELS,
293 & nSx, nSy )
294 INTEGER eastSendAck( NUMBER_OF_BUFFER_LEVELS,
295 & nSx, nSy )
296 INTEGER southSendAck( NUMBER_OF_BUFFER_LEVELS,
297 & nSx, nSy )
298 INTEGER northSendAck( NUMBER_OF_BUFFER_LEVELS,
299 & nSx, nSy )
300 INTEGER westRecvAck( NUMBER_OF_BUFFER_LEVELS,
301 & nSx, nSy )
302 INTEGER eastRecvAck( NUMBER_OF_BUFFER_LEVELS,
303 & nSx, nSy )
304 INTEGER southRecvAck( NUMBER_OF_BUFFER_LEVELS,
305 & nSx, nSy )
306 INTEGER northRecvAck( NUMBER_OF_BUFFER_LEVELS,
307 & nSx, nSy )
308 INTEGER exchangeBufLevel( cacheLineSize/4, nSx, nSy )
309 INTEGER exchNReqsX(cacheLineSize/4,nSx,nSy)
310 INTEGER exchNReqsY(cacheLineSize/4,nSx,nSy)
311 INTEGER exchReqIdX(2*nSx+2*nSy,cacheLineSize/4,nSx,nSy)
312 INTEGER exchReqIdY(2*nSx+2*nSy,cacheLineSize/4,nSx,nSy)
313 INTEGER exchRecvXSpinCount(cacheLineSize/4, nSx, nSy)
314 INTEGER exchRecvXExchCount(cacheLineSize/4, nSx, nSy)
315 INTEGER exchRecvXSpinMax (cacheLineSize/4, nSx, nSy)
316 INTEGER exchRecvXSpinMin (cacheLineSize/4, nSx, nSy)
317 INTEGER exchRecvYSpinCount(cacheLineSize/4, nSx, nSy)
318 INTEGER exchRecvYExchCount(cacheLineSize/4, nSx, nSy)
319 INTEGER exchRecvYSpinMax (cacheLineSize/4, nSx, nSy)
320 INTEGER exchRecvYSpinMin (cacheLineSize/4, nSx, nSy)
321

  ViewVC Help
Powered by ViewVC 1.1.22