On Tue, Jan 1, 2013 at 7:49 PM, Jeff Hammond <[email protected]> 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.