/[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.3 by dimitri, Wed Nov 12 00:02:44 2003 UTC revision 1.7 by cnh, Fri Nov 11 03:01:26 2005 UTC
# Line 81  C                                   tile Line 81  C                                   tile
81  #endif  #endif
82  CEOP  CEOP
83    
84           INTEGER myBxLoSave(MAX_NO_THREADS)
85           INTEGER myBxHiSave(MAX_NO_THREADS)
86           INTEGER myByLoSave(MAX_NO_THREADS)
87           INTEGER myByHiSave(MAX_NO_THREADS)
88           LOGICAL doingSingleThreadedComms
89    
90           doingSingleThreadedComms = .FALSE.
91    #ifdef ALLOW_USE_MPI
92    #ifndef ALWAYS_USE_MPI
93          IF ( usingMPI ) THEN
94    #endif
95    C      Set default behavior to have MPI comms done by a single thread.
96    C      Most MPI implementations don't support concurrent comms from
97    C      several threads.
98           IF ( nThreads .GT. 1 ) THEN
99            _BARRIER
100            _BEGIN_MASTER( myThid )
101             DO I=1,nThreads
102              myBxLoSave(I) = myBxLo(I)
103              myBxHiSave(I) = myBxHi(I)
104              myByLoSave(I) = myByLo(I)
105              myByHiSave(I) = myByHi(I)
106             ENDDO
107    C        Comment out loop below and myB[xy][Lo|Hi](1) settings below
108    C        if you want to get multi-threaded MPI comms.
109             DO I=1,nThreads
110              myBxLo(I) = 0
111              myBxHi(I) = -1
112              myByLo(I) = 0
113              myByHi(I) = -1
114             ENDDO
115             myBxLo(1) = 1
116             myBxHi(1) = nSx
117             myByLo(1) = 1
118             myByHi(1) = nSy
119             doingSingleThreadedComms = .TRUE.
120            _END_MASTER( myThid )
121            _BARRIER
122          ENDIF
123    #ifndef ALWAYS_USE_MPI
124          ENDIF
125    #endif
126    #endif
127    
128  C--   Under a "put" scenario we  C--   Under a "put" scenario we
129  C--     i. set completetion signal for buffer we put into.  C--     i. set completetion signal for buffer we put into.
# Line 153  C        i.e. we only lock waiting for d Line 196  C        i.e. we only lock waiting for d
196           westCommMode = _tileCommModeW(bi,bj)           westCommMode = _tileCommModeW(bi,bj)
197           eastCommMode = _tileCommModeE(bi,bj)           eastCommMode = _tileCommModeE(bi,bj)
198     10    CONTINUE     10    CONTINUE
199            CALL FOOL_THE_COMPILER            CALL FOOL_THE_COMPILER( spinCount )
200            spinCount = spinCount+1            spinCount = spinCount+1
201  C         IF ( myThid .EQ. 1 .AND. spinCount .GT. _EXCH_SPIN_LIMIT ) THEN  C         IF ( myThid .EQ. 1 .AND. spinCount .GT. _EXCH_SPIN_LIMIT ) THEN
202  C          WRITE(*,*) ' eBl = ', ebl  C          WRITE(*,*) ' eBl = ', ebl
# Line 318  C--   Read from the buffers Line 361  C--   Read from the buffers
361         ENDDO         ENDDO
362        ENDDO        ENDDO
363    
364          _BARRIER
365          IF ( doingSingleThreadedComms ) THEN
366    C      Restore saved settings that were stored to allow
367    C      single thred comms.
368           _BEGIN_MASTER(myThid)
369            DO I=1,nThreads
370             myBxLo(I) = myBxLoSave(I)
371             myBxHi(I) = myBxHiSave(I)
372             myByLo(I) = myByLoSave(I)
373             myByHi(I) = myByHiSave(I)
374            ENDDO
375           _END_MASTER(myThid)
376          ENDIF                
377          _BARRIER
378    
379        RETURN        RETURN
380        END        END

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

  ViewVC Help
Powered by ViewVC 1.1.22