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

Wraps an operation and translates it to a builtin MPI_Op or constructs a custom operation. More...

#include <mpi_ops.hpp>

Public Member Functions

 ReduceOperation (Op &&op, Commutative commutative)
 Constructs on operation wrapper.
 
MPI_Op op ()
 
operator() (T const &lhs, T const &rhs) const
 Call the underlying operation with the provided arguments.
 
identity ()
 

Static Public Attributes

static constexpr bool is_builtin
 indicates if this is a builtin operation
 
static constexpr bool commutative
 indicates if this operation is commutative
 

Detailed Description

template<typename T, typename Op, typename Commutative>
class kamping::internal::ReduceOperation< T, Op, Commutative >

Wraps an operation and translates it to a builtin MPI_Op or constructs a custom operation.

Template Parameters
Tthe argument type of the operation
Opthe type of the operation
Commutativetag indicating if this type is commutative

Constructor & Destructor Documentation

◆ ReduceOperation()

kamping::internal::ReduceOperation< T, Op, Commutative >::ReduceOperation ( Op && op,
Commutative commutative )

Constructs on operation wrapper.

Parameters
opthe operation maybe a function object a lambda or a std::function
commutativeMay be any instance of commutative, or non_commutative. Passing undefined_commutative is only supported for builtin operations.

Member Function Documentation

◆ identity()

Returns
the identity element for this operation and data type.

◆ op()

Returns
the MPI_Op associated with this operation

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