/[MITgcm]/MITgcm/pkg/exch2/exch2_rx2_cube_ad.template
ViewVC logotype

Diff of /MITgcm/pkg/exch2/exch2_rx2_cube_ad.template

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

revision 1.7 by jmc, Sun Jun 28 01:00:23 2009 UTC revision 1.8 by jmc, Mon Jun 29 23:46:50 2009 UTC
# Line 104  C-    Tile size of arrays to exchange: Line 104  C-    Tile size of arrays to exchange:
104        k2Lo  = 1        k2Lo  = 1
105        k2Hi  = myNz        k2Hi  = myNz
106    
 C     For now tile <-> tile exchanges are sequentialised through  
 C     thread 1. This is a temporary feature for preliminary testing until  
 C     general tile decomposition is in place (CNH April 11, 2001)  
       CALL BAR2( myThid )  
   
107  C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|  C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
108    
109    C     Prevent anyone to access shared buffer while an other thread modifies it
110          CALL BAR2( myThid )
111    
112  C--   Extract from buffer (either from level 1 if local exch,  C--   Extract from buffer (either from level 1 if local exch,
113  C                     or level 2 if coming from an other Proc)  C                     or level 2 if coming from an other Proc)
114  C  AD: = fill buffer from my-tile-edge overlap-region, level 1 or 2 depending  C  AD: = fill buffer from my-tile-edge overlap-region, level 1 or 2 depending
# Line 155  C      o e2_msgHandle entry to read is e Line 153  C      o e2_msgHandle entry to read is e
153         ENDDO         ENDDO
154        ENDDO        ENDDO
155    
156    C     Wait until all threads finish filling buffer
157          CALL BAR2( myThid )
158    
159  C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|  C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
160    
161  #ifdef ALLOW_USE_MPI  #ifdef ALLOW_USE_MPI
# Line 162  C  AD: all MPI part is acting on buffer Line 163  C  AD: all MPI part is acting on buffer
163  C  AD: except a) the buffer level: send from lev.2, receive into lev.1  C  AD: except a) the buffer level: send from lev.2, receive into lev.1
164  C  AD:        b) the length of transfered buffer (<- match the ad_put/ad_get)  C  AD:        b) the length of transfered buffer (<- match the ad_put/ad_get)
165    
 C     wait until all threads finish filling buffer  
       CALL BAR2( myThid )  
166        _BEGIN_MASTER( myThid )        _BEGIN_MASTER( myThid )
167    
168  C--   Send my data (in buffer, level 1) to target Process  C--   Send my data (in buffer, level 1) to target Process
# Line 248  C           that he has consumed the buf Line 247  C           that he has consumed the buf
247        ENDDO        ENDDO
248    
249        _END_MASTER( myThid )        _END_MASTER( myThid )
250    C     Everyone waits until master-thread finishes receiving
251          CALL BAR2( myThid )
252    
253  #endif /* ALLOW_USE_MPI */  #endif /* ALLOW_USE_MPI */
254    
255  C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|  C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
 C     Wait until all threads finish receiving or filling buffer  
       CALL BAR2( myThid )  
256    
257  C--   Post sends into buffer (buffer level 1):  C--   Post sends into buffer (buffer level 1):
258        DO bj=myByLo(myThid), myByHi(myThid)        DO bj=myByLo(myThid), myByHi(myThid)
# Line 294  C     in its copy of "array1" & "array2" Line 294  C     in its copy of "array1" & "array2"
294         ENDDO         ENDDO
295        ENDDO        ENDDO
296    
       CALL BAR2(myThid)  
   
297        RETURN        RETURN
298        END        END
299    

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

  ViewVC Help
Powered by ViewVC 1.1.22