3 |
C |
C |
4 |
CBOP |
CBOP |
5 |
C !ROUTINE: EXCH.h |
C !ROUTINE: EXCH.h |
6 |
C !INTERFACE: |
C !INTERFACE: |
7 |
C include "EXCH.h" |
C include "EXCH.h" |
8 |
C |
C |
9 |
C !DESCRIPTION: |
C !DESCRIPTION: |
10 |
C *==========================================================* |
C *==========================================================* |
11 |
C | EXCH.h |
C | EXCH.h |
12 |
C *==========================================================* |
C *==========================================================* |
13 |
C | Support data structures for the MITgcm UV "exchange |
C | Support data structures for |
14 |
C | routines" code. This data should be private to the |
C | the MITgcm-UV "exchange routines" code. This data should |
15 |
C | execution environment routines. |
C | be private to the execution environment routines. |
16 |
C *==========================================================* |
C *==========================================================* |
17 |
CEOP |
CEOP |
18 |
|
|
153 |
PARAMETER ( EXCH_SPIN_LIMIT = 100000000 ) |
PARAMETER ( EXCH_SPIN_LIMIT = 100000000 ) |
154 |
|
|
155 |
C |
C |
156 |
C L_BUFFER[XY] - Maximum size for exchange buffer in |
C L_BUFFER[XY] - Maximum size for exchange buffer in |
157 |
C L_WBUFFER west, |
C L_WBUFFER west, |
158 |
C L_EBUFFER east, |
C L_EBUFFER east, |
159 |
C L_SBUFFER south, |
C L_SBUFFER south, |
160 |
C L_NBUFFER north. |
C L_NBUFFER north. |
161 |
INTEGER L_BUFFERX |
INTEGER L_BUFFERX |
162 |
PARAMETER ( L_BUFFERX = |
PARAMETER ( L_BUFFERX = |
163 |
& (sNy+2*MAX_OLY_EXCH)*MAX_OLX_EXCH*MAX_NR_EXCH ) |
& (sNy+2*MAX_OLY_EXCH)*MAX_OLX_EXCH*MAX_NR_EXCH ) |
164 |
INTEGER L_BUFFERY |
INTEGER L_BUFFERY |
165 |
PARAMETER ( L_BUFFERY = |
PARAMETER ( L_BUFFERY = |
166 |
& (sNx+2*MAX_OLX_EXCH)*MAX_OLY_EXCH*MAX_NR_EXCH ) |
& (sNx+2*MAX_OLX_EXCH)*MAX_OLY_EXCH*MAX_NR_EXCH ) |
167 |
INTEGER L_WBUFFER |
INTEGER L_WBUFFER |
168 |
INTEGER L_EBUFFER |
INTEGER L_EBUFFER |
177 |
C exchNeedsMemSync - TRUE if memory sync. required to ensure |
C exchNeedsMemSync - TRUE if memory sync. required to ensure |
178 |
C memory consistency during exchange |
C memory consistency during exchange |
179 |
C exchUsesBarrier - TRUE if we use a call to BAR to do sync. |
C exchUsesBarrier - TRUE if we use a call to BAR to do sync. |
180 |
C between processes. On some machines we wont |
C between processes. On some machines we wont |
181 |
C spin on the Ack setting ( the T90 ), |
C spin on the Ack setting ( the T90 ), |
182 |
C instead we will use s system barrier. |
C instead we will use s system barrier. |
183 |
C On the T90 the system barrier is very fast and |
C On the T90 the system barrier is very fast and |
184 |
C switches out the thread while it waits. On most |
C switches out the thread while it waits. On most |
185 |
C machines the system barrier is much too slow and if |
C machines the system barrier is much too slow and if |
186 |
C we own the machine and have one thread per process |
C we own the machine and have one thread per process |
187 |
C preemption is not a problem. |
C preemption is not a problem. |
188 |
C exchCollectStatistics - Turns exchange statistics collecting on and off. |
C exchCollectStatistics - Turns exchange statistics collecting on and off. |
189 |
|
|
197 |
C xxxxSendBuf - Buffer used for sending data to another tile. |
C xxxxSendBuf - Buffer used for sending data to another tile. |
198 |
C xxxxRecvBuf - Buffer used for receiving data from another tile. |
C xxxxRecvBuf - Buffer used for receiving data from another tile. |
199 |
COMMON / EXCH_R / |
COMMON / EXCH_R / |
200 |
& westSendBuf_RL, eastSendBuf_RL, |
& westSendBuf_RL, eastSendBuf_RL, |
201 |
& southSendBuf_RL, northSendBuf_RL, |
& southSendBuf_RL, northSendBuf_RL, |
202 |
& westRecvBuf_RL, eastRecvBuf_RL, |
& westRecvBuf_RL, eastRecvBuf_RL, |
203 |
& southRecvBuf_RL, northRecvBuf_RL, |
& southRecvBuf_RL, northRecvBuf_RL, |
204 |
& westSendBuf_RS, eastSendBuf_RS, |
& westSendBuf_RS, eastSendBuf_RS, |
205 |
& southSendBuf_RS, northSendBuf_RS, |
& southSendBuf_RS, northSendBuf_RS, |
206 |
& westRecvBuf_RS, eastRecvBuf_RS, |
& westRecvBuf_RS, eastRecvBuf_RS, |
207 |
& southRecvBuf_RS, northRecvBuf_RS, |
& southRecvBuf_RS, northRecvBuf_RS, |
208 |
& westSendBuf_R8, eastSendBuf_R8, |
& westSendBuf_R8, eastSendBuf_R8, |
209 |
& southSendBuf_R8, northSendBuf_R8, |
& southSendBuf_R8, northSendBuf_R8, |
210 |
& westRecvBuf_R8, eastRecvBuf_R8, |
& westRecvBuf_R8, eastRecvBuf_R8, |
211 |
& southRecvBuf_R8, northRecvBuf_R8, |
& southRecvBuf_R8, northRecvBuf_R8, |
212 |
& westSendBuf_R4, eastSendBuf_R4, |
& westSendBuf_R4, eastSendBuf_R4, |
213 |
& southSendBuf_R4, northSendBuf_R4, |
& southSendBuf_R4, northSendBuf_R4, |
214 |
& westRecvBuf_R4, eastRecvBuf_R4, |
& westRecvBuf_R4, eastRecvBuf_R4, |
215 |
& southRecvBuf_R4, northRecvBuf_R4 |
& southRecvBuf_R4, northRecvBuf_R4 |
216 |
_RL westSendBuf_RL( L_WBUFFER, NUMBER_OF_BUFFER_LEVELS, |
_RL westSendBuf_RL( L_WBUFFER, NUMBER_OF_BUFFER_LEVELS, |
217 |
& nSx, nSy ) |
& nSx, nSy ) |
218 |
_RL eastSendBuf_RL( L_EBUFFER, NUMBER_OF_BUFFER_LEVELS, |
_RL eastSendBuf_RL( L_EBUFFER, NUMBER_OF_BUFFER_LEVELS, |
219 |
& nSx, nSy ) |
& nSx, nSy ) |
220 |
_RL southSendBuf_RL( L_SBUFFER, NUMBER_OF_BUFFER_LEVELS, |
_RL southSendBuf_RL( L_SBUFFER, NUMBER_OF_BUFFER_LEVELS, |
221 |
& nSx, nSy ) |
& nSx, nSy ) |
222 |
_RL northSendBuf_RL( L_NBUFFER, NUMBER_OF_BUFFER_LEVELS, |
_RL northSendBuf_RL( L_NBUFFER, NUMBER_OF_BUFFER_LEVELS, |
223 |
& nSx, nSy ) |
& nSx, nSy ) |
224 |
_RL westRecvBuf_RL( L_WBUFFER, NUMBER_OF_BUFFER_LEVELS, |
_RL westRecvBuf_RL( L_WBUFFER, NUMBER_OF_BUFFER_LEVELS, |
225 |
& nSx, nSy ) |
& nSx, nSy ) |
226 |
_RL eastRecvBuf_RL( L_EBUFFER, NUMBER_OF_BUFFER_LEVELS, |
_RL eastRecvBuf_RL( L_EBUFFER, NUMBER_OF_BUFFER_LEVELS, |
227 |
& nSx, nSy ) |
& nSx, nSy ) |
228 |
_RL southRecvBuf_RL( L_SBUFFER, NUMBER_OF_BUFFER_LEVELS, |
_RL southRecvBuf_RL( L_SBUFFER, NUMBER_OF_BUFFER_LEVELS, |
229 |
& nSx, nSy ) |
& nSx, nSy ) |
230 |
_RL northRecvBuf_RL( L_NBUFFER, NUMBER_OF_BUFFER_LEVELS, |
_RL northRecvBuf_RL( L_NBUFFER, NUMBER_OF_BUFFER_LEVELS, |
231 |
& nSx, nSy ) |
& nSx, nSy ) |
232 |
_RS westSendBuf_RS( L_WBUFFER, NUMBER_OF_BUFFER_LEVELS, |
_RS westSendBuf_RS( L_WBUFFER, NUMBER_OF_BUFFER_LEVELS, |
233 |
& nSx, nSy ) |
& nSx, nSy ) |
234 |
_RS eastSendBuf_RS( L_EBUFFER, NUMBER_OF_BUFFER_LEVELS, |
_RS eastSendBuf_RS( L_EBUFFER, NUMBER_OF_BUFFER_LEVELS, |
235 |
& nSx, nSy ) |
& nSx, nSy ) |
236 |
_RS southSendBuf_RS( L_SBUFFER, NUMBER_OF_BUFFER_LEVELS, |
_RS southSendBuf_RS( L_SBUFFER, NUMBER_OF_BUFFER_LEVELS, |
237 |
& nSx, nSy ) |
& nSx, nSy ) |
238 |
_RS northSendBuf_RS( L_NBUFFER, NUMBER_OF_BUFFER_LEVELS, |
_RS northSendBuf_RS( L_NBUFFER, NUMBER_OF_BUFFER_LEVELS, |
239 |
& nSx, nSy ) |
& nSx, nSy ) |
240 |
_RS westRecvBuf_RS( L_WBUFFER, NUMBER_OF_BUFFER_LEVELS, |
_RS westRecvBuf_RS( L_WBUFFER, NUMBER_OF_BUFFER_LEVELS, |
241 |
& nSx, nSy ) |
& nSx, nSy ) |
242 |
_RS eastRecvBuf_RS( L_EBUFFER, NUMBER_OF_BUFFER_LEVELS, |
_RS eastRecvBuf_RS( L_EBUFFER, NUMBER_OF_BUFFER_LEVELS, |
243 |
& nSx, nSy ) |
& nSx, nSy ) |
244 |
_RS southRecvBuf_RS( L_SBUFFER, NUMBER_OF_BUFFER_LEVELS, |
_RS southRecvBuf_RS( L_SBUFFER, NUMBER_OF_BUFFER_LEVELS, |
245 |
& nSx, nSy ) |
& nSx, nSy ) |
246 |
_RS northRecvBuf_RS( L_NBUFFER, NUMBER_OF_BUFFER_LEVELS, |
_RS northRecvBuf_RS( L_NBUFFER, NUMBER_OF_BUFFER_LEVELS, |
247 |
& nSx, nSy ) |
& nSx, nSy ) |
248 |
_R8 westSendBuf_R8( L_WBUFFER, NUMBER_OF_BUFFER_LEVELS, |
_R8 westSendBuf_R8( L_WBUFFER, NUMBER_OF_BUFFER_LEVELS, |
249 |
& nSx, nSy ) |
& nSx, nSy ) |
250 |
_R8 eastSendBuf_R8( L_EBUFFER, NUMBER_OF_BUFFER_LEVELS, |
_R8 eastSendBuf_R8( L_EBUFFER, NUMBER_OF_BUFFER_LEVELS, |
251 |
& nSx, nSy ) |
& nSx, nSy ) |
252 |
_R8 southSendBuf_R8( L_SBUFFER, NUMBER_OF_BUFFER_LEVELS, |
_R8 southSendBuf_R8( L_SBUFFER, NUMBER_OF_BUFFER_LEVELS, |
253 |
& nSx, nSy ) |
& nSx, nSy ) |
254 |
_R8 northSendBuf_R8( L_NBUFFER, NUMBER_OF_BUFFER_LEVELS, |
_R8 northSendBuf_R8( L_NBUFFER, NUMBER_OF_BUFFER_LEVELS, |
255 |
& nSx, nSy ) |
& nSx, nSy ) |
256 |
_R8 westRecvBuf_R8( L_WBUFFER, NUMBER_OF_BUFFER_LEVELS, |
_R8 westRecvBuf_R8( L_WBUFFER, NUMBER_OF_BUFFER_LEVELS, |
257 |
& nSx, nSy ) |
& nSx, nSy ) |
258 |
_R8 eastRecvBuf_R8( L_EBUFFER, NUMBER_OF_BUFFER_LEVELS, |
_R8 eastRecvBuf_R8( L_EBUFFER, NUMBER_OF_BUFFER_LEVELS, |
259 |
& nSx, nSy ) |
& nSx, nSy ) |
260 |
_R8 southRecvBuf_R8( L_SBUFFER, NUMBER_OF_BUFFER_LEVELS, |
_R8 southRecvBuf_R8( L_SBUFFER, NUMBER_OF_BUFFER_LEVELS, |
261 |
& nSx, nSy ) |
& nSx, nSy ) |
262 |
_R8 northRecvBuf_R8( L_NBUFFER, NUMBER_OF_BUFFER_LEVELS, |
_R8 northRecvBuf_R8( L_NBUFFER, NUMBER_OF_BUFFER_LEVELS, |
263 |
& nSx, nSy ) |
& nSx, nSy ) |
264 |
_R4 westSendBuf_R4( L_WBUFFER, NUMBER_OF_BUFFER_LEVELS, |
_R4 westSendBuf_R4( L_WBUFFER, NUMBER_OF_BUFFER_LEVELS, |
265 |
& nSx, nSy ) |
& nSx, nSy ) |
266 |
_R4 eastSendBuf_R4( L_EBUFFER, NUMBER_OF_BUFFER_LEVELS, |
_R4 eastSendBuf_R4( L_EBUFFER, NUMBER_OF_BUFFER_LEVELS, |
267 |
& nSx, nSy ) |
& nSx, nSy ) |
268 |
_R4 southSendBuf_R4( L_SBUFFER, NUMBER_OF_BUFFER_LEVELS, |
_R4 southSendBuf_R4( L_SBUFFER, NUMBER_OF_BUFFER_LEVELS, |
269 |
& nSx, nSy ) |
& nSx, nSy ) |
270 |
_R4 northSendBuf_R4( L_NBUFFER, NUMBER_OF_BUFFER_LEVELS, |
_R4 northSendBuf_R4( L_NBUFFER, NUMBER_OF_BUFFER_LEVELS, |
271 |
& nSx, nSy ) |
& nSx, nSy ) |
272 |
_R4 westRecvBuf_R4( L_WBUFFER, NUMBER_OF_BUFFER_LEVELS, |
_R4 westRecvBuf_R4( L_WBUFFER, NUMBER_OF_BUFFER_LEVELS, |
273 |
& nSx, nSy ) |
& nSx, nSy ) |
274 |
_R4 eastRecvBuf_R4( L_EBUFFER, NUMBER_OF_BUFFER_LEVELS, |
_R4 eastRecvBuf_R4( L_EBUFFER, NUMBER_OF_BUFFER_LEVELS, |
275 |
& nSx, nSy ) |
& nSx, nSy ) |
276 |
_R4 southRecvBuf_R4( L_SBUFFER, NUMBER_OF_BUFFER_LEVELS, |
_R4 southRecvBuf_R4( L_SBUFFER, NUMBER_OF_BUFFER_LEVELS, |
277 |
& nSx, nSy ) |
& nSx, nSy ) |
278 |
_R4 northRecvBuf_R4( L_NBUFFER, NUMBER_OF_BUFFER_LEVELS, |
_R4 northRecvBuf_R4( L_NBUFFER, NUMBER_OF_BUFFER_LEVELS, |
279 |
& nSx, nSy ) |
& nSx, nSy ) |
280 |
|
|
281 |
C-- COMMON / EXCH_I / INTEGER common arrays for exchanges |
C-- COMMON / EXCH_I / INTEGER common arrays for exchanges |
297 |
& exchRecvXExchCount, |
& exchRecvXExchCount, |
298 |
& exchRecvYSpinCount, exchRecvYSpinMax, exchRecvYSpinMin, |
& exchRecvYSpinCount, exchRecvYSpinMax, exchRecvYSpinMin, |
299 |
& exchRecvYExchCount |
& exchRecvYExchCount |
300 |
INTEGER westSendAck( NUMBER_OF_BUFFER_LEVELS, |
INTEGER westSendAck( NUMBER_OF_BUFFER_LEVELS, |
301 |
& nSx, nSy ) |
& nSx, nSy ) |
302 |
INTEGER eastSendAck( NUMBER_OF_BUFFER_LEVELS, |
INTEGER eastSendAck( NUMBER_OF_BUFFER_LEVELS, |
303 |
& nSx, nSy ) |
& nSx, nSy ) |
304 |
INTEGER southSendAck( NUMBER_OF_BUFFER_LEVELS, |
INTEGER southSendAck( NUMBER_OF_BUFFER_LEVELS, |
305 |
& nSx, nSy ) |
& nSx, nSy ) |
306 |
INTEGER northSendAck( NUMBER_OF_BUFFER_LEVELS, |
INTEGER northSendAck( NUMBER_OF_BUFFER_LEVELS, |
307 |
& nSx, nSy ) |
& nSx, nSy ) |
308 |
INTEGER westRecvAck( NUMBER_OF_BUFFER_LEVELS, |
INTEGER westRecvAck( NUMBER_OF_BUFFER_LEVELS, |
309 |
& nSx, nSy ) |
& nSx, nSy ) |
310 |
INTEGER eastRecvAck( NUMBER_OF_BUFFER_LEVELS, |
INTEGER eastRecvAck( NUMBER_OF_BUFFER_LEVELS, |
311 |
& nSx, nSy ) |
& nSx, nSy ) |
312 |
INTEGER southRecvAck( NUMBER_OF_BUFFER_LEVELS, |
INTEGER southRecvAck( NUMBER_OF_BUFFER_LEVELS, |
313 |
& nSx, nSy ) |
& nSx, nSy ) |
314 |
INTEGER northRecvAck( NUMBER_OF_BUFFER_LEVELS, |
INTEGER northRecvAck( NUMBER_OF_BUFFER_LEVELS, |
315 |
& nSx, nSy ) |
& nSx, nSy ) |
316 |
INTEGER exchangeBufLevel( cacheLineSize/4, nSx, nSy ) |
INTEGER exchangeBufLevel( cacheLineSize/4, nSx, nSy ) |
317 |
INTEGER exchNReqsX(cacheLineSize/4,nSx,nSy) |
INTEGER exchNReqsX(cacheLineSize/4,nSx,nSy) |