One of the basic data movement operations needed in parallel signal processing is the 2-D matrix transpose. This operation has motivated a generalization of the MPI_ALLTOALLV function. This new collective operation is MPI_ALLTOALLW; the ``W'' indicates that it is an extension to MPI_ALLTOALLV.
The following function is the most general form of All-to-all. Like MPI_TYPE_CREATE_STRUCT, the most general type constructor, MPI_ALLTOALLW allows separate specification of count, displacement and datatype. In addition, to allow maximum flexibility, the displacement of blocks within the send and receive buffers is specified in bytes.
MPI_ALLTOALLW(sendbuf, sendcounts, sdispls, sendtypes,
recvbuf, recvcounts, rdispls, recvtypes, comm)
int MPI_Alltoallw(void *sendbuf, int sendcounts[], int sdispls[], MPI_Datatype sendtypes[], void *recvbuf, int recvcounts[], int rdispls[], MPI_Datatype recvtypes[], MPI_Comm comm)
MPI_ALLTOALLW(SENDBUF, SENDCOUNTS, SDISPLS, SENDTYPES, RECVBUF, RECVCOUNTS, RDISPLS, RECVTYPES, COMM, IERROR) <type> SENDBUF(*), RECVBUF(*)
INTEGER SENDCOUNTS(*), SDISPLS(*), SENDTYPES(*), RECVCOUNTS(*), RDISPLS(*), RECVTYPES(*), COMM, IERROR
int MPI::Comm::Alltoallw(const void* sendbuf, const int sendcounts[], const int sdispls[], const MPI::Datatype sendtypes[], void* recvbuf, const int recvcounts[], const int rdispls[], const MPI::Datatype recvtypes[]) const = 0
void
No ``in place'' option is supported.
The -th block sent from process
is received by process
and is placed in the
-th block of recvbuf.
These blocks need not all have the same size.
The type signature associated with
sendcounts[j], sendtypes[j] at process must be equal
to the type signature
associated with recvcounts[i], recvtypes[i] at process
.
This implies that the amount of data sent must be equal to the
amount of data received, pairwise between every pair of processes.
Distinct type maps between sender and receiver are still allowed.
The outcome is as if each process sent a message to every other process with
All arguments on all processes are significant. The argument comm must describe the same communicator on all processes.
If comm is an intercommunicator, then the outcome is as if
each process in group A sends a message to each process in group B,
and vice versa. The -th send buffer of process
in group A should
be consistent with the
-th receive buffer of process
in group B,
and vice versa.
MPI-Standard for MARMOT