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

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

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

revision 1.3 by dimitri, Wed Nov 12 00:02:44 2003 UTC revision 1.5 by cnh, Wed Nov 9 17:22:08 2005 UTC
# Line 103  C                Sync. memory Line 103  C                Sync. memory
103  C        C      
104  CEOP  CEOP
105    
106           INTEGER myBxLoSave(MAX_NO_THREADS)
107           INTEGER myBxHiSave(MAX_NO_THREADS)
108           INTEGER myByLoSave(MAX_NO_THREADS)
109           INTEGER myByHiSave(MAX_NO_THREADS)
110           LOGICAL doingSingleThreadedComms
111    
112           doingSingleThreadedComms = .FALSE.
113    #ifdef ALLOW_USE_MPI
114    #ifndef ALWAYS_USE_MPI
115          IF ( usingMPI ) THEN
116    #endif
117    C      Set default behavior to have MPI comms done by a single thread.
118    C      Most MPI implementations don't support concurrent comms from
119    C      several threads.
120           IF ( nThreads .GT. 1 ) THEN
121            _BARRIER
122            _BEGIN_MASTER( myThid )
123             DO I=1,nThreads
124              myBxLoSave(I) = myBxLo(I)
125              myBxHiSave(I) = myBxHi(I)
126              myByLoSave(I) = myByLo(I)
127              myByHiSave(I) = myByHi(I)
128             ENDDO
129    C        Comment out loop below and myB[xy][Lo|Hi](1) settings below
130    C        if you want to get multi-threaded MPI comms.
131             DO I=1,nThreads
132              myBxLo(I) = 0
133              myBxHi(I) = -1
134              myByLo(I) = 0
135              myByHi(I) = -1
136             ENDDO
137             myBxLo(1) = 1
138             myBxHi(1) = nSx
139             myByLo(1) = 1
140             myByHi(1) = nSy
141             doingSingleThreadedComms = .TRUE.
142            _END_MASTER( myThid )
143            _BARRIER
144          ENDIF
145    #ifndef ALWAYS_USE_MPI
146          ENDIF
147    #endif
148    #endif
149    
150        DO bj=myByLo(myThid),myByHi(myThid)        DO bj=myByLo(myThid),myByHi(myThid)
151         DO bi=myBxLo(myThid),myBxHi(myThid)         DO bi=myBxLo(myThid),myBxHi(myThid)
152    
# Line 351  C     is much too slow and if we own the Line 395  C     is much too slow and if we own the
395  C     per process preemption is not a problem.  C     per process preemption is not a problem.
396        IF ( exchNeedsMemSync  ) CALL MEMSYNC        IF ( exchNeedsMemSync  ) CALL MEMSYNC
397    
398          IF ( doingSingleThreadedComms ) THEN
399    C      Restore saved settings that were stored to allow
400    C      single thred comms.
401           _BARRIER
402           _BEGIN_MASTER(myThid)
403            DO I=1,nThreads
404             myBxLo(I) = myBxLoSave(I)
405             myBxHi(I) = myBxHiSave(I)
406             myByLo(I) = myByLoSave(I)
407             myByHi(I) = myByHiSave(I)
408            ENDDO
409           _END_MASTER(myThid)
410           _BARRIER
411          ENDIF                
412    
413        RETURN        RETURN
414        END        END

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

  ViewVC Help
Powered by ViewVC 1.1.22