|
KaMPIng 0.2.1
(Near) zero-overhead MPI wrapper for C++
|
RAII handle that creates an MPI_Op from a raw MPI callback function pointer.
More...
#include <reduce_ops.hpp>
Public Types | |
| using | callback_type = void (*)(void*, void*, int*, MPI_Datatype*) |
The MPI callback signature expected by MPI_Op_create. | |
Public Member Functions | |
| ScopedCallbackOp () noexcept=default | |
Constructs an empty, non-owning handle (MPI_OP_NULL). | |
| ScopedCallbackOp (callback_type ptr) | |
Creates an MPI_Op for the given callback. | |
| ScopedCallbackOp (ScopedCallbackOp const &)=delete | |
| ScopedCallbackOp & | operator= (ScopedCallbackOp const &)=delete |
| ScopedCallbackOp (ScopedCallbackOp &&) noexcept=default | |
| Move constructor. The moved-from handle becomes empty. | |
| ScopedCallbackOp & | operator= (ScopedCallbackOp &&) noexcept=default |
| Move assignment. Frees any currently owned op, then takes ownership. | |
| MPI_Op | get () const noexcept |
RAII handle that creates an MPI_Op from a raw MPI callback function pointer.
Calls MPI_Op_create on construction and MPI_Op_free on destruction. A default-constructed ScopedCallbackOp is empty (MPI_OP_NULL, non-owning). Supports move construction and assignment; the moved-from handle becomes empty.
Typically used for lambdas with captures, where the lambda is stored separately and a raw function pointer (via a static trampoline) is passed to MPI_Op_create.
| is_commutative | Whether the operation is commutative. |
|
inlineexplicit |
Creates an MPI_Op for the given callback.
| ptr | Non-null MPI callback function pointer. |
|
inlinenoexcept |
MPI_Op (MPI_OP_NULL if default-constructed). Do not free manually.