#include namespace diy { namespace mpi { //! \addtogroup MPI //!@{ template struct maximum { const U& operator()(const U& x, const U& y) const { return std::max(x,y); } }; template struct minimum { const U& operator()(const U& x, const U& y) const { return std::min(x,y); } }; //!@} namespace detail { template struct mpi_op { static MPI_Op get(); }; template struct mpi_op< maximum > { static MPI_Op get() { return MPI_MAX; } }; template struct mpi_op< minimum > { static MPI_Op get() { return MPI_MIN; } }; template struct mpi_op< std::plus > { static MPI_Op get() { return MPI_SUM; } }; template struct mpi_op< std::multiplies > { static MPI_Op get() { return MPI_PROD; } }; template struct mpi_op< std::logical_and > { static MPI_Op get() { return MPI_LAND; } }; template struct mpi_op< std::logical_or > { static MPI_Op get() { return MPI_LOR; } }; } } }