|
KaMPIng 0.2.1
(Near) zero-overhead MPI wrapper for C++
|
RAII wrapper for an MPI_Op.
More...
#include <reduce_ops.hpp>
Public Member Functions | |
| ScopedOp () noexcept | |
Constructs an empty, non-owning handle (MPI_OP_NULL). | |
| ScopedOp (MPI_Op op, bool owns) noexcept | |
Wrap an existing MPI_Op. | |
| ScopedOp (ScopedOp const &)=delete | |
| ScopedOp & | operator= (ScopedOp const &)=delete |
| ScopedOp (ScopedOp &&other) noexcept | |
| Move constructor. Transfers ownership; the moved-from handle no longer frees the op. | |
| ScopedOp & | operator= (ScopedOp &&other) noexcept |
| Move assignment. Frees any currently owned op, then transfers ownership. | |
| MPI_Op | get () const noexcept |
RAII wrapper for an MPI_Op.
Calls MPI_Op_free on destruction only when owns is true (i.e. the op was created via MPI_Op_create for a user-defined functor). Predefined MPI constants (MPI_SUM, MPI_MAX, …) are never freed.
Analogous to ScopedDatatype for MPI_Datatype.
Wrap an existing MPI_Op.
| op | The op to wrap. |
| owns | If true, MPI_Op_free is called on destruction. |
|
inlinenoexcept |
MPI_Op.