/[MITgcm]/MITgcm/eesupp/src/exch_rx_recv_get_y.template
ViewVC logotype

Diff of /MITgcm/eesupp/src/exch_rx_recv_get_y.template

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

revision 1.9 by utke, Tue Mar 18 21:34:01 2008 UTC revision 1.13 by jmc, Fri Jan 9 22:51:12 2009 UTC
# Line 78  C     mpiStatus                  :: MPI Line 78  C     mpiStatus                  :: MPI
78        INTEGER northCommMode        INTEGER northCommMode
79        INTEGER spinCount        INTEGER spinCount
80  #ifdef ALLOW_USE_MPI  #ifdef ALLOW_USE_MPI
81        INTEGER theProc, theTag, theType, theSize        INTEGER theProc, theTag, theType, theSize, pReqI
82        INTEGER mpiStatus(MPI_STATUS_SIZE,4), mpiRc        INTEGER mpiStatus(MPI_STATUS_SIZE,4), mpiRc
83  #endif  #endif
84  CEOP  CEOP
# Line 95  CEOP Line 95  CEOP
95        IF ( usingMPI ) THEN        IF ( usingMPI ) THEN
96  #endif  #endif
97  C      Set default behavior to have MPI comms done by a single thread.  C      Set default behavior to have MPI comms done by a single thread.
98  C      Most MPI implementations don't support concurrent comms from  C      Most MPI implementations do not support concurrent comms from
99  C      several threads.  C      several threads.
100         IF ( nThreads .GT. 1 ) THEN         IF ( nThreads .GT. 1 ) THEN
101          _BARRIER          _BARRIER
# Line 157  C--   iii. Set data read flag + memory s Line 157  C--   iii. Set data read flag + memory s
157           theSize = sNx*exchWidthY*myNz           theSize = sNx*exchWidthY*myNz
158           IF ( theCornerMode .EQ. EXCH_UPDATE_CORNERS )           IF ( theCornerMode .EQ. EXCH_UPDATE_CORNERS )
159       &    theSize = (sNx+2*exchWidthX)*exchWidthY*myNz       &    theSize = (sNx+2*exchWidthX)*exchWidthY*myNz
160  # ifndef ALLOW_AUTODIFF_OPENAD  # ifndef ALLOW_AUTODIFF_OPENAD_AMPI
161           CALL MPI_Recv( southRecvBuf_RX(1,eBl,bi,bj), theSize, theType,           CALL MPI_Recv( southRecvBuf_RX(1,eBl,bi,bj), theSize, theType,
162       &                  theProc, theTag, MPI_COMM_MODEL,       &                  theProc, theTag, MPI_COMM_MODEL,
163       &                  mpiStatus, mpiRc )       &                  mpiStatus, mpiRc )
164  # else  # else
165             pReqI=exchNReqsY(1,bi,bj)+1
166           CALL ampi_recv_RX(           CALL ampi_recv_RX(
167       & southRecvBuf_RX(1,eBl,bi,bj) ,       & southRecvBuf_RX(1,eBl,bi,bj) ,
168       & theSize ,       & theSize ,
# Line 169  C--   iii. Set data read flag + memory s Line 170  C--   iii. Set data read flag + memory s
170       & theProc ,       & theProc ,
171       & theTag ,       & theTag ,
172       & MPI_COMM_MODEL ,       & MPI_COMM_MODEL ,
173         & exchReqIdY(pReqI,1,bi,bj),
174         & exchNReqsY(1,bi,bj),
175       & mpiStatus ,       & mpiStatus ,
176       & mpiRc )       & mpiRc )
177  # endif /* ALLOW_AUTODIFF_OPENAD */  # endif /* ALLOW_AUTODIFF_OPENAD_AMPI */
178  #ifndef ALWAYS_USE_MPI  #ifndef ALWAYS_USE_MPI
179          ENDIF                          ENDIF                
180  #endif  #endif
# Line 188  C--   iii. Set data read flag + memory s Line 191  C--   iii. Set data read flag + memory s
191           theSize = sNx*exchWidthY*myNz           theSize = sNx*exchWidthY*myNz
192           IF ( theCornerMode .EQ. EXCH_UPDATE_CORNERS )           IF ( theCornerMode .EQ. EXCH_UPDATE_CORNERS )
193       &    theSize = (sNx+2*exchWidthX)*exchWidthY*myNz       &    theSize = (sNx+2*exchWidthX)*exchWidthY*myNz
194  # ifndef ALLOW_AUTODIFF_OPENAD  # ifndef ALLOW_AUTODIFF_OPENAD_AMPI
195           CALL MPI_Recv( northRecvBuf_RX(1,eBl,bi,bj), theSize, theType,           CALL MPI_Recv( northRecvBuf_RX(1,eBl,bi,bj), theSize, theType,
196       &                  theProc, theTag, MPI_COMM_MODEL,       &                  theProc, theTag, MPI_COMM_MODEL,
197       &                  mpiStatus, mpiRc )       &                  mpiStatus, mpiRc )
198  # else  # else
199             pReqI=exchNReqsY(1,bi,bj)+1
200           CALL ampi_recv_RX(           CALL ampi_recv_RX(
201       & northRecvBuf_RX(1,eBl,bi,bj) ,       & northRecvBuf_RX(1,eBl,bi,bj) ,
202       & theSize ,       & theSize ,
# Line 200  C--   iii. Set data read flag + memory s Line 204  C--   iii. Set data read flag + memory s
204       & theProc ,       & theProc ,
205       & theTag ,       & theTag ,
206       & MPI_COMM_MODEL ,       & MPI_COMM_MODEL ,
207         & exchReqIdY(pReqI,1,bi,bj),
208         & exchNReqsY(1,bi,bj),
209       & mpiStatus ,       & mpiStatus ,
210       & mpiRc )       & mpiRc )
211  # endif /* ALLOW_AUTODIFF_OPENAD */  # endif /* ALLOW_AUTODIFF_OPENAD_AMPI */
212  #ifndef ALWAYS_USE_MPI  #ifndef ALWAYS_USE_MPI
213          ENDIF                          ENDIF                
214  #endif  #endif
# Line 224  C        i.e. we only lock waiting for d Line 230  C        i.e. we only lock waiting for d
230           southCommMode = _tileCommModeS(bi,bj)           southCommMode = _tileCommModeS(bi,bj)
231           northCommMode = _tileCommModeN(bi,bj)           northCommMode = _tileCommModeN(bi,bj)
232           spinCount = 0           spinCount = 0
233  # ifndef ALLOW_AUTODIFF_OPENAD  # ifndef ALLOW_AUTODIFF_OPENAD_AMPI
234     10    CONTINUE     10    CONTINUE
235            CALL FOOL_THE_COMPILER( spinCount )            CALL FOOL_THE_COMPILER( spinCount )
236            spinCount = spinCount+1            spinCount = spinCount+1
# Line 234  C         ENDIF Line 240  C         ENDIF
240            IF ( southRecvAck(eBl,bi,bj) .EQ. 0 ) GOTO 10            IF ( southRecvAck(eBl,bi,bj) .EQ. 0 ) GOTO 10
241            IF ( northRecvAck(eBl,bi,bj) .EQ. 0 ) GOTO 10            IF ( northRecvAck(eBl,bi,bj) .EQ. 0 ) GOTO 10
242  # else  # else
243           do while ((southRecvAck(eBl,bi,bj) .EQ. 0.           do while ((southRecvAck(eBl,bi,bj) .EQ. 0.
244       &             .or.       &             .or.
245       &              northRecvAck(eBl,bi,bj) .EQ. 0. ))       &              northRecvAck(eBl,bi,bj) .EQ. 0. ))
246            CALL FOOL_THE_COMPILER( spinCount )            CALL FOOL_THE_COMPILER( spinCount )
247            spinCount = spinCount+1            spinCount = spinCount+1
248           end do           end do
249  # endif /* ALLOW_AUTODIFF_OPENAD */  # endif /* ALLOW_AUTODIFF_OPENAD_AMPI */
250  C        Clear requests  C        Clear requests
251           southRecvAck(eBl,bi,bj) = 0           southRecvAck(eBl,bi,bj) = 0
252           northRecvAck(eBl,bi,bj) = 0           northRecvAck(eBl,bi,bj) = 0
# Line 261  C        Update statistics Line 267  C        Update statistics
267  #ifndef ALWAYS_USE_MPI  #ifndef ALWAYS_USE_MPI
268           IF ( usingMPI ) THEN           IF ( usingMPI ) THEN
269  #endif  #endif
270    # ifndef ALLOW_AUTODIFF_OPENAD_AMPI
271            CALL MPI_Waitall( exchNReqsY(1,bi,bj), exchReqIdY(1,1,bi,bj),            CALL MPI_Waitall( exchNReqsY(1,bi,bj), exchReqIdY(1,1,bi,bj),
272       &                      mpiStatus, mpiRC )       &                      mpiStatus, mpiRC )
273    # else
274              CALL ampi_waitall(
275         & exchNReqsY(1,bi,bj),
276         & exchReqIdY(1,1,bi,bj),
277         & mpiStatus,
278         & mpiRC )
279    # endif /* ALLOW_AUTODIFF_OPENAD_AMPI */
280  #ifndef ALWAYS_USE_MPI  #ifndef ALWAYS_USE_MPI
281          ENDIF                          ENDIF                
282  #endif  #endif

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.13

  ViewVC Help
Powered by ViewVC 1.1.22