Next: , Previous: , Up: The c_mpi backend   [Contents][Index]


Implementation of reductions

Implementation of reductions

The c_mpi backend implements the coNCePTuaL REDUCE statement (see Reducing) as follows. Many-to-one reductions are implemented with a single call to MPI_Reduce(). Many-to-many reductions in which the sources exactly match the targets are implemented with a single call to MPI_Allreduce() . All other reductions are implemented by calling MPI_Reduce() to reduce the data to the first target task then MPI_Bcast() to distribute the reduced data to the remaining targets.

Because MPI requires that the source and target buffers in an MPI_Reduce() or MPI_Allreduce() be different, the c_mpi backend utilizes two buffers when UNIQUE (see Unique messages) is specified. It utilizes two adjacent buffers when FROM BUFFER or INTO BUFFER (see Buffer control) is specified.

Scott Pakin, pakin@lanl.gov