Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

large-count reductions #4

Open
jeffhammond opened this issue Dec 3, 2015 · 0 comments
Open

large-count reductions #4

jeffhammond opened this issue Dec 3, 2015 · 0 comments

Comments

@jeffhammond
Copy link
Member

Motivation

Because MPI reductions require user-defined reductions with user-defined datatypes (unlike RMA), it is difficult albeit not impossible to write large-count reductions using user-defined datatypes. However, because user-defined reductions provide no support for MPI_IN_PLACE, this is unsolvable except in a pipelined implementation.

MPI_Reduce_scatter_x is unsolvable in MPI-3, short of using MPI_Reduce and MPI_Alltoallw. The latter solution is inefficient, as discussed in #2.

Function Definitions

int MPI_Reduce_x(const void *sendbuf, void *recvbuf, MPI_Count count, 
                 MPI_Datatype datatype,MPI_Op op, int root, MPI_Comm comm);

int MPI_Allreduce_x(const void *sendbuf, void *recvbuf, MPI_Count count,
                    MPI_Datatype datatype, MPI_Op op, MPI_Comm comm);

int MPI_Reduce_scatter_block_x(const void *sendbuf, void *recvbuf, MPI_Count recvcount, 
                               MPI_Datatype datatype, MPI_Op op, MPI_Comm comm);

int MPI_Reduce_scatter_x(const void *sendbuf, void *recvbuf, const MPI_Count recvcounts[],
                         MPI_Datatype datatype, MPI_Op op, MPI_Comm comm);

int MPI_Ireduce_x(const void *sendbuf, void *recvbuf, MPI_Count count, 
                  MPI_Datatype datatype,MPI_Op op, int root, MPI_Comm comm);

int MPI_Iallreduce_x(const void *sendbuf, void *recvbuf, MPI_Count count,
                     MPI_Datatype datatype, MPI_Op op, MPI_Comm comm);

int MPI_Ireduce_scatter_block_x(const void *sendbuf, void *recvbuf, MPI_Count recvcount, 
                                MPI_Datatype datatype, MPI_Op op, MPI_Comm comm);

int MPI_Ireduce_scatter_x(const void *sendbuf, void *recvbuf, const MPI_Count recvcounts[],
                          MPI_Datatype datatype, MPI_Op op, MPI_Comm comm);

In order to support user-defined reductions, a new function signature for the reduction operator. While we are changing it anyways, we add a second datatype argument, to address the issues brought up in Trac ticket #339.

int MPI_Op_create_x(MPI_User_function_x* user_fn, int commute, MPI_Op* op);

void MPI_User_function_x(void* inbuf, MPI_Datatype *intype,
                         void* inoutbuf, MPI_Datatype *inouttype, MPI_Count *len);

Implementation

BigMPI already implements reduce, allreduce and reduce_scatter_block (see reductions_x.c). The reduce_scatter functions will be implemented soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant