![]() |
Home | Libraries | People | FAQ | More |
boost::mpi::is_mpi_op — Determine if a function object has an associated MPI_Op.
// In header: <boost/mpi/operations.hpp> template<typename Op, typename T> struct is_mpi_op { };
This trait determines if a function object type Op, when used with argument type T, has an associated MPI_Op. If so, is_mpi_op<Op,T> will derive from mpl::false_ and will contain a static member function op that takes no arguments but returns the associated MPI_Op value. For instance, is_mpi_op<std::plus<int>,int>op() returns MPI_SUM.
Users may specialize is_mpi_op for any other class templates that map onto operations that have MPI_Op equivalences, such as bitwise OR, logical and, or maximum. However, users are encouraged to use the standard function objects in the functional and boost/mpi/operations.hpp headers whenever possible. For function objects that are class templates with a single template parameter, it may be easier to specialize is_builtin_mpi_op.