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

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

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

revision 1.7 by cnh, Fri Nov 11 03:01:26 2005 UTC revision 1.11 by utke, Fri Apr 4 20:18:34 2008 UTC
# Line 76  C                                   tile Line 76  C                                   tile
76        INTEGER eastCommMode        INTEGER eastCommMode
77        INTEGER spinCount        INTEGER spinCount
78  #ifdef ALLOW_USE_MPI  #ifdef ALLOW_USE_MPI
79        INTEGER theProc, theTag, theType, theSize        INTEGER theProc, theTag, theType, theSize, pReqI
80        INTEGER mpiStatus(MPI_STATUS_SIZE,4), mpiRc        INTEGER mpiStatus(MPI_STATUS_SIZE,4), mpiRc
81  #endif  #endif
82  CEOP  CEOP
# Line 154  C--   iii. Set data read flag + memory s Line 154  C--   iii. Set data read flag + memory s
154           theTag  = _tileTagRecvW(bi,bj)           theTag  = _tileTagRecvW(bi,bj)
155           theType = _MPI_TYPE_RX           theType = _MPI_TYPE_RX
156           theSize = sNy*exchWidthX*myNz           theSize = sNy*exchWidthX*myNz
157    # ifndef ALLOW_AUTODIFF_OPENAD
158           CALL MPI_Recv( westRecvBuf_RX(1,eBl,bi,bj), theSize, theType,           CALL MPI_Recv( westRecvBuf_RX(1,eBl,bi,bj), theSize, theType,
159       &                  theProc, theTag, MPI_COMM_MODEL,       &                  theProc, theTag, MPI_COMM_MODEL,
160       &                  mpiStatus, mpiRc )       &                  mpiStatus, mpiRc )
161    # else
162             pReqI=exchNReqsX(1,bi,bj)+1
163             CALL ampi_recv_RX(
164         & westRecvBuf_RX(1,eBl,bi,bj) ,
165         & theSize ,
166         & theType ,
167         & theProc ,
168         & theTag ,
169         & MPI_COMM_MODEL ,
170         & exchReqIdX(pReqI,1,bi,bj),
171         & exchNReqsX(1,bi,bj),
172         & mpiStatus ,
173         & mpiRc )
174    # endif /* ALLOW_AUTODIFF_OPENAD */
175  #ifndef ALWAYS_USE_MPI  #ifndef ALWAYS_USE_MPI
176          ENDIF                          ENDIF                
177  #endif  #endif
# Line 171  C--   iii. Set data read flag + memory s Line 186  C--   iii. Set data read flag + memory s
186           theTag  = _tileTagRecvE(bi,bj)           theTag  = _tileTagRecvE(bi,bj)
187           theType = _MPI_TYPE_RX           theType = _MPI_TYPE_RX
188           theSize = sNy*exchWidthX*myNz           theSize = sNy*exchWidthX*myNz
189    # ifndef ALLOW_AUTODIFF_OPENAD
190           CALL MPI_Recv( eastRecvBuf_RX(1,eBl,bi,bj), theSize, theType,           CALL MPI_Recv( eastRecvBuf_RX(1,eBl,bi,bj), theSize, theType,
191       &                  theProc, theTag, MPI_COMM_MODEL,       &                  theProc, theTag, MPI_COMM_MODEL,
192       &                  mpiStatus, mpiRc )       &                  mpiStatus, mpiRc )
193    # else
194             pReqI=exchNReqsX(1,bi,bj)+1
195             CALL ampi_recv_RX(
196         & eastRecvBuf_RX(1,eBl,bi,bj) ,
197         & theSize ,
198         & theType ,
199         & theProc ,
200         & theTag ,
201         & MPI_COMM_MODEL ,
202         & exchReqIdX(pReqI,1,bi,bj),
203         & exchNReqsX(1,bi,bj),
204         & mpiStatus ,
205         & mpiRc )
206    # endif /* ALLOW_AUTODIFF_OPENAD */
207  #ifndef ALWAYS_USE_MPI  #ifndef ALWAYS_USE_MPI
208          ENDIF                          ENDIF                
209  #endif  #endif
# Line 195  C        i.e. we only lock waiting for d Line 225  C        i.e. we only lock waiting for d
225           ebL = exchangeBufLevel(1,bi,bj)           ebL = exchangeBufLevel(1,bi,bj)
226           westCommMode = _tileCommModeW(bi,bj)           westCommMode = _tileCommModeW(bi,bj)
227           eastCommMode = _tileCommModeE(bi,bj)           eastCommMode = _tileCommModeE(bi,bj)
228    # ifndef ALLOW_AUTODIFF_OPENAD
229     10    CONTINUE     10    CONTINUE
230            CALL FOOL_THE_COMPILER( spinCount )            CALL FOOL_THE_COMPILER( spinCount )
231            spinCount = spinCount+1            spinCount = spinCount+1
# Line 202  C         IF ( myThid .EQ. 1 .AND. spinC Line 233  C         IF ( myThid .EQ. 1 .AND. spinC
233  C          WRITE(*,*) ' eBl = ', ebl  C          WRITE(*,*) ' eBl = ', ebl
234  C          STOP ' S/R EXCH_RECV_GET_X: spinCount .GT. _EXCH_SPIN_LIMIT'  C          STOP ' S/R EXCH_RECV_GET_X: spinCount .GT. _EXCH_SPIN_LIMIT'
235  C         ENDIF  C         ENDIF
236            IF ( westRecvAck(eBl,bi,bj) .EQ. 0. ) GOTO 10            IF ( westRecvAck(eBl,bi,bj) .EQ. 0 ) GOTO 10
237            IF ( eastRecvAck(eBl,bi,bj) .EQ. 0. ) GOTO 10            IF ( eastRecvAck(eBl,bi,bj) .EQ. 0 ) GOTO 10
238    # else
239             do while ((westRecvAck(eBl,bi,bj) .EQ. 0.
240         &             .or.
241         &              eastRecvAck(eBl,bi,bj) .EQ. 0. ))
242              CALL FOOL_THE_COMPILER( spinCount )
243              spinCount = spinCount+1
244             end do
245    # endif /* ALLOW_AUTODIFF_OPENAD */
246  C        Clear outstanding requests  C        Clear outstanding requests
247           westRecvAck(eBl,bi,bj) = 0.           westRecvAck(eBl,bi,bj) = 0
248           eastRecvAck(eBl,bi,bj) = 0.           eastRecvAck(eBl,bi,bj) = 0
249    
250           IF ( exchNReqsX(1,bi,bj) .GT. 0 ) THEN           IF ( exchNReqsX(1,bi,bj) .GT. 0 ) THEN
251  #ifdef ALLOW_USE_MPI  #ifdef ALLOW_USE_MPI
252  #ifndef ALWAYS_USE_MPI  #ifndef ALWAYS_USE_MPI
253           IF ( usingMPI ) THEN           IF ( usingMPI ) THEN
254  #endif  #endif
255    # ifndef ALLOW_AUTODIFF_OPENAD
256            CALL MPI_Waitall( exchNReqsX(1,bi,bj), exchReqIdX(1,1,bi,bj),            CALL MPI_Waitall( exchNReqsX(1,bi,bj), exchReqIdX(1,1,bi,bj),
257       &                      mpiStatus, mpiRC )       &                      mpiStatus, mpiRC )
258    # else
259              CALL ampi_waitall(
260         & exchNReqsX(1,bi,bj),
261         & exchReqIdX(1,1,bi,bj),
262         & mpiStatus,
263         & mpiRC )
264    # endif /* ALLOW_AUTODIFF_OPENAD */
265  #ifndef ALWAYS_USE_MPI  #ifndef ALWAYS_USE_MPI
266          ENDIF                          ENDIF                
267  #endif  #endif

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.11

  ViewVC Help
Powered by ViewVC 1.1.22