Purpose
Sends a distinct message from each task to every task. Messages can have different datatypes, sizes, and displacements.
C synopsis
#include <mpi.h> int MPI_Alltoallw(void* sendbuf, int sendcounts[], int sdispls[], MPI_Datatype sendtypes[], void *recvbuf, int recvcounts[], int rdispls[], MPI_Datatype recvtypes[], MPI_Comm comm);
C++ synopsis
#include mpi.h void 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;
FORTRAN synopsis
include 'mpif.h' or use mpi MPI_ALLTOALLW(CHOICE SENDBUF(*), INTEGER SENDCOUNTS(*), INTEGER SDISPLS(*), INTEGER SENDTYPES(*), CHOICE RECVBUF, INTEGER RECVCOUNTS(*), INTEGER RDISPLS(*), INTEGER RECVTYPES(*), INTEGER COMM, INTEGER IERROR)
Parameters
Description
This subroutine is an extension of MPI_ALLTOALLV. It 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.
The jth block sent from task i is received by task j and is placed in the ith block of recvbuf. These blocks need not all have the same size.
The type signature associated with sendcounts[j], sendtypes[j] at task i must be equal to the type signature associated with recvcounts[i], recvtypes[i] at task j. This means the amount of data sent must be equal to the amount of data received, pair wise between every pair of tasks. Distinct type maps between sender and receiver are allowed.
All arguments on all tasks are significant.
MPI_ALLTOALLW does not support MPI_IN_PLACE on either type of communicator.
If comm is an intercommunicator, the outcome is as if each task in group A sends a message to each task in group B, and vice versa. The jth send buffer of task i in group A should be consistent with the ith receive buffer of task j in group B, and vice versa.
When you use this subroutine in a threads application, make sure all collective operations on a particular communicator occur in the same order at each task. See IBM Parallel Environment for AIX: MPI Programming Guide for more information on programming with MPI in a threads environment.
Notes
In the bindings for this subroutine, the send displacement and receive displacements are arrays of integers. This may limit the usability of this subroutine in certain 64-bit applications. It is likely that the MPI Forum will define a replacement for MPI_ALLTOALLW and deprecate this binding. The replacement subroutine will use arrays of address_size integers. The MPI_ALLTOALLW subroutine with the present binding will remain available.
Errors
Fatal errors:
Related information