RPN_COMM |
(RPN_COMM_adj_halo) |
SUBROUTINE RPN_COMM_adj_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
Local array size: g(minx:maxx,miny:maxy,nk)
Local problem size: g(ni,nj,nk)
Local problem size + halos: g(1-halox,ni+halox,1-haloy,nj+haloy,nk)
Row size (semi-lag case): g(gni,nj,nk)
maxx
minx +-------------------+ maxy
| halo
|
| +---------------+ |
| | ni
| |
| |
nj| |
| |(1,1,k)
| |
| +---------------+ |
|
|
+-------------------+ miny
Size of the problem and decomposition of the domain for 3x3 topology :
1
gni
+--+--+--+
|P6|P7|P8|
+--+--+--+
|P3|P4|P5|
+--+--+--+
|P0|P1|P2|
+--+--+--+
1
gni
East-west exchange example: The "x" column is added to the "y" column on the local array of the rigth neighbor
P0 P1
+-----------+
+-------------+
| halo x|
| y+x |
| +-------+x|
| +---------+ |
| | |x| --------->
| |y+x | |
| | |x|
| |y+x | |
| +-------+x|
| +---------+ |
| halo x|
| y+x |
+-----------+
+-------------+
Semi-lagrangian case, halo exchange example: here, we gather local arrays of a row of processes. At the end of the exchange, each process of the row has a copy of the "global" row.
P0
P1
P2
P0 and P1 and P2
(a=x+y, b=y+z)
+----------+ +----------+ +----------+
+---------------------+
|xxxxzzxxxx| |yyyyyyyyyy| |zzzzzzzzzz|
|xxxxxxaayyyybbzzzzzzz|
|x+------+x| |y+------+y| |z+------+z|
|x+-----------------+z|
|x|xxxxxx|x| + |y|yyyyyy|y| + |z|zzzzzz|z| -> |x|xxxxaayyyybbzzzzz|z|
|x|xxxxxx|x| |y|yyyyyy|y| |z|zzzzzz|z|
|x|xxxxaayyyybbzzzzz|z|
|x+------+x| |y+------+y| |z+------+z|
|x+-----------------+z|
|xxxxxxxxxx| |yyyyyyyyyy| |zzzzzzzzzz|
|xxxxxxaayyyybbzzzzzzz|
+----------+ +----------+ +----------+
+---------------------+
N.B.: Obviously, we need, minx <= 1-halox < ni+halox <= maxx (same for y)
If npol_row > 0, then the semi-lagragian exchange will be used for the npol_row rows of processes at north and south end.