[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

MPI_REDUCE_SCATTER_BLOCK



Dear group,

during discussions at the recent EuroPVM/MPI conference it came up that
a regular variant of the MPI_REDUCE_SCATTER collective is indeed useful,
can be implemented with lower latency than the general variant, and is
missing from the standard. Here is a proposal for an addition to the 
standard:

-------------------------------------------------------------------------

MPI_REDUCE_SCATTER_BLOCK(sendbuf, recvbuf, recvcount, datatype, op, comm)

C interface:

int MPI_Reduce_scatter_block(void* sendbuf, 
                             void* recvbuf, int recvcount, MPI_Datatype datatype,
                             MPI_Op op, MPI_Comm comm)

(etc, for Fortran and C++)

MPI_REDUCE_SCATTER is often called with the same number of elements contributed
by each process. To cater for this, the "regular" MPI_REDUCE_SCATTER_BLOCK 
collective performs an element-wise reduction on a vector of 
count = size*recvcount elements, where size is the number of processes in 
comm, and splits the resulting vector into disjoint, consecutive blocks 
each of recvcount elements. The i'th block is stored in the receive buffer 
of process i defined by recvbuf, recvcount, and datatype.

The arguments recvcount and op must have identical values at all processes,
and the datatype arguments should match. Thus, all processes provide input
and output buffers of the same length, with elements of the same type.
The "in place" option is specified as for MPI_REDUCE_SCATTER and has the
same effect.

Rationale:
MPI_REDUCE_SCATTER_BLOCK not only covers a common usage pattern for the
reduce-scatter operation, but can be implemented with lower latency than 
the more general MPI_REDUCE_SCATTER function.

--------------------------------------------------------------------------

Best regards

Jesper