95 |
k1Lo = 1 |
k1Lo = 1 |
96 |
k1Hi = myNz |
k1Hi = myNz |
97 |
|
|
|
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 ) |
|
|
|
|
98 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
99 |
|
|
100 |
|
C Prevent anyone to access shared buffer while an other thread modifies it |
101 |
|
CALL BAR2( myThid ) |
102 |
|
|
103 |
C-- Extract from buffer (either from level 1 if local exch, |
C-- Extract from buffer (either from level 1 if local exch, |
104 |
C or level 2 if coming from an other Proc) |
C or level 2 if coming from an other Proc) |
105 |
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 |
140 |
ENDDO |
ENDDO |
141 |
ENDDO |
ENDDO |
142 |
|
|
143 |
|
C Wait until all threads finish filling buffer |
144 |
|
CALL BAR2( myThid ) |
145 |
|
|
146 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
147 |
|
|
148 |
#ifdef ALLOW_USE_MPI |
#ifdef ALLOW_USE_MPI |
150 |
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 |
151 |
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) |
152 |
|
|
|
C Wait until all threads finish filling buffer |
|
|
CALL BAR2( myThid ) |
|
153 |
_BEGIN_MASTER( myThid ) |
_BEGIN_MASTER( myThid ) |
154 |
|
|
155 |
C-- Send my data (in buffer, level 2) to target Process |
C-- Send my data (in buffer, level 2) to target Process |
227 |
ENDDO |
ENDDO |
228 |
|
|
229 |
_END_MASTER( myThid ) |
_END_MASTER( myThid ) |
230 |
|
C Everyone waits until master-thread finishes receiving |
231 |
|
CALL BAR2( myThid ) |
232 |
|
|
233 |
#endif /* ALLOW_USE_MPI */ |
#endif /* ALLOW_USE_MPI */ |
234 |
|
|
235 |
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 ) |
|
236 |
|
|
237 |
C-- Post sends into buffer (buffer level 1): |
C-- Post sends into buffer (buffer level 1): |
238 |
C- AD: = get exch-data from buffer (level 1), formerly in source tile |
C- AD: = get exch-data from buffer (level 1), formerly in source tile |
271 |
ENDDO |
ENDDO |
272 |
ENDDO |
ENDDO |
273 |
|
|
|
CALL BAR2(myThid) |
|
|
|
|
274 |
RETURN |
RETURN |
275 |
END |
END |
276 |
|
|