RPN_COMM

(RPN_COMM_move)



subroutine RPN_COMM_move( sendbuf, sendcount, type, dest,
     &     recvbuf, recvcount,periodicity, ierr)



ARGUMENTS


sendbufSend buffer*I
sendcountNumber of items to be sentintegerI
typeData type (see chart below)characterI
destDirection to the move (N,S,E,W)characterI
recvbufReceive buffer*O
recvcountItems to be receivedintegerI
periodicityPeriodicity along the direction of the movelogicalI
ierrerror flagintegerO

DESCRIPTION

Subroutine to move/get data from one PE to another along one direction, 'N' for north, 'S' for south, 'E' for east and 'W' for west. It uses the default communicator "DEFO" that can be changed by using RPN_COMM_defo. It is tested only with communicators "DOMM" and "GRID" so use with caution if using any other communicator

Types supported Operators supported Communicators recognized
"MPI_CHARACTER"* "MPI_OP_NULL" "EW"  (east-west)
"MPI_INTEGER" "MPI_MAX" "NS"  (north-south)
"MPI_INTEGER2" "MPI_MIN" "GRID" (full domain grid)
"MPI_REAL" "MPI_SUM" "BLOC" (inside local block)
"MPI_REAL8" "MPI_PROD" "BLOCMASTER" (between blocks master PEs)
"MPI_REAL4" "MPI_LAND" "ALL" (every PE)
"MPI_DOUBLE_PRECISION" "MPI_BAND" "DOMM", equivalent to "GRID"
"MPI_COMPLEX" "MPI_LOR" "DEFO" default communicator
"MPI_DOUBLE_COMPLEX" "MPI_BOR"
"MPI_LOGICAL" "MPI_LXOR"
"MPI_BXOR"
"MPI_MAXLOC"
"MPI_MINLOC"
* Note: MPI_CHARACTER for/pour RPN_COMM_bcastc only/seulement


EXAMPLE

To move to the upper processor in my domain an array of 8 integers, it would give

call RPN_COMM_move(send_array,8,"mpi_integer","N",recv_array,8,.false.,ierr)
To move to the left processor in my domain an array of 10 reals in a periodical domain, it would give
call RPN_COMM_move(send_array,10,"mpi_real","W",recv_array,10,.true.,ierr)
To move from a given process sendproc to his right neighbor process recvproc, we can use the following:
sendcnt=0
recvcnt=0
if(myproc.eq.sendproc) then
  sendcnt=20
endif
if(myproc.eq.recvproc) then
  recvcnt=20
endif
call RPN_COMM_move(send_array,sendcnt,"mpi_real","E",recv_array,sendcnt,.true.,ierr)


SEE ALSO

RPN_COMM_* 

Return to RPN Libraries home page