24#include "kamping/kassert/kassert.hpp"
39using internal::no_matching_type;
50 if constexpr (types::has_auto_dispatched_type_v<T>) {
51 return types::type_dispatcher<T>();
52 }
else if constexpr (std::is_trivially_copyable_v<T_no_const>) {
70template <
typename T,
typename Enable =
void>
89template <
typename,
typename Enable =
void>
111 mpi_env.register_mpi_type(type);
125 "\n --> Type not supported directly by KaMPIng. Please provide a specialization for mpi_type_traits."
143 template <
typename T>
147 template <
typename T>
154using types::builtin_type;
155using types::byte_serialized;
158using types::kamping_tag;
159using types::ScopedDatatype;
160using types::type_dispatcher_lookup;
166template <
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:48
static constexpr bool has_static_type_v
true if kamping::mpi_type_traits provides a data_type() function.
Definition mpi_datatype.hpp:98
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:122
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:62
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:107
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:69
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:90
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:141
static MPI_Datatype get()
Returns the MPI_Datatype for T.
Definition mpi_datatype.hpp:148
static constexpr bool has_type_v
true if KaMPIng can resolve an MPI_Datatype for T.
Definition mpi_datatype.hpp:144
static MPI_Datatype data_type()
The MPI_Datatype corresponding to the type T.
Definition mpi_datatype.hpp:83
The type trait that maps a C++ type T to an MPI_Datatype for full KaMPIng.
Definition mpi_datatype.hpp:71
Constructs a type serialized as a sequence of sizeof(T) bytes using MPI_BYTE.
Definition contiguous_type_fwd.hpp:48
Constructs a contiguous MPI type of N elements of type T using MPI_Type_contiguous.
Definition contiguous_type_fwd.hpp:39
Constructs an MPI_Datatype for a struct-like type.
Definition struct_type.hpp:52
Internal type helpers for the kamping-types module.