RPN_COMM |
(RPN_COMM_xch_halo) |
SUBROUTINE RPN_COMM_xch_halo (g,minx,maxx,miny,maxy,ni,nj,nk,halox,haloy,periodx,periody,gni,npol_row)
g | Array containing the local tile | real or integer | I/O |
minx,maxx, miny, maxy | Total dimensions of array g (nk for z axis) | integer | I |
ni,nj,nk | Dimensions of local array | integer | I |
halox,haloy | Halo width for x and y | integer | I |
periodx,periody | Periodicity for x and y | logical | I |
gni | Global array size(=problem size) along x | integer | I |
npol_row | Number of polar rows of processes (semi-lag case) | integer | I |
Dimensions of local array g: g(minx:maxx,miny:maxy,nk)
Dimensions of the local grid: g(1:ni,1:nj,1:nk)
Dimensions of the local grid + halo: g(1-halox:ni+halox,1-haloy:nj+haloy,nk)
Dimensions of a row (semi-lagrangian case): g(gni,nj,nk)
maxx
minx +-------------------+ maxy
| halo
|
| +---------------+ |
| | ni
| |
| |
nj| |
| |(1,1,k)
| |
| +---------------+ |
|
|
+-------------------+ miny
Size and decomposition of the domain for a 3x3 distribution:
1
gni
+--+--+--+
|P6|P7|P8|
+--+--+--+
|P3|P4|P5|
+--+--+--+
|P0|P1|P2|
+--+--+--+
1
gni
Example of a west-east exchange: the "x" marked column is copied into the halo of the right neighbour.
P0
P1
+-----------+
+-----------+
| halo x |
|x halo |
| +-----+-+ |
|x+-------+ |
| | x| | --------->
|x| | |
| | x| |
|x| | |
| +-----+-+ |
|x+-------+ |
| halo x |
|x halo |
+-----------+
+-----------+
Example of the semi-lagrangian case: here, we put together all local grids of an east-west row of PEs. When the call returns, each PE has the "global" band.
+----------+ +----------+ +----------+
+-------------------+
| P0 | |
P1 | | P2
| | P0 et P1 et P2 |
| +------+ | | +------+ | | +------+ |
| +---------------+ |
| |xxxxxx| | + | |xxxxxx| | + | |xxxxxx| | -> | |xxxxxxxxxxxxxxx|
|
| |xxxxxx| | | |xxxxxx| | | |xxxxxx| |
| |xxxxxxxxxxxxxxx| |
| +------+ | | +------+ | | +------+ |
| +---------------+ |
| |
| | |
| |
|
+----------+ +----------+ +----------+
+-------------------+
N.B.: Obviously, we need minx <= 1-halox < ni+halox <= maxx (same for y)
If npol_row > 0, then the semi-lagrangian exchange will be used for the npol_row rows of PEs at the northern and southern extremity of the domain.