Collective Communication II

3. MPI_Scatterv Syntax
INTEGER SENDCOUNTS(0:NPROC-1), DISPLS(0:NPROC-1)
...
CALL MPI_SCATTERV
( SENDBUF, SENDCOUNTS, DISPLS, SENDTYPE,
RECVBUF, RECVCOUNT, RECVTYPE,
ROOT, COMM, IERROR )

The syntax for achieving an MPI_Scatterv operation is really pretty straightforward--dare I say, self-explanatory? Anyway, here's what it looks like in Fortran. Compared to plain scatter, there are two differences: the SENDCOUNTS argument has become an array, and a new argument DISPLS has been added to the list.

SENDCOUNTS(I) is the number of items of type SENDTYPE
to send from process ROOT to process I.
Thus its value is significant only on ROOT.

DISPLS(I) is the displacement from SENDBUF to the
beginning of the I-th message, in units of SENDTYPE.
It also has significance only for the ROOT process.

And that's pretty much it! The other arguments in the list simply mirror the usual MPI_Scatter calling sequence. The C syntax differs only in minor C-like details; if you want, you can see more about those details in the MPI Collective Communication module.