KaMPIng 0.1.1
Flexible and (near) zero-overhead C++ bindings for MPI
Loading...
Searching...
No Matches
kamping::internal::UserOperationPtrWrapper< is_commutative > Class Template Reference

Wrapper for a user defined reduction operation based on a function pointer. More...

#include <mpi_ops.hpp>

Public Member Functions

UserOperationPtrWrapper< is_commutative > & operator= (UserOperationPtrWrapper< is_commutative > const &)=delete
 
UserOperationPtrWrapper< is_commutative > & operator= (UserOperationPtrWrapper< is_commutative > &&other_op)
 move assignment
 
 UserOperationPtrWrapper (UserOperationPtrWrapper< is_commutative > const &)=delete
 
 UserOperationPtrWrapper (UserOperationPtrWrapper< is_commutative > &&other_op)
 move constructor
 
 UserOperationPtrWrapper ()
 creates an empty operation wrapper
 
 UserOperationPtrWrapper (mpi_custom_operation_type ptr)
 creates an MPI operation for the specified function pointer
 
MPI_Op get_mpi_op ()
 

Detailed Description

template<bool is_commutative>
class kamping::internal::UserOperationPtrWrapper< is_commutative >

Wrapper for a user defined reduction operation based on a function pointer.

Internally, this creates an MPI_Op which is freed upon destruction.

Template Parameters
is_commutativewhether the operation is commutative or not

Constructor & Destructor Documentation

◆ UserOperationPtrWrapper()

template<bool is_commutative>
kamping::internal::UserOperationPtrWrapper< is_commutative >::UserOperationPtrWrapper ( mpi_custom_operation_type ptr)
inline

creates an MPI operation for the specified function pointer

Parameters
ptrthe functor to call for reduction this parameter must match the semantics of the function pointer passed to MPI_Op_create according to the MPI standard.

Member Function Documentation

◆ get_mpi_op()

template<bool is_commutative>
MPI_Op kamping::internal::UserOperationPtrWrapper< is_commutative >::get_mpi_op ( )
inline
Returns
the MPI_Op constructed for the provided functor.

Do not free this operation manually, because the destructor calls it. Some MPI implementations silently segfault if an MPI_Op is freed multiple times.


The documentation for this class was generated from the following file: