24#include "kamping/kassert/kassert.hpp"
39using internal::no_matching_type;
57 if constexpr (types::has_auto_dispatched_type_v<T, kamping_lookup>) {
58 return types::type_dispatcher<T, kamping_lookup>();
59 }
else if constexpr (std::is_trivially_copyable_v<T_no_const>) {
77template <
typename T,
typename Enable =
void>
96template <
typename,
typename Enable =
void>
118 mpi_env.register_mpi_type(type);
132 "\n --> Type not supported directly by KaMPIng. Please provide a specialization for mpi_type_traits."
150 template <
typename T>
154 template <
typename T>
161using types::builtin_type;
162using types::byte_serialized;
165using types::kamping_tag;
166using types::ScopedDatatype;
167using types::type_dispatcher_lookup;
173template <
typename T,
size_t N>
STL-compatible allocator for requesting memory using the builtin MPI allocator.
Definition allocator.hpp:32
MPI_Type_contiguous implementation for kamping::types::contiguous_type and kamping::types::byte_seria...
Wrapper for MPI functions that don't require a communicator.
Environment< InitMPIMode::NoInitFinalize > const mpi_env
A global environment object to use when you don't want to create a new Environment object.
Definition environment.hpp:343
auto type_dispatcher()
Maps a C++ type T to a type trait for constructing an MPI_Datatype.
Definition mpi_datatype.hpp:55
static constexpr bool has_static_type_v
true if kamping::mpi_type_traits provides a data_type() function.
Definition mpi_datatype.hpp:105
MPI_Datatype mpi_datatype() KAMPING_NOEXCEPT
Translate type T to an MPI_Datatype using the type defined via mpi_type_traits.
Definition mpi_datatype.hpp:129
static constexpr bool has_auto_dispatched_type_v
Whether the type is handled by the auto-dispatcher type_dispatcher, i.e. whether mpi_type_traits is d...
Definition mpi_datatype.hpp:69
MPI_Datatype construct_and_commit_type()
Register a new MPI_Datatype for T with the MPI environment. It will be freed when the environment is ...
Definition mpi_datatype.hpp:114
TypeCategory
Type groups as defined in Section 6.9.2 of the MPI 4.0 standard.
Definition builtin_types.hpp:32
constexpr bool is_builtin_type_v
Helper variable template for builtin_type.
Definition builtin_types.hpp:70
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
Mapping of C++ datatypes to builtin MPI types.
Type traits and dispatcher for mapping C++ types to MPI datatypes.
Defines the macro KAMPING_NOEXCEPT to be used instad of noexcept.
#define KAMPING_NOEXCEPT
noexcept macro.
Definition noexcept.hpp:19
RAII wrapper that commits an MPI_Datatype on construction and frees it on destruction.
Struct-like MPI type construction via field reflection.
Check if the type has a static type definition, i.e. kamping::mpi_type_traits is defined.
Definition mpi_datatype.hpp:97
Type tag for indicating that no static type definition exists for a type.
Definition type_helpers.hpp:52
Lookup policy for KaMPIng that resolves MPI_Datatypes via kamping::mpi_type_traits.
Definition mpi_datatype.hpp:148
static MPI_Datatype get()
Returns the MPI_Datatype for T.
Definition mpi_datatype.hpp:155
static constexpr bool has_type_v
true if KaMPIng can resolve an MPI_Datatype for T.
Definition mpi_datatype.hpp:151
static MPI_Datatype data_type()
The MPI_Datatype corresponding to the type T.
Definition mpi_datatype.hpp:90
The type trait that maps a C++ type T to an MPI_Datatype for full KaMPIng.
Definition mpi_datatype.hpp:78
Constructs a type serialized as a sequence of sizeof(T) bytes using MPI_BYTE.
Definition contiguous_type_fwd.hpp:49
Constructs a contiguous MPI type of N elements of type T using MPI_Type_contiguous.
Definition contiguous_type_fwd.hpp:40
Constructs an MPI_Datatype for a struct-like type.
Definition struct_type.hpp:52
Internal type helpers for the kamping-types module.