/[MITgcm]/MITgcm/pkg/flt/exch_send_put_vec.F
ViewVC logotype

Diff of /MITgcm/pkg/flt/exch_send_put_vec.F

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

revision 1.8 by jmc, Wed Aug 31 21:35:11 2011 UTC revision 1.9 by jmc, Thu Sep 6 16:13:53 2012 UTC
# Line 5  C $Name$ Line 5  C $Name$
5  #undef DBUG_EXCH_VEC  #undef DBUG_EXCH_VEC
6    
7  C--   Contents  C--   Contents
8  C--   o EXCH_RL_SEND_PUT_VEC_X  C--   o EXCH_SEND_PUT_VEC_X_RL
9  C--   o EXCH_RL_SEND_PUT_VEC_Y  C--   o EXCH_SEND_PUT_VEC_Y_RL
10    
11  C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|  C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
12  CBOP 0  CBOP 0
13  C !ROUTINE: EXCH_RL_SEND_PUT_VEC_X  C !ROUTINE: EXCH_SEND_PUT_VEC_X_RL
14    
15  C !INTERFACE:  C !INTERFACE:
16        SUBROUTINE EXCH_RL_SEND_PUT_VEC_X(        SUBROUTINE EXCH_SEND_PUT_VEC_X_RL(
17       I                        arrayE, arrayW,       I                        arrayE, arrayW,
18       O                        bufRecE, bufRecW,       O                        bufRecE, bufRecW,
19       I                        myd1, myThid )       I                        myd1, myThid )
20  C     !DESCRIPTION:  C     !DESCRIPTION:
21  C     *==========================================================*  C     *==========================================================*
22  C     | SUBROUTINE EXCH_RL_SEND_PUT_VEC_X  C     | SUBROUTINE EXCH_SEND_PUT_VEC_X_RL
23  C     | o "Send" or "put" X edges for RL array.  C     | o "Send" or "put" X edges for RL array.
24  C     *==========================================================*  C     *==========================================================*
25  C     | Routine that invokes actual message passing send or  C     | Routine that invokes actual message passing send or
# Line 120  C       o Send or Put west edge Line 120  C       o Send or Put west edge
120          IF ( westCommMode .EQ. COMM_MSG  ) THEN          IF ( westCommMode .EQ. COMM_MSG  ) THEN
121  C        Send the data  C        Send the data
122  #ifdef ALLOW_USE_MPI  #ifdef ALLOW_USE_MPI
 #ifndef ALWAYS_USE_MPI  
123           IF ( usingMPI ) THEN           IF ( usingMPI ) THEN
124  #endif            theProc = tilePidW(bi,bj)
125           theProc = tilePidW(bi,bj)            theTag  = _tileTagSendW(bi,bj)
126           theTag  = _tileTagSendW(bi,bj)            theSize = myd1
127           theSize = myd1            theType = _MPI_TYPE_RL
128           theType = _MPI_TYPE_RL            exchNReqsX(1,bi,bj) = exchNReqsX(1,bi,bj)+1
          exchNReqsX(1,bi,bj) = exchNReqsX(1,bi,bj)+1  
