Purpose
Sends a distinct message from each task to every task.
C synopsis
#include <mpi.h>
int MPI_Alltoall(void* sendbuf,int sendcount,MPI_Datatype sendtype,
void* recvbuf,int recvcount,MPI_Datatype recvtype,
MPI_Comm comm):
C++ synopsis
#include mpi.h void MPI::Comm::Alltoall(const void* sendbuf, int sendcount, const MPI::Datatype& sendtype, void* recvbuf, int recvcount, const MPI::Datatype& recvtype) const;
FORTRAN synopsis
include 'mpif.h' or use mpi
MPI_ALLTOALL(CHOICE SENDBUF,INTEGER SENDCOUNT,INTEGER SENDTYPE,
CHOICE RECVBUF,INTEGER RECVCOUNT,INTEGER RECVTYPE,
INTEGER COMM,INTEGER IERROR
Parameters
Description
MPI_ALLTOALL sends a distinct message from each task to every task.
The jth block of data sent from task i is received by task j and placed in the ith block of the buffer recvbuf.
The type signature associated with sendcount, sendtype, at a task must be equal to the type signature associated with recvcount, recvtype at any other task. This means the amount of data sent must be equal to the amount of data received, pair wise between every pair of tasks. The type maps can be different.
All arguments on all tasks are significant.
MPI_ALLTOALL 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 MPI_ALLTOALL is executed on an intercommunicator, the number of data items sent from tasks in group A to tasks in group B does not need to be equal to the number of items sent in the reverse direction. In particular, you can have unidirectional communication by specifying sendcount = 0 in the reverse direction.
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.
Errors
Fatal errors:
Develop mode error if:
Related information