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 |
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 |
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 |
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) |
294 |
ENDDO |
ENDDO |
295 |
ENDDO |
ENDDO |
296 |
|
|
|
CALL BAR2(myThid) |
|
|
|
|
297 |
RETURN |
RETURN |
298 |
END |
END |
299 |
|
|