version 0.6.0
MPI send/receive

Namespaces

module  mod_mpi_send_receive
 Send/receive an array from a MPI process to another Generic send/receive routines of an array from a MPI process to another. They encapsulate MPI call for sake of simplicity.
 

Detailed Description

With 'mpi_send_receive', a processor can send an array to another processor (nonblocking exchange). These routines encapsulate MPI calls for sake of simplicity.

Generic interfaces:

mpi_send_receive(from, to, array)

or

mpi_send_receive(from, to, array_sent, array_recv)

'array', 'array_from', and 'array_to' can be 'integer', 'double precision' or 'logical' arrays. The rank of these arrays can be 1, 2, 3, or 4.

Warning: 'array_sent' and 'array_recv' must have the same rank and type.

Example for the first interface:

double precision, dimension(2,3) :: A
call mpi_send_receive(7, 8, A)

Example for the second interface:

double precision, dimension(2) :: A
double precision, dimension(3) :: B
if (rank == 0) then
A = 1
B = 10
end if
if (rank == 2) then
A = 2
B = 20
end if
call mpi_send_receive(2, 0, A, B) ! Executed by 2
call mpi_send_receive(0, 2, B, A) ! Executed by 0