117 |
C AD: on local (to this Proc) or remote Proc tile destination |
C AD: on local (to this Proc) or remote Proc tile destination |
118 |
DO bj=myByLo(myThid), myByHi(myThid) |
DO bj=myByLo(myThid), myByHi(myThid) |
119 |
DO bi=myBxLo(myThid), myBxHi(myThid) |
DO bi=myBxLo(myThid), myBxHi(myThid) |
120 |
thisTile=W2_myTileList(bi) |
thisTile=W2_myTileList(bi,bj) |
121 |
nN=exch2_nNeighbours(thisTile) |
nN=exch2_nNeighbours(thisTile) |
122 |
DO N=1,nN |
DO N=1,nN |
123 |
CALL EXCH2_GET_UV_BOUNDS( |
CALL EXCH2_GET_UV_BOUNDS( |
143 |
I tKlo, tKhi, tkStride, |
I tKlo, tKhi, tkStride, |
144 |
I thisTile, N, bi, bj, |
I thisTile, N, bi, bj, |
145 |
I e2BufrRecSize, W2_maxNeighbours, nSx, nSy, |
I e2BufrRecSize, W2_maxNeighbours, nSx, nSy, |
146 |
O iBuf1Filled(N,bi), iBuf2Filled(N,bi), |
O iBuf1Filled(N,bi,bj), iBuf2Filled(N,bi,bj), |
147 |
O e2Bufr1_RX, e2Bufr2_RX, |
O e2Bufr1_RX, e2Bufr2_RX, |
148 |
U array1(1-myOLw,1-myOLs,1,bi,bj), |
U array1(1-myOLw,1-myOLs,1,bi,bj), |
149 |
U array2(1-myOLw,1-myOLs,1,bi,bj), |
U array2(1-myOLw,1-myOLs,1,bi,bj), |
150 |
I i1Lo, i1Hi, j1Lo, j1Hi, k1Lo, k1Hi, |
I i1Lo, i1Hi, j1Lo, j1Hi, k1Lo, k1Hi, |
151 |
I i2Lo, i2Hi, j2Lo, j2Hi, k2Lo, k2Hi, |
I i2Lo, i2Hi, j2Lo, j2Hi, k2Lo, k2Hi, |
152 |
U e2_msgHandles, |
U e2_msgHandles, |
153 |
I W2_myCommFlag(N,bi), myThid ) |
I W2_myCommFlag(N,bi,bj), myThid ) |
154 |
ENDDO |
ENDDO |
155 |
ENDDO |
ENDDO |
156 |
ENDDO |
ENDDO |
169 |
C-- Send my data (in buffer, level 1) to target Process |
C-- Send my data (in buffer, level 1) to target Process |
170 |
DO bj=1,nSy |
DO bj=1,nSy |
171 |
DO bi=1,nSx |
DO bi=1,nSx |
172 |
thisTile=W2_myTileList(bi) |
thisTile=W2_myTileList(bi,bj) |
173 |
nN=exch2_nNeighbours(thisTile) |
nN=exch2_nNeighbours(thisTile) |
174 |
DO N=1,nN |
DO N=1,nN |
175 |
C- Skip the call if this is an internal exchange |
C- Skip the call if this is an internal exchange |
176 |
IF ( W2_myCommFlag(N,bi) .EQ. 'M' ) THEN |
IF ( W2_myCommFlag(N,bi,bj) .EQ. 'M' ) THEN |
177 |
CALL EXCH2_SEND_RX2( |
CALL EXCH2_SEND_RX2( |
178 |
I thisTile, N, |
I thisTile, N, |
179 |
I e2BufrRecSize, |
I e2BufrRecSize, |
180 |
I iBuf1Filled(N,bi), iBuf2Filled(N,bi), |
I iBuf1Filled(N,bi,bj), iBuf2Filled(N,bi,bj), |
181 |
I e2Bufr1_RX(1,N,bi,2), e2Bufr2_RX(1,N,bi,2), |
I e2Bufr1_RX(1,N,bi,bj,2), e2Bufr2_RX(1,N,bi,bj,2), |
182 |
O e2_msgHandles(1,N,bi,bj), |
O e2_msgHandles(1,N,bi,bj), |
183 |
I W2_myCommFlag(N,bi), myThid ) |
I W2_myCommFlag(N,bi,bj), myThid ) |
184 |
ENDIF |
ENDIF |
185 |
ENDDO |
ENDDO |
186 |
ENDDO |
ENDDO |
189 |
C-- Receive data (in buffer, level 1) from source Process |
C-- Receive data (in buffer, level 1) from source Process |
190 |
DO bj=1,nSy |
DO bj=1,nSy |
191 |
DO bi=1,nSx |
DO bi=1,nSx |
192 |
thisTile=W2_myTileList(bi) |
thisTile=W2_myTileList(bi,bj) |
193 |
nN=exch2_nNeighbours(thisTile) |
nN=exch2_nNeighbours(thisTile) |
194 |
DO N=1,nN |
DO N=1,nN |
195 |
C- Skip the call if this is an internal exchange |
C- Skip the call if this is an internal exchange |
196 |
IF ( W2_myCommFlag(N,bi) .EQ. 'M' ) THEN |
IF ( W2_myCommFlag(N,bi,bj) .EQ. 'M' ) THEN |
197 |
farTile=exch2_neighbourId(N,thisTile) |
farTile=exch2_neighbourId(N,thisTile) |
198 |
oN = exch2_opposingSend(N,thisTile) |
oN = exch2_opposingSend(N,thisTile) |
199 |
CALL EXCH2_GET_UV_BOUNDS( |
CALL EXCH2_GET_UV_BOUNDS( |
215 |
I thisTile, N, |
I thisTile, N, |
216 |
I e2BufrRecSize, |
I e2BufrRecSize, |
217 |
I iBufr1, iBufr2, |
I iBufr1, iBufr2, |
218 |
I e2Bufr1_RX(1,N,bi,1), e2Bufr2_RX(1,N,bi,1), |
I e2Bufr1_RX(1,N,bi,bj,1), e2Bufr2_RX(1,N,bi,bj,1), |
219 |
I W2_myCommFlag(N,bi), myThid ) |
I W2_myCommFlag(N,bi,bj), myThid ) |
220 |
ENDIF |
ENDIF |
221 |
ENDDO |
ENDDO |
222 |
ENDDO |
ENDDO |
225 |
C-- Clear message handles/locks |
C-- Clear message handles/locks |
226 |
DO bj=1,nSy |
DO bj=1,nSy |
227 |
DO bi=1,nSx |
DO bi=1,nSx |
228 |
thisTile=W2_myTileList(bi) |
thisTile=W2_myTileList(bi,bj) |
229 |
nN=exch2_nNeighbours(thisTile) |
nN=exch2_nNeighbours(thisTile) |
230 |
DO N=1,nN |
DO N=1,nN |
231 |
C Note: In a between process tile-tile data transport using |
C Note: In a between process tile-tile data transport using |
235 |
C addressable memory blocks the receiver needs to assert |
C addressable memory blocks the receiver needs to assert |
236 |
C that he has consumed the buffer the sender filled here. |
C that he has consumed the buffer the sender filled here. |
237 |
farTile=exch2_neighbourId(N,thisTile) |
farTile=exch2_neighbourId(N,thisTile) |
238 |
IF ( W2_myCommFlag(N,bi) .EQ. 'M' ) THEN |
IF ( W2_myCommFlag(N,bi,bj) .EQ. 'M' ) THEN |
239 |
wHandle = e2_msgHandles(1,N,bi,bj) |
wHandle = e2_msgHandles(1,N,bi,bj) |
240 |
CALL MPI_Wait( wHandle, mpiStatus, mpiRc ) |
CALL MPI_Wait( wHandle, mpiStatus, mpiRc ) |
241 |
wHandle = e2_msgHandles(2,N,bi,bj) |
wHandle = e2_msgHandles(2,N,bi,bj) |
242 |
CALL MPI_Wait( wHandle, mpiStatus, mpiRc ) |
CALL MPI_Wait( wHandle, mpiStatus, mpiRc ) |
243 |
ELSEIF ( W2_myCommFlag(N,bi) .EQ. 'P' ) THEN |
ELSEIF ( W2_myCommFlag(N,bi,bj) .EQ. 'P' ) THEN |
244 |
ELSE |
ELSE |
245 |
ENDIF |
ENDIF |
246 |
ENDDO |
ENDDO |
257 |
C-- Post sends into buffer (buffer level 1): |
C-- Post sends into buffer (buffer level 1): |
258 |
DO bj=myByLo(myThid), myByHi(myThid) |
DO bj=myByLo(myThid), myByHi(myThid) |
259 |
DO bi=myBxLo(myThid), myBxHi(myThid) |
DO bi=myBxLo(myThid), myBxHi(myThid) |
260 |
thisTile=W2_myTileList(bi) |
thisTile=W2_myTileList(bi,bj) |
261 |
nN=exch2_nNeighbours(thisTile) |
nN=exch2_nNeighbours(thisTile) |
262 |
DO N=1,nN |
DO N=1,nN |
263 |
farTile=exch2_neighbourId(N,thisTile) |
farTile=exch2_neighbourId(N,thisTile) |
283 |
I oIs1, oJs1, oIs2, oJs2, |
I oIs1, oJs1, oIs2, oJs2, |
284 |
I thisTile, N, |
I thisTile, N, |
285 |
I e2BufrRecSize, |
I e2BufrRecSize, |
286 |
O e2Bufr1_RX(1,N,bi,1), e2Bufr2_RX(1,N,bi,1), |
O e2Bufr1_RX(1,N,bi,bj,1), e2Bufr2_RX(1,N,bi,bj,1), |
287 |
I array1(1-myOLw,1-myOLs,1,bi,bj), |
I array1(1-myOLw,1-myOLs,1,bi,bj), |
288 |
I array2(1-myOLw,1-myOLs,1,bi,bj), |
I array2(1-myOLw,1-myOLs,1,bi,bj), |
289 |
I i1Lo, i1Hi, j1Lo, j1Hi, k1Lo, k1Hi, |
I i1Lo, i1Hi, j1Lo, j1Hi, k1Lo, k1Hi, |
290 |
I i2Lo, i2Hi, j2Lo, j2Hi, k2Lo, k2Hi, |
I i2Lo, i2Hi, j2Lo, j2Hi, k2Lo, k2Hi, |
291 |
O e2_msgHandles(1,N,bi,bj), |
O e2_msgHandles(1,N,bi,bj), |
292 |
I W2_myCommFlag(N,bi), signOption, myThid ) |
I W2_myCommFlag(N,bi,bj), signOption, myThid ) |
293 |
ENDDO |
ENDDO |
294 |
ENDDO |
ENDDO |
295 |
ENDDO |
ENDDO |