[mpich-discuss] MPI_Accumulate with MAXLOC does not error for incompatible types

Jed Brown jedbrown at mcs.anl.gov
Tue Jan 1 19:53:38 CST 2013


On Tue, Jan 1, 2013 at 7:49 PM, Jeff Hammond <jhammond at alcf.anl.gov> wrote:

> MPI_Accumulate permits the use of pre-defined reduction operations
> with user-defined datatypes, provided the user-defined datatypes are
> homogeneous.  Your use of MPI_MAXLOC with MY_2INT for MPI_Accumulate
> is legal in my reading of the standard.  It may not be legal for
> MPI_Reduce because of the stupid asymmetry (that I believe you have
> pointed out in the past) wherein MPI_Reduce (and MPI_Allreduce) cannot
> do things that MPI_Accumulate can do w.r.t. built-in MPI_Op with
> user-defined MPI_Datatype.
>
> Perhaps MPI_Accumulate is correct in not generating but providing the
> wrong answer for MPI_MAXLOC, which would be a bug of a different
> nature.
>

Perhaps, but my reading is that the predefined Op is applied to the basic
type from which I constructed MY_2INT (i.e., MPI_INT). Since MPI_MAXLOC
does not apply to MPI_INT, this would be an error. I wouldn't know how to
write precise language specifying the behavior that would lead to
MPI_MAXLOC working with MY_2INT.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mpich.org/pipermail/discuss/attachments/20130101/8e982005/attachment.html>


More information about the discuss mailing list