129  #ifdef DBUG_EXCH_VEC  #ifdef DBUG_EXCH_VEC
130            write(ioUnit,'(A,7I5,I8)') 'qq1xW: ',myProcId,bi,bj,            write(ioUnit,'(A,7I5,I8)') 'qq1xW: ',myProcId,bi,bj,
131       &       theProc,theTag, exchNReqsX(1,bi,bj),       &          theProc,theTag, exchNReqsX(1,bi,bj),
132       &       exchReqIdX(exchNReqsX(1,bi,bj),1,bi,bj), theSize       &          exchReqIdX(exchNReqsX(1,bi,bj),1,bi,bj), theSize
133  #endif  #endif
134           CALL MPI_Isend(arrayW(1,bi,bj), theSize, theType,            CALL MPI_Isend( arrayW(1,bi,bj), theSize, theType,
135       &                  theProc, theTag, MPI_COMM_MODEL,       &                    theProc, theTag, MPI_COMM_MODEL,
136       &                  exchReqIdX(exchNReqsX(1,bi,bj),1,bi,bj), mpiRc)       &                    exchReqIdX(exchNReqsX(1,bi,bj),1,bi,bj),
137  #ifndef ALWAYS_USE_MPI       &                    mpiRc )
138           ENDIF           ENDIF
 #endif  
139  #endif /* ALLOW_USE_MPI */  #endif /* ALLOW_USE_MPI */
140           eastRecvAck(1,biW,bjW) = 1           eastRecvAck(1,biW,bjW) = 1
141          ELSEIF ( westCommMode .EQ. COMM_PUT  ) THEN          ELSEIF ( westCommMode .EQ. COMM_PUT  ) THEN
# Line 154  C       o Send or Put east edge Line 151  C       o Send or Put east edge
151          IF ( eastCommMode .EQ. COMM_MSG  ) THEN          IF ( eastCommMode .EQ. COMM_MSG  ) THEN
152  C        Send the data  C        Send the data
153  #ifdef ALLOW_USE_MPI  #ifdef ALLOW_USE_MPI
 #ifndef ALWAYS_USE_MPI  
154           IF ( usingMPI ) THEN           IF ( usingMPI ) THEN
155  #endif            theProc = tilePidE(bi,bj)
156           theProc = tilePidE(bi,bj)            theTag  = _tileTagSendE(bi,bj)
157           theTag  = _tileTagSendE(bi,bj)            theSize = myd1
158           theSize = myd1            theType = _MPI_TYPE_RL
159           theType = _MPI_TYPE_RL            exchNReqsX(1,bi,bj) = exchNReqsX(1,bi,bj)+1
          exchNReqsX(1,bi,bj) = exchNReqsX(1,bi,bj)+1  
160  #ifdef DBUG_EXCH_VEC  #ifdef DBUG_EXCH_VEC
161  c         if (theProc .eq. 2 .or. theProc .eq. 4) then  c         if (theProc .eq. 2 .or. theProc .eq. 4) then
162  c         if (arrayE(1,bi,bj) .ne. 0.) then  c         if (arrayE(1,bi,bj) .ne. 0.) then
# Line 171  c         if (arrayE(1,bi,bj) .ne. 0.) t Line 166  c         if (arrayE(1,bi,bj) .ne. 0.) t
166  c         endif  c         endif
167  c         endif  c         endif
168  #endif  #endif
169           CALL MPI_Isend(arrayE(1,bi,bj), theSize, theType,            CALL MPI_Isend( arrayE(1,bi,bj), theSize, theType,
170       &                  theProc, theTag, MPI_COMM_MODEL,       &                    theProc, theTag, MPI_COMM_MODEL,
171       &                  exchReqIdX(exchNReqsX(1,bi,bj),1,bi,bj), mpiRc)       &                    exchReqIdX(exchNReqsX(1,bi,bj),1,bi,bj),
172  #ifndef ALWAYS_USE_MPI       &                    mpiRc)
173           ENDIF           ENDIF
 #endif  
174  #endif /* ALLOW_USE_MPI */  #endif /* ALLOW_USE_MPI */
175           westRecvAck(1,biE,bjE) = 1           westRecvAck(1,biE,bjE) = 1
176          ELSEIF ( eastCommMode .EQ. COMM_PUT  ) THEN          ELSEIF ( eastCommMode .EQ. COMM_PUT  ) THEN
# Line 237  C     Wait until all threads finish fill Line 231  C     Wait until all threads finish fill
231    
232  C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|  C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
233  CBOP 0  CBOP 0
234  C !ROUTINE: EXCH_RL_SEND_PUT_VEC_Y  C !ROUTINE: EXCH_SEND_PUT_VEC_Y_RL
235    
236  C !INTERFACE:  C !INTERFACE:
237        SUBROUTINE EXCH_RL_SEND_PUT_VEC_Y(        SUBROUTINE EXCH_SEND_PUT_VEC_Y_RL(
238       I                        arrayN, arrayS,       I                        arrayN, arrayS,
239       O                        bufRecN, bufRecS,       O                        bufRecN, bufRecS,
240       I                        myd1, myThid )       I                        myd1, myThid )
241  C     !DESCRIPTION:  C     !DESCRIPTION:
242  C     *==========================================================*  C     *==========================================================*
243  C     | SUBROUTINE EXCH_RL_SEND_PUT_VEC_Y  C     | SUBROUTINE EXCH_SEND_PUT_VEC_Y_RL
244  C     | o "Send" or "put" Y edges for RL array.  C     | o "Send" or "put" Y edges for RL array.
245  C     *==========================================================*  C     *==========================================================*
246  C     | Routine that invokes actual message passing send or  C     | Routine that invokes actual message passing send or
# Line 348  C       o Send or Put south edge Line 342  C       o Send or Put south edge
342          IF ( southCommMode .EQ. COMM_MSG  ) THEN          IF ( southCommMode .EQ. COMM_MSG  ) THEN
343  C        Send the data  C        Send the data
344  #ifdef ALLOW_USE_MPI  #ifdef ALLOW_USE_MPI
 #ifndef ALWAYS_USE_MPI  
345           IF ( usingMPI ) THEN           IF ( usingMPI ) THEN
346  #endif            theProc = tilePidS(bi,bj)
347           theProc = tilePidS(bi,bj)            theTag  = _tileTagSendS(bi,bj)
348           theTag  = _tileTagSendS(bi,bj)            theSize = myd1
349           theSize = myd1            theType = _MPI_TYPE_RL
350           theType = _MPI_TYPE_RL            exchNReqsY(1,bi,bj) = exchNReqsY(1,bi,bj)+1
351           exchNReqsY(1,bi,bj) = exchNReqsY(1,bi,bj)+1            CALL MPI_Isend( arrayS(1,bi,bj), theSize, theType,
352           CALL MPI_Isend(arrayS(1,bi,bj), theSize, theType,       &                    theProc, theTag, MPI_COMM_MODEL,
353       &                  theProc, theTag, MPI_COMM_MODEL,       &                    exchReqIdY(exchNReqsY(1,bi,bj),1,bi,bj),
354       &                  exchReqIdY(exchNReqsY(1,bi,bj),1,bi,bj), mpiRc)       &                    mpiRc )
 #ifndef ALWAYS_USE_MPI  
355           ENDIF           ENDIF
 #endif  
356  #endif /* ALLOW_USE_MPI */  #endif /* ALLOW_USE_MPI */
357           northRecvAck(1,biS,bjS) = 1           northRecvAck(1,biS,bjS) = 1
358          ELSEIF ( southCommMode .EQ. COMM_PUT  ) THEN          ELSEIF ( southCommMode .EQ. COMM_PUT  ) THEN
# Line 377  C       o Send or Put north edge Line 368  C       o Send or Put north edge
368          IF ( northCommMode .EQ. COMM_MSG  ) THEN          IF ( northCommMode .EQ. COMM_MSG  ) THEN
369  C        Send the data  C        Send the data
370  #ifdef ALLOW_USE_MPI  #ifdef ALLOW_USE_MPI
 #ifndef ALWAYS_USE_MPI  
371           IF ( usingMPI ) THEN           IF ( usingMPI ) THEN
372  #endif            theProc = tilePidN(bi,bj)
373           theProc = tilePidN(bi,bj)            theTag  = _tileTagSendN(bi,bj)
374           theTag  = _tileTagSendN(bi,bj)            theSize = myd1
375           theSize = myd1            theType = _MPI_TYPE_RL
376           theType = _MPI_TYPE_RL            exchNReqsY(1,bi,bj) = exchNReqsY(1,bi,bj)+1
377           exchNReqsY(1,bi,bj) = exchNReqsY(1,bi,bj)+1            CALL MPI_Isend( arrayN(1,bi,bj), theSize, theType,
378           CALL MPI_Isend(arrayN(1,bi,bj), theSize, theType,       &                    theProc, theTag, MPI_COMM_MODEL,
379       &                  theProc, theTag, MPI_COMM_MODEL,       &                    exchReqIdY(exchNReqsY(1,bi,bj),1,bi,bj),
380       &                  exchReqIdY(exchNReqsY(1,bi,bj),1,bi,bj), mpiRc)       &                    mpiRc )
 #ifndef ALWAYS_USE_MPI  
381           ENDIF           ENDIF
 #endif  
382  #endif /* ALLOW_USE_MPI */  #endif /* ALLOW_USE_MPI */
383           southRecvAck(1,biN,bjN) = 1           southRecvAck(1,biN,bjN) = 1
384          ELSEIF ( northCommMode .EQ. COMM_PUT  ) THEN          ELSEIF ( northCommMode .EQ. COMM_PUT  ) THEN

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

  ViewVC Help
Powered by ViewVC 1.1.22