7.3.2.2 Gather



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

IN
sendbuf starting address of send buffer (choice)
IN
sendcount number of elements in send buffer (integer)
IN
sendtype data type of send buffer elements (handle)
OUT
recvbuf address of receive buffer (choice, significant only at root)
IN
recvcount number of elements for any single receive (integer, significant only at root)
IN
recvtype data type of recv buffer elements (handle, significant only at root)
IN
root rank of receiving process (integer)
IN
comm communicator (handle)

int MPI::Comm::Gather(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 sendbuf at the root. In such a case, sendcount and sendtype are ignored, and the contribution of the root to the gathered vector is assumed to be already in the correct place in the receive buffer

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 gathered from all processes in group B to the root. The send buffer arguments of the processes in group B must be consistent with the receive buffer argument of the root.



MPI_GATHERV(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, root, comm)

IN
sendbuf starting address of send buffer (choice)
IN
sendcount number of elements in send buffer (integer)
IN
sendtype data type of send buffer elements (handle)
OUT
recvbuf address of receive buffer (choice, significant only at root)
IN
recvcounts integer array (of length group size) containing the number of elements that are received from each process (significant only at root)
IN
displs integer array (of length group size). Entry i specifies the displacement relative to recvbuf at which to place the incoming data from process i (significant only at root)
IN
recvtype data type of recv buffer elements (handle, significant only at root)
IN
root rank of receiving process (integer)
IN
comm communicator (handle)

int MPI::Comm::Gatherv(const void* sendbuf, int sendcount, const MPI::Datatype& sendtype, void* recvbuf, const int recvcounts[], const int displs[], 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 sendbuf at the root. In such a case, sendcount and sendtype are ignored, and the contribution of the root to the gathered vector is assumed to be already in the correct place in the receive buffer

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 gathered from all processes in group B to the root. The send buffer arguments of the processes in group B must be consistent with the receive buffer argument of the root.

MPI-Standard for MARMOT