[MPI3 Fortran] MPI_REDUCE_SCATTER question

Jeff Squyres jsquyres at cisco.com
Thu May 24 20:21:00 CDT 2012

In MPI-2.2 5.10.2, p180:5-11, it says:

If comm is an intercommunicator, then the result of the reduction of the data provided by processes in one group (group A) is scattered among processes in the other group (group B), and vice versa. Within each group, all processes provide the same recvcounts argument, and provide input vectors of count = sum_i^n recvcounts[i] elements stored in the send buffers, where n is the size of the group. The resulting vector from the other group is scattered in blocks of recvcounts[i] elements among the processes in the group. The number of elements count must be the same for the two groups.

As a reminder, the prototype for MPI_REDUCE_SCATTER is:

int MPI_Reduce_scatter(void* sendbuf, void* recvbuf, int *recvcounts,
             MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)

QUESTION: Is the size of the recvcounts array the size of the local group or the remote group?

** Evidence for local group:
- The first sentence of the above-quoted text implies that the reduction happens in the local group and then is scattered to the remote group.

- The third sentence of the above-quotes text only makes sense if recvcounts is the size of the remote group.

** Evidence for remote group:
- The second sentence of the above-quoted text states that n must be the size "of the group" -- but it doesn't say which group (!).  But the closest "group" reference was to the local group.

Which should it be?

Jeff Squyres
jsquyres at cisco.com
For corporate legal information go to: http://www.cisco.com/web/about/doing_business/legal/cri/

More information about the mpiwg-fortran mailing list