RPN_COMM

(RPN_COMM_bloc)



integer function RPN_COMM_bloc(nblocx,nblocy)



ARGUMENTS


nblocx,nblocyNumber of blocks in X and Y directionintegerI
RPN_COMM_bloc0 if ok, -1 if errorintegerO

DESCRIPTION

Creates the needed communicators to use blocks within a domain. Those communicators are named "BLOC" for in-block communication and "BLOCMASTER" for communication between blocks master PE. Blocks are constructed by divinding the number of processes along X by nblocx and the number of processes by nblocy. Note that each block has to be identical, so it it impossible to split 7 processes into 2 blocks (then RPN_COMM_bloc=-1 and an error message appears).

Using the "BLOC" communicator would make all communications relative to a single block, with its own relative ranks as shown on the upper-right grey block.

Using the "BLOCMASTER" communicator would make all communications relative to all blocmasters, i.e. all red processes in the picture. The numbering is as shown, starting at 0 for the lower-left master and going rigth, then up.

As one can conclude, a single PE can have different ranks, one for each communicator. Let see an example with 2 domains of 6 and 4 processes (3x2 and 2x2), divided in 3 and 1 blocks respectively. That would give:

ALLDOMMBLOCBLOCMASTER
0000
111MPI_UNDEFINED
222MPI_UNDEFINED
333MPI_UNDEFINED
4000
5101
6202
731MPI_UNDEFINED
841MPI_UNDEFINED
951MPI_UNDEFINED


EXAMPLE

call RPN_COMM_bloc(nblocx, nblocy)
! providing that nblocx divides the number of processes along x
! and that nblocy divides the number of processes along y


SEE ALSO

RPN_COMM_* 

Return to RPN Libraries home page