[mpich-discuss] Why do predefined MPI_Ops function elementwise in MPI_Accumulate, but not in MPI-1 routines?

William Gropp wgropp at illinois.edu
Tue Apr 24 15:36:43 CDT 2012


A lot of this had to do with wanting to make it possible for MPI_Accumulate to be executed entirely in hardware, respecting the various MPI one-sided operations and semantics, including the atomicity rules, and not requiring the execution of arbitrary user code.  This was not a concern for Reduce/Allreduce/Scan/Exscan/Reduce_scatter.  

Bill

William Gropp
Director, Parallel Computing Institute
Deputy Director for Research
Institute for Advanced Computing Applications and Technologies
Paul and Cynthia Saylor Professor of Computer Science
University of Illinois Urbana-Champaign



On Apr 24, 2012, at 6:30 AM, Jim Dinan wrote:

> 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
> 
> _______________________________________________
> 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