[mpi3-coll] Question on reduction operation in intercommunicators
moody20 at llnl.gov
Fri Feb 13 14:57:10 CST 2009
The spec is a bit fuzzy regarding the op parameter for reduction-type
collectives on intercommunicators. There are a few lines in the
intracommunicator text under MPI_REDUCE, which says:
page 161, lines 11-15:
"Furthermore, the datatype and op given for predefined operators
must be the same on all processes."
"Note, that it is possible for users to supply different
user-defined operations to MPI_REDUCE in each process. MPI does not
define which operations are used on which operands in this case."
However, nothing is explicitly said along such lines for
intercommunicators. I assume by default the above statements must
extend to intercommunicators as well.
I have two questions.
1) For intracommunicators, I understand the restriction on having
the same op specified by all processes for predefined operators --
performance. I could see a similar argument being made that all
processes (from both groups) in an intercomm also specify the same op
for predefined ops. However, I also see utility in forcing all
processes within a group to specify the same op, but allowing each group
to specify different ops (e.g., one may want the maximum of values from
group A and the minimum of values from group B). The downside in this
case is that processes of one group don't know the operation used by
processes in the other group without some communication. Also, we'd
need to be precise in specifying what data the two ops apply to (i.e.,
do I apply the op specified in group A to the data from group A or the
data from group B?).
2) A similar question arises for user-defined operators, since here
the current spec says that different processes may specify different
ops. It says MPI can apply which ever ops to which ever operands in
such a case for intracommunicators. Again, I could see value in
enabling the user to specify the same user-defined op within a group,
but different ops across groups.
More information about the mpiwg-coll