<div>The standard contains the following statement about MPI_Accumulate, which can only use predefined operations.</div><div><br></div><div><i>Each datatype argument must be a predefined datatype or a derived datatype, where all basic components are of the same predefined datatype. Both datatype arguments must be constructed from the same predefined datatype.</i></div>
<div><br></div><div>Under this restriction, MPI_SUM can be applied to derived datatypes, but it cannot be used in the same context with MPI_Allreduce and similar. This causes an ugly interface in which we</div><div><br></div>
<div>1. MUST create a new MPI_Op to be used when calling MPI_Allreduce with this data type.</div><div><br></div><div>2. Must NOT create a new MPI_Op when used with MPI_Accumulate.</div><div><br></div><div>This causes awkward translation if we have an API that may be implemented in terms of one-sided operations or may be implemented in terms of collective reductions (e.g. if we do communication graph analysis and choose an implementation based on sparsity or the network).</div>
<div><br></div><div>Is there any way to circumvent this annoyance?</div><div><br></div><div>What was the rationale for not having MPI_SUM work with MPI_Allreduce and company when the same conditions as specified for MPI_Accumulate are met?</div>