24namespace kamping::types {
47template <
typename T,
typename Lookup = type_dispatcher_lookup>
52 !std::is_pointer_v<T_no_const>,
53 "MPI does not support pointer types. Why do you want to transfer a pointer over MPI?"
55 static_assert(!std::is_function_v<T_no_const>,
"MPI does not support function types.");
56 static_assert(!std::is_union_v<T_no_const>,
"MPI does not support union types.");
57 static_assert(!std::is_void_v<T_no_const>,
"There is no MPI datatype corresponding to void.");
61 }
else if constexpr (std::is_enum_v<T_no_const>) {
63 }
else if constexpr (std::is_array_v<T_no_const>) {
79template <
typename T,
typename Lookup = type_dispatcher_lookup>
88template <
typename T,
typename Enable =
void>
108template <
typename,
typename Enable =
void>
127 template <
typename T>
131 template <
typename T>
STL-compatible allocator for requesting memory using the builtin MPI allocator.
Definition allocator.hpp:32
Forward declarations for contiguous_type and byte_serialized to break include cycles.
static constexpr bool has_auto_dispatched_type_v
Whether the type is handled by the auto-dispatcher kamping::types::type_dispatcher().
Definition mpi_type_traits.hpp:80
TypeCategory
Type groups as defined in Section 6.9.2 of the MPI 4.0 standard.
Definition builtin_types.hpp:32
static constexpr bool has_static_type_v
true if kamping::types::mpi_type_traits provides a data_type() function.
Definition mpi_type_traits.hpp:117
constexpr bool category_has_to_be_committed(TypeCategory category)
Returns whether an MPI_Datatype of the given category must be committed before use.
Definition builtin_types.hpp:35
auto type_dispatcher()
Maps a C++ type T to a type trait for constructing an MPI_Datatype.
Definition mpi_type_traits.hpp:48
Mapping of C++ datatypes to builtin MPI types.
Helper to check if a type is a std::array.
Definition type_helpers.hpp:42
Type tag for indicating that no static type definition exists for a type.
Definition type_helpers.hpp:52
Constructs a contiguous MPI type of N elements of type T using MPI_Type_contiguous.
Definition contiguous_type_fwd.hpp:39
Check if the type has a static type definition, i.e. kamping::types::mpi_type_traits is defined.
Definition mpi_type_traits.hpp:109
static MPI_Datatype data_type()
The MPI_Datatype corresponding to the type T.
Definition mpi_type_traits.hpp:102
The type trait that maps a C++ type T to an MPI_Datatype for the kamping-types module.
Definition mpi_type_traits.hpp:89
Default lookup policy for contiguous_type and struct_type.
Definition mpi_type_traits.hpp:125
static constexpr bool has_type_v
true if the Lookup can resolve an MPI_Datatype for T.
Definition mpi_type_traits.hpp:128
static MPI_Datatype get()
Returns the MPI_Datatype for T.
Definition mpi_type_traits.hpp:132
Internal type helpers for the kamping-types module.