7.3.2.3 Scatter



MPI_SCATTER(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm)

IN
sendbuf address of send buffer (choice, significant only at root)
IN
sendcount number of elements sent to each process (integer, significant only at root)
IN
sendtype data type of send buffer elements (handle, significant only at root)
OUT
recvbuf address of receive buffer (choice)
IN
recvcount number of elements in receive buffer (integer)
IN
recvtype data type of receive buffer elements (handle)
IN
root rank of sending process (integer)
IN
comm communicator (handle)

int MPI::Comm::Scatter(const void* sendbuf, int sendcount, const MPI::Datatype& sendtype, void* recvbuf, int recvcount, const MPI::Datatype& recvtype, int root) const = 0



void

The ``in place'' option for intracommunicators is specified by passing MPI_IN_PLACE as the value of recvbuf at the root. In such case, recvcount and recvtype are ignored, and root ``sends'' no data to itself. The scattered vector is still assumed to contain $n$ segments, where $n$ is the group size; the root-th segment, which root should ``send to itself,'' is not moved.

If comm is an intercommunicator, then the call involves all processes in the intercommunicator, but with one group (group A) defining the root process. All processes in the other group (group B) pass the same value in argument root, which is the rank of the root in group A. The root passes the value MPI_ROOT in root. All other processes in group A pass the value MPI_PROC_NULL in root. Data is scattered from the root to all processes in group B. The receive buffer arguments of the processes in group B must be consistent with the send buffer argument of the root.



MPI_SCATTERV(sendbuf, sendcounts, displs, sendtype, recvbuf, recvcount, recvtype, root, comm)

IN
sendbuf address of send buffer (choice, significant only at root)
IN
sendcounts integer array (of length group size) specifying the number of elements to send to each processor
IN
displs integer array (of length group size). Entry i specifies the displacement (relative to sendbuf from which to take the outgoing data to process i
IN
sendtype data type of send buffer elements (handle)
OUT
recvbuf address of receive buffer (choice)
IN
recvcount number of elements in receive buffer (integer)
IN
recvtype data type of receive buffer elements (handle)
IN
root rank of sending process (integer)
IN
comm communicator (handle)

int MPI::Comm::Scatterv(const void* sendbuf, const int sendcounts[], const int displs[], const MPI::Datatype& sendtype, void* recvbuf, int recvcount, const MPI::Datatype& recvtype, int root) const = 0



void

The ``in place'' option for intracommunicators is specified by passing MPI_IN_PLACE as the value of recvbuf at the root. In such case, recvcount and recvtype are ignored, and root ``sends'' no data to itself. The scattered vector is still assumed to contain $n$ segments, where $n$ is the group size; the root-th segment, which root should ``send to itself,'' is not moved.

If comm is an intercommunicator, then the call involves all processes in the intercommunicator, but with one group (group A) defining the root process. All processes in the other group (group B) pass the same value in argument root, which is the rank of the root in group A. The root passes the value MPI_ROOT in root. All other processes in group A pass the value MPI_PROC_NULL in root. Data is scattered from the root to all processes in group B. The receive buffer arguments of the processes in group B must be consistent with the send buffer argument of the root.

MPI-Standard for MARMOT