[mpich-discuss] Why do predefined MPI_Ops function elementwise in MPI_Accumulate, but not in MPI-1 routines?
Jim Dinan
dinan at mcs.anl.gov
Tue Apr 24 08:30:27 CDT 2012
I'm not sure if I'm following all the discussion, but here's my
understanding:
MPI_Reduce takes an array of elements and combines all elements from
every process to produce a single element of the original datatype as a
result. It doesn't pick apart the datatype of each element to do a
reduction on the individual basic units contained inside it. The
builtin operations only understand the builtin types; if you have a
derived datatype, you have to tell MPI how to combine elements of that
type and produce a new one of the same type.
MPI_Accumulate, on the other hand, works at the level of the basic units
which are described by the datatype and applies the operation at that level.
So, the operation names are the same, but Accumulate and Reduce utilize
datatypes in different ways. Reduce applies the op at the level of the
aggregate datatype and Accumulate applies the op at the level of the
basic units in the datatype.
It's an interesting suggestion to add the Accumulate interpretation to
the Reduce operations. We can't break backward compatibility, so we
would probably have to define a new set of operations to do the
reduction at the level of the basic datatypes.
~Jim.
On 04/23/2012 09:30 PM, Rajeev Thakur wrote:
> Probably not. But someone would have to go back and add that exception to the definition of MPI_Reduce.
>
> On Apr 23, 2012, at 9:24 PM, Jed Brown wrote:
>
>> On Mon, Apr 23, 2012 at 21:20, Rajeev Thakur <thakur at mcs.anl.gov> wrote:
>> One reason is that MPI_Accumulate allows only a restricted form of derived datatype, where all basic elements are of the same type. In MPI_Reduce you can pass any crazy datatype and you get to define the reduction operation for that.
>>
>> Is it somehow expensive to remember/determine that the datatype consists only of basic types, such that MPI_Reduce can process it in the same way that MPI_Accumulate does?
>> _______________________________________________
>> mpich-discuss mailing list mpich-discuss at mcs.anl.gov
>> To manage subscription options or unsubscribe:
>> https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss
>
> _______________________________________________
> mpich-discuss mailing list mpich-discuss at mcs.anl.gov
> To manage subscription options or unsubscribe:
> https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss
More information about the mpich-discuss
mailing list