Scatterv
Scatterv is a collective communication operation in the Message Passing Interface (MPI) that distributes data from a root process to all processes in a communicator, allowing each recipient to receive a different amount of data. It generalizes MPI_Scatter by permitting variable block sizes, enabling nonuniform data distribution across processes.
In MPI, the C signature is int MPI_Scatterv(const void *sendbuf, const int *sendcounts, const int *displs, MPI_Datatype
- sendbuf: starting address of the data to send (significant only at the root process).
- sendcounts: array of length equal to the number of processes, specifying how many elements of sendtype
- displs: array of length equal to the number of processes, specifying the starting offset in sendbuf
- sendtype: datatype of the data being sent.
- recvbuf: buffer in the receiving process to receive the data.
- recvcount: maximum number of elements that can be received by a process; all processes provide this
- recvtype: datatype of the data being received.
- root: rank of the root process that provides the data.
- comm: communicator over which the operation is performed.
Non-root processes ignore sendbuf, sendcounts, and displs; they must supply a recvbuf large enough for at
The sum of all sendcounts must equal the total number of elements in the send buffer. Displacements
Example pattern: with N processes, root 0 has a sendbuf of total M elements, and sendcounts may