KaMPIng 0.2.1
(Near) zero-overhead MPI wrapper for C++
Loading...
Searching...
No Matches
MPI Type System

Standalone module for mapping C++ types to MPI datatypes. More...

Classes

struct  kamping::types::builtin_type< T >
 Checks if the type T is a builtin MPI type. More...
 
struct  kamping::types::builtin_type< char >
 Specialization of builtin_type for char. More...
 
struct  kamping::types::builtin_type< signed char >
 Specialization of builtin_type for signed char. More...
 
struct  kamping::types::builtin_type< unsigned char >
 Specialization of builtin_type for unsigned char. More...
 
struct  kamping::types::builtin_type< wchar_t >
 Specialization of builtin_type for wchar_t. More...
 
struct  kamping::types::builtin_type< short int >
 Specialization of builtin_type for short int. More...
 
struct  kamping::types::builtin_type< unsigned short int >
 Specialization of builtin_type for unsigned short int. More...
 
struct  kamping::types::builtin_type< int >
 Specialization of builtin_type for int. More...
 
struct  kamping::types::builtin_type< unsigned int >
 Specialization of builtin_type for unsigned int. More...
 
struct  kamping::types::builtin_type< long int >
 Specialization of builtin_type for long int. More...
 
struct  kamping::types::builtin_type< unsigned long int >
 Specialization of builtin_type for unsigned long int. More...
 
struct  kamping::types::builtin_type< long long int >
 Specialization of builtin_type for long long int. More...
 
struct  kamping::types::builtin_type< unsigned long long int >
 Specialization of builtin_type for unsigned long long int. More...
 
struct  kamping::types::builtin_type< float >
 Specialization of builtin_type for float. More...
 
struct  kamping::types::builtin_type< double >
 Specialization of builtin_type for double. More...
 
struct  kamping::types::builtin_type< long double >
 Specialization of builtin_type for long double. More...
 
struct  kamping::types::builtin_type< bool >
 Specialization of builtin_type for bool. More...
 
struct  kamping::types::builtin_type< std::byte >
 Specialization of builtin_type for std::byte. More...
 
struct  kamping::types::builtin_type< kabool >
 Specialization of builtin_type for kabool. More...
 
struct  kamping::types::builtin_type< std::complex< float > >
 Specialization of builtin_type for std::complex<float>. More...
 
struct  kamping::types::builtin_type< std::complex< double > >
 Specialization of builtin_type for std::complex<double>. More...
 
struct  kamping::types::builtin_type< std::complex< long double > >
 Specialization of builtin_type for std::complex<long double>. More...
 
struct  kamping::types::contiguous_type< T, N, Lookup >
 Constructs a contiguous MPI type of N elements of type T using MPI_Type_contiguous. More...
 
struct  kamping::types::byte_serialized< T >
 Constructs a type serialized as a sequence of sizeof(T) bytes using MPI_BYTE. More...
 
class  kamping::types::kabool
 Wrapper around bool to allow handling containers of boolean values. More...
 
struct  kamping::types::mpi_type_traits< T, Enable >
 The type trait that maps a C++ type T to an MPI_Datatype for the kamping-types module. More...
 
struct  kamping::types::mpi_type_traits< T, std::enable_if_t< has_auto_dispatched_type_v< T > > >
 Partial specialization of kamping::types::mpi_type_traits for types matched by kamping::types::type_dispatcher(). More...
 
struct  kamping::types::has_static_type< typename, Enable >
 Check if the type has a static type definition, i.e. kamping::types::mpi_type_traits is defined. More...
 
struct  kamping::types::has_static_type< T, std::void_t< decltype(mpi_type_traits< T >::data_type())> >
 Check if the type has a static type definition, i.e. kamping::types::mpi_type_traits is defined. More...
 
struct  kamping::types::type_dispatcher_lookup
 Default lookup policy for contiguous_type and struct_type. More...
 
class  kamping::types::ScopedDatatype
 RAII wrapper that commits an MPI_Datatype on construction and frees it on destruction. More...
 
struct  kamping::types::kamping_tag
 Tag used for indicating that a struct is reflectable. More...
 
struct  kamping::types::struct_type< T, Lookup >
 Constructs an MPI_Datatype for a struct-like type. More...
 

Enumerations

enum class  kamping::types::TypeCategory {
  integer , floating , complex , logical ,
  byte , character , struct_like , contiguous
}
 Type groups as defined in Section 6.9.2 of the MPI 4.0 standard.
 

Functions

constexpr bool kamping::types::category_has_to_be_committed (TypeCategory category)
 Returns whether an MPI_Datatype of the given category must be committed before use.
 
template<typename T >
auto kamping::types::type_dispatcher ()
 Maps a C++ type T to a type trait for constructing an MPI_Datatype.
 
static MPI_Datatype kamping::types::contiguous_type< T, N, Lookup >::data_type ()
 Returns the MPI_Datatype for a contiguous block of N elements of type T.
 

Variables

template<typename T >
constexpr bool kamping::types::is_builtin_type_v = builtin_type<T>::value
 Helper variable template for builtin_type.
 
template<typename T >
static constexpr bool kamping::types::has_auto_dispatched_type_v
 Whether the type is handled by the auto-dispatcher kamping::types::type_dispatcher().
 
template<typename T >
static constexpr bool kamping::types::has_static_type_v = has_static_type<T>::value
 true if kamping::types::mpi_type_traits provides a data_type() function.
 

Detailed Description

Standalone module for mapping C++ types to MPI datatypes.

Provides type_dispatcher, mpi_type_traits, contiguous_type, struct_type, ScopedDatatype, and kabool.

Can be consumed independently of the KaMPIng communicator via the kamping::types CMake target.

See kamping-types for the full standalone documentation including CMake setup, type dispatch rules, and custom type extension examples.

Function Documentation

◆ type_dispatcher()

template<typename T >
auto kamping::types::type_dispatcher ( )

Maps a C++ type T to a type trait for constructing an MPI_Datatype.

C++ type Result
MPI builtin (int, double, …, kabool) builtin_type<T>
Enum dispatches to type_dispatcher<underlying_type>()
T[N], std::array<T, N> contiguous_type<T, N>
Everything else internal::no_matching_type

Specialize kamping::types::mpi_type_traits to handle additional types.

Returns
The corresponding type trait for the type T.

Variable Documentation

◆ has_auto_dispatched_type_v

template<typename T >
constexpr bool kamping::types::has_auto_dispatched_type_v
staticconstexpr
Initial value:
=
!std::is_same_v<decltype(type_dispatcher<T>()), kamping::internal::no_matching_type>
Type tag for indicating that no static type definition exists for a type.
Definition type_helpers.hpp:52

Whether the type is handled by the auto-dispatcher kamping::types::type_dispatcher().