KaMPIng 0.1.0
(Near) zero-overhead C++ MPI bindings.
Loading...
Searching...
No Matches
kamping::internal::UserOperationWrapper< is_commutative, T, Op > Class Template Reference

Wrapper for a user defined reduction operation based on a functor object. More...

#include <mpi_ops.hpp>

Public Member Functions

void operator= (UserOperationWrapper< is_commutative, T, Op > &)=delete
 
void operator= (UserOperationWrapper< is_commutative, T, Op > &&)=delete
 
 UserOperationWrapper (Op &&op)
 creates an MPI operation for the specified functor
 
operator() (T const &lhs, T const &rhs) const
 Call the wrapped operation.
 
MPI_Op get_mpi_op ()
 

Static Public Member Functions

static void execute (void *invec, void *inoutvec, int *len, MPI_Datatype *)
 wrapper around the provided functor which is called by MPI
 

Detailed Description

template<bool is_commutative, typename T, typename Op>
class kamping::internal::UserOperationWrapper< is_commutative, T, Op >

Wrapper for a user defined reduction operation based on a functor object.

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

Template Parameters
is_commutativewhether the operation is commutative or not
Tthe type to apply the operation to.
Optype of the functor object to wrap

Constructor & Destructor Documentation

◆ UserOperationWrapper()

template<bool is_commutative, typename T , typename Op >
kamping::internal::UserOperationWrapper< is_commutative, T, Op >::UserOperationWrapper ( Op && op)
inline

creates an MPI operation for the specified functor

Parameters
opthe functor to call for reduction. this has to be a binary function applicable to two arguments of type T which return a result of type T

Member Function Documentation

◆ get_mpi_op()

template<bool is_commutative, typename T , typename Op >
MPI_Op kamping::internal::UserOperationWrapper< is_commutative, T, Op >::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: