108 |
C AD: on local (to this Proc) or remote Proc tile destination |
C AD: on local (to this Proc) or remote Proc tile destination |
109 |
DO bj=myByLo(myThid), myByHi(myThid) |
DO bj=myByLo(myThid), myByHi(myThid) |
110 |
DO bi=myBxLo(myThid), myBxHi(myThid) |
DO bi=myBxLo(myThid), myBxHi(myThid) |
111 |
thisTile=W2_myTileList(bi) |
thisTile=W2_myTileList(bi,bj) |
112 |
nN=exch2_nNeighbours(thisTile) |
nN=exch2_nNeighbours(thisTile) |
113 |
DO N=1,nN |
DO N=1,nN |
114 |
CALL EXCH2_GET_SCAL_BOUNDS( |
CALL EXCH2_GET_SCAL_BOUNDS( |
132 |
I tKlo, tKhi, tkStride, |
I tKlo, tKhi, tkStride, |
133 |
I thisTile, N, bi, bj, |
I thisTile, N, bi, bj, |
134 |
I e2BufrRecSize, W2_maxNeighbours, nSx, nSy, |
I e2BufrRecSize, W2_maxNeighbours, nSx, nSy, |
135 |
O iBuf1Filled(N,bi), |
O iBuf1Filled(N,bi,bj), |
136 |
O e2Bufr1_RX, |
O e2Bufr1_RX, |
137 |
U array(1-myOLw,1-myOLs,1,bi,bj), |
U array(1-myOLw,1-myOLs,1,bi,bj), |
138 |
I i1Lo, i1Hi, j1Lo, j1Hi, k1Lo, k1Hi, |
I i1Lo, i1Hi, j1Lo, j1Hi, k1Lo, k1Hi, |
139 |
U e2_msgHandles, |
U e2_msgHandles, |
140 |
I W2_myCommFlag(N,bi), myThid ) |
I W2_myCommFlag(N,bi,bj), myThid ) |
141 |
ENDDO |
ENDDO |
142 |
ENDDO |
ENDDO |
143 |
ENDDO |
ENDDO |
156 |
C-- Send my data (in buffer, level 2) to target Process |
C-- Send my data (in buffer, level 2) to target Process |
157 |
DO bj=1,nSy |
DO bj=1,nSy |
158 |
DO bi=1,nSx |
DO bi=1,nSx |
159 |
thisTile=W2_myTileList(bi) |
thisTile=W2_myTileList(bi,bj) |
160 |
nN=exch2_nNeighbours(thisTile) |
nN=exch2_nNeighbours(thisTile) |
161 |
DO N=1,nN |
DO N=1,nN |
162 |
C- Skip the call if this is an internal exchange |
C- Skip the call if this is an internal exchange |
163 |
IF ( W2_myCommFlag(N,bi) .EQ. 'M' ) THEN |
IF ( W2_myCommFlag(N,bi,bj) .EQ. 'M' ) THEN |
164 |
CALL EXCH2_SEND_RX1( |
CALL EXCH2_SEND_RX1( |
165 |
I thisTile, N, |
I thisTile, N, |
166 |
I e2BufrRecSize, |
I e2BufrRecSize, |
167 |
I iBuf1Filled(N,bi), |
I iBuf1Filled(N,bi,bj), |
168 |
I e2Bufr1_RX(1,N,bi,2), |
I e2Bufr1_RX(1,N,bi,bj,2), |
169 |
O e2_msgHandles(1,N,bi,bj), |
O e2_msgHandles(1,N,bi,bj), |
170 |
I W2_myCommFlag(N,bi), myThid ) |
I W2_myCommFlag(N,bi,bj), myThid ) |
171 |
ENDIF |
ENDIF |
172 |
ENDDO |
ENDDO |
173 |
ENDDO |
ENDDO |
176 |
C-- Receive data (in buffer, level 1) from source Process |
C-- Receive data (in buffer, level 1) from source Process |
177 |
DO bj=1,nSy |
DO bj=1,nSy |
178 |
DO bi=1,nSx |
DO bi=1,nSx |
179 |
thisTile=W2_myTileList(bi) |
thisTile=W2_myTileList(bi,bj) |
180 |
nN=exch2_nNeighbours(thisTile) |
nN=exch2_nNeighbours(thisTile) |
181 |
DO N=1,nN |
DO N=1,nN |
182 |
C- Skip the call if this is an internal exchange |
C- Skip the call if this is an internal exchange |
183 |
IF ( W2_myCommFlag(N,bi) .EQ. 'M' ) THEN |
IF ( W2_myCommFlag(N,bi,bj) .EQ. 'M' ) THEN |
184 |
farTile=exch2_neighbourId(N,thisTile) |
farTile=exch2_neighbourId(N,thisTile) |
185 |
oN = exch2_opposingSend(N,thisTile) |
oN = exch2_opposingSend(N,thisTile) |
186 |
CALL EXCH2_GET_SCAL_BOUNDS( |
CALL EXCH2_GET_SCAL_BOUNDS( |
197 |
I thisTile, N, |
I thisTile, N, |
198 |
I e2BufrRecSize, |
I e2BufrRecSize, |
199 |
I iBufr, |
I iBufr, |
200 |
O e2Bufr1_RX(1,N,bi,1), |
O e2Bufr1_RX(1,N,bi,bj,1), |
201 |
I W2_myCommFlag(N,bi), myThid ) |
I W2_myCommFlag(N,bi,bj), myThid ) |
202 |
ENDIF |
ENDIF |
203 |
ENDDO |
ENDDO |
204 |
ENDDO |
ENDDO |
207 |
C-- Clear message handles/locks |
C-- Clear message handles/locks |
208 |
DO bj=1,nSy |
DO bj=1,nSy |
209 |
DO bi=1,nSx |
DO bi=1,nSx |
210 |
thisTile=W2_myTileList(bi) |
thisTile=W2_myTileList(bi,bj) |
211 |
nN=exch2_nNeighbours(thisTile) |
nN=exch2_nNeighbours(thisTile) |
212 |
DO N=1,nN |
DO N=1,nN |
213 |
C Note: In a between process tile-tile data transport using |
C Note: In a between process tile-tile data transport using |
217 |
C addressable memory blocks the receiver needs to assert |
C addressable memory blocks the receiver needs to assert |
218 |
C that he has consumed the buffer the sender filled here. |
C that he has consumed the buffer the sender filled here. |
219 |
c farTile=exch2_neighbourId(N,thisTile) |
c farTile=exch2_neighbourId(N,thisTile) |
220 |
IF ( W2_myCommFlag(N,bi) .EQ. 'M' ) THEN |
IF ( W2_myCommFlag(N,bi,bj) .EQ. 'M' ) THEN |
221 |
wHandle = e2_msgHandles(1,N,bi,bj) |
wHandle = e2_msgHandles(1,N,bi,bj) |
222 |
CALL MPI_Wait( wHandle, mpiStatus, mpiRc ) |
CALL MPI_Wait( wHandle, mpiStatus, mpiRc ) |
223 |
ELSEIF ( W2_myCommFlag(N,bi) .EQ. 'P' ) THEN |
ELSEIF ( W2_myCommFlag(N,bi,bj) .EQ. 'P' ) THEN |
224 |
ELSE |
ELSE |
225 |
ENDIF |
ENDIF |
226 |
ENDDO |
ENDDO |
239 |
C AD: overlap region, and add to my tile near-Edge interior |
C AD: overlap region, and add to my tile near-Edge interior |
240 |
DO bj=myByLo(myThid), myByHi(myThid) |
DO bj=myByLo(myThid), myByHi(myThid) |
241 |
DO bi=myBxLo(myThid), myBxHi(myThid) |
DO bi=myBxLo(myThid), myBxHi(myThid) |
242 |
thisTile=W2_myTileList(bi) |
thisTile=W2_myTileList(bi,bj) |
243 |
nN=exch2_nNeighbours(thisTile) |
nN=exch2_nNeighbours(thisTile) |
244 |
DO N=1,nN |
DO N=1,nN |
245 |
farTile=exch2_neighbourId(N,thisTile) |
farTile=exch2_neighbourId(N,thisTile) |
262 |
I tKlo, tKhi, tkStride, |
I tKlo, tKhi, tkStride, |
263 |
I thisTile, N, |
I thisTile, N, |
264 |
I e2BufrRecSize, |
I e2BufrRecSize, |
265 |
I e2Bufr1_RX(1,N,bi,1), |
I e2Bufr1_RX(1,N,bi,bj,1), |
266 |
U array(1-myOLw,1-myOLs,1,bi,bj), |
U array(1-myOLw,1-myOLs,1,bi,bj), |
267 |
I i1Lo, i1Hi, j1Lo, j1Hi, k1Lo, k1Hi, |
I i1Lo, i1Hi, j1Lo, j1Hi, k1Lo, k1Hi, |
268 |
O e2_msgHandles(1,N,bi,bj), |
O e2_msgHandles(1,N,bi,bj), |
269 |
I W2_myCommFlag(N,bi), myThid ) |
I W2_myCommFlag(N,bi,bj), myThid ) |
270 |
ENDDO |
ENDDO |
271 |
ENDDO |
ENDDO |
272 |
ENDDO |
ENDDO |