/[MITgcm]/MITgcm/pkg/exch2/exch2_rx1_cube_ad.template
ViewVC logotype

Diff of /MITgcm/pkg/exch2/exch2_rx1_cube_ad.template

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

revision 1.5 by jmc, Sat May 30 21:26:31 2009 UTC revision 1.6 by jmc, Sun Jun 28 01:00:23 2009 UTC
# Line 108  C  AD: = fill buffer from my-tile-edge o Line 108  C  AD: = fill buffer from my-tile-edge o
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(
# Line 132  C       o e2_msgHandle entry to read is Line 132  C       o e2_msgHandle entry to read is
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
# Line 156  C     Wait until all threads finish fill Line 156  C     Wait until all threads finish fill
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
# Line 176  C-    Skip the call if this is an intern Line 176  C-    Skip the call if this is an intern
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(
# Line 197  C       Receive from neighbour N to fill Line 197  C       Receive from neighbour N to fill
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
# Line 207  C       Receive from neighbour N to fill Line 207  C       Receive from neighbour N to fill
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
# Line 217  C           shared address space/or dire Line 217  C           shared address space/or dire
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
# Line 239  C- AD: = get exch-data from buffer (leve Line 239  C- AD: = get exch-data from buffer (leve
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)
# Line 262  C     in its copy of "array". Line 262  C     in its copy of "array".
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

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

  ViewVC Help
Powered by ViewVC 1.1.22