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

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

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

revision 1.6 by jmc, Sun Jun 28 01:02:17 2009 UTC revision 1.7 by jmc, Mon Sep 3 19:36:29 2012 UTC
# Line 55  C !LOCAL VARIABLES: Line 55  C !LOCAL VARIABLES:
55        INTEGER tN        INTEGER tN
56  #endif /* ALLOW_EXCH2 */  #endif /* ALLOW_EXCH2 */
57  #ifdef ALLOW_USE_MPI  #ifdef ALLOW_USE_MPI
58        INTEGER np0, np        INTEGER np, pId
59        _RX     temp(1:sNx,1:sNy,nSx,nSy)        _RX     temp(1:sNx,1:sNy,nSx,nSy)
60        INTEGER istatus(MPI_STATUS_SIZE), ierr        INTEGER istatus(MPI_STATUS_SIZE), ierr
61        INTEGER lbuff, idest, itag, ready_to_receive        INTEGER lbuff, idest, itag, ready_to_receive
# Line 139  C-    end if myProcId = 0 Line 139  C-    end if myProcId = 0
139        ENDIF        ENDIF
140    
141  #ifdef ALLOW_USE_MPI  #ifdef ALLOW_USE_MPI
142          IF ( usingMPI ) THEN
143    
144        lbuff = sNx*nSx*sNy*nSy         lbuff = sNx*nSx*sNy*nSy
145        idest = 0         idest = 0
146        itag  = 0         itag  = 0
147        ready_to_receive = 0         ready_to_receive = 0
148    
149        IF( mpiMyId .EQ. 0 ) THEN         IF( mpiMyId .EQ. 0 ) THEN
150    
151  C--   Process 0 polls and receives data from each process in turn  C--   Process 0 polls and receives data from each process in turn
152          DO np = 2, numberOfProcs          DO np = 2, nPx*nPy
153           np0 = np - 1           pId = np - 1
154  #ifndef DISABLE_MPI_READY_TO_RECEIVE  #ifndef DISABLE_MPI_READY_TO_RECEIVE
155           CALL MPI_SEND (ready_to_receive, 1, MPI_INTEGER,           CALL MPI_SEND (ready_to_receive, 1, MPI_INTEGER,
156       &           np0, itag, MPI_COMM_MODEL, ierr)       &           pId, itag, MPI_COMM_MODEL, ierr)
157  #endif  #endif
158           CALL MPI_RECV (temp, lbuff, _MPI_TYPE_RX,           CALL MPI_RECV (temp, lbuff, _MPI_TYPE_RX,
159       &           np0, itag, MPI_COMM_MODEL, istatus, ierr)       &           pId, itag, MPI_COMM_MODEL, istatus, ierr)
160    
161  C--   Process 0 gathers the local arrays into the global buffer.  C--   Process 0 gathers the local arrays into the global buffer.
162  #ifdef ALLOW_EXCH2  #ifdef ALLOW_EXCH2
# Line 221  C        end if-else useExch2GlobLayOut Line 222  C        end if-else useExch2GlobLayOut
222  C-      end loop on np  C-      end loop on np
223          ENDDO          ENDDO
224    
225        ELSE         ELSE
226    
227  C--   All proceses except 0 wait to be polled then send local array  C--   All proceses except 0 wait to be polled then send local array
228  #ifndef DISABLE_MPI_READY_TO_RECEIVE  #ifndef DISABLE_MPI_READY_TO_RECEIVE
# Line 231  C--   All proceses except 0 wait to be p Line 232  C--   All proceses except 0 wait to be p
232           CALL MPI_SEND (myField, lbuff, _MPI_TYPE_RX,           CALL MPI_SEND (myField, lbuff, _MPI_TYPE_RX,
233       &        idest, itag, MPI_COMM_MODEL, ierr)       &        idest, itag, MPI_COMM_MODEL, ierr)
234    
235        ENDIF         ENDIF
236    
237          ENDIF
238  #endif /* ALLOW_USE_MPI */  #endif /* ALLOW_USE_MPI */
239    
240        _END_MASTER( myThid )        _END_MASTER( myThid )

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

  ViewVC Help
Powered by ViewVC 1.1.22