KaMPIng 0.1.1
Flexible and (near) zero-overhead C++ bindings for MPI
Loading...
Searching...
No Matches
mpi_ops.hpp File Reference

Definitions for builtin MPI operations. More...

#include <algorithm>
#include <functional>
#include <type_traits>
#include <mpi.h>
#include "kamping/mpi_datatype.hpp"
Include dependency graph for mpi_ops.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  kamping::internal::max_impl< T >
 Wrapper struct for std::max. More...
 
struct  kamping::internal::max_impl< void >
 Template specialization for kamping::internal::max_impl without type parameter, which leaves the operand type to be deduced. More...
 
struct  kamping::internal::min_impl< T >
 Wrapper struct for std::min. More...
 
struct  kamping::internal::min_impl< void >
 Template specialization for kamping::internal::min_impl without type parameter, which leaves the operand type to be deduced. The actual implementation is used in case that the operation is a builtin operation for the given datatype. More...
 
struct  kamping::internal::logical_xor_impl< T >
 Wrapper struct for logical xor, as the standard library does not provided a function object for it. More...
 
struct  kamping::internal::logical_xor_impl< void >
 Template specialization for kamping::internal::logical_xor_impl without type parameter, which leaves to operand type to be deduced. The actual implementation is used in case that the operation is a builtin operation for the given datatype. More...
 
struct  kamping::ops::null< T >
 builtin null operation (aka MPI_OP_NULL) More...
 
struct  kamping::ops::internal::commutative_tag
 tag for a commutative reduce operation More...
 
struct  kamping::ops::internal::non_commutative_tag
 tag for a non-commutative reduce operation More...
 
struct  kamping::ops::internal::undefined_commutative_tag
 tag for a reduce operation without manually declared commutativity (this is only used internally for builtin reduce operations) More...
 
struct  kamping::internal::mpi_operation_traits< Op, Datatype >
 Type trait for checking whether a functor is a builtin MPI reduction operation and query corresponding MPI_Op. More...
 
class  kamping::internal::UserOperationWrapper< is_commutative, T, Op >
 Wrapper for a user defined reduction operation based on a functor object. More...
 
class  kamping::internal::UserOperationPtrWrapper< is_commutative >
 Wrapper for a user defined reduction operation based on a function pointer. More...
 
class  kamping::internal::ReduceOperation< T, Op, Commutative >
 Wraps an operation and translates it to a builtin MPI_Op or constructs a custom operation. More...
 

Namespaces

namespace  kamping::internal
 Internal namespace marking the code that is not user-facing.
 
namespace  kamping::ops
 this namespace contains all builtin operations supported by MPI.
 

Typedefs

template<typename T = void>
using kamping::ops::max = kamping::internal::max_impl<T>
 builtin maximum operation (aka MPI_MAX)
 
template<typename T = void>
using kamping::ops::min = kamping::internal::min_impl<T>
 builtin minimum operation (aka MPI_MIN)
 
template<typename T = void>
using kamping::ops::plus = std::plus<T>
 builtin summation operation (aka MPI_SUM)
 
template<typename T = void>
using kamping::ops::multiplies = std::multiplies<T>
 builtin multiplication operation (aka MPI_PROD)
 
template<typename T = void>
using kamping::ops::logical_and = std::logical_and<T>
 builtin logical and operation (aka MPI_LAND)
 
template<typename T = void>
using kamping::ops::bit_and = std::bit_and<T>
 builtin bitwise and operation (aka MPI_BAND)
 
template<typename T = void>
using kamping::ops::logical_or = std::logical_or<T>
 builtin logical or operation (aka MPI_LOR)
 
template<typename T = void>
using kamping::ops::bit_or = std::bit_or<T>
 builtin bitwise or operation (aka MPI_BOR)
 
template<typename T = void>
using kamping::ops::logical_xor = kamping::internal::logical_xor_impl<T>
 builtin logical xor operation (aka MPI_LXOR)
 
template<typename T = void>
using kamping::ops::bit_xor = std::bit_xor<T>
 builtin bitwise xor operation (aka MPI_BXOR)
 
using kamping::internal::mpi_custom_operation_type = void (*)(void*, void*, int*, MPI_Datatype*)
 type used by user-defined operations passed to MPI_Op_create
 

Functions

template<typename Functor >
auto kamping::internal::with_operation_functor (MPI_Op op, Functor &&func)
 Helper function that maps an MPI_Op to the matching functor from kamping::ops. In case no function maps, the functor is called with kamping::ops::null<>{}.
 

Variables

constexpr internal::commutative_tag kamping::ops::commutative {}
 global tag for commutativity
 
constexpr internal::non_commutative_tag kamping::ops::non_commutative {}
 global tag for non-commutativity
 

Detailed Description

Definitions for builtin MPI operations.