5#ifndef IPPL_MPI_DATATYPES_H
6#define IPPL_MPI_DATATYPES_H
13#include <unordered_map>
20 static std::unordered_map<std::type_index, MPI_Datatype>
type_names = {
21 {std::type_index(
typeid(std::int8_t)), MPI_INT8_T},
22 {std::type_index(
typeid(std::int16_t)), MPI_INT16_T},
23 {std::type_index(
typeid(std::int32_t)), MPI_INT32_T},
24 {std::type_index(
typeid(std::int64_t)), MPI_INT64_T},
26 {std::type_index(
typeid(std::uint8_t)), MPI_UINT8_T},
27 {std::type_index(
typeid(std::uint16_t)), MPI_UINT16_T},
28 {std::type_index(
typeid(std::uint32_t)), MPI_UINT32_T},
29 {std::type_index(
typeid(std::uint64_t)), MPI_UINT64_T},
31 {std::type_index(
typeid(
char)), MPI_CHAR},
32 {std::type_index(
typeid(
short)), MPI_SHORT},
33 {std::type_index(
typeid(
int)), MPI_INT},
34 {std::type_index(
typeid(
long)), MPI_LONG},
35 {std::type_index(
typeid(
long long)), MPI_LONG_LONG_INT},
37 {std::type_index(
typeid(
unsigned char)), MPI_UNSIGNED_CHAR},
38 {std::type_index(
typeid(
unsigned short)), MPI_UNSIGNED_SHORT},
39 {std::type_index(
typeid(
unsigned int)), MPI_UNSIGNED},
40 {std::type_index(
typeid(
unsigned long)), MPI_UNSIGNED_LONG},
41 {std::type_index(
typeid(
unsigned long long)), MPI_UNSIGNED_LONG_LONG},
43 {std::type_index(
typeid(
float)), MPI_FLOAT},
44 {std::type_index(
typeid(
double)), MPI_DOUBLE},
45 {std::type_index(
typeid(
long double)), MPI_LONG_DOUBLE},
47 {std::type_index(
typeid(
bool)), MPI_CXX_BOOL},
49 {std::type_index(
typeid(std::complex<float>)), MPI_CXX_FLOAT_COMPLEX},
50 {std::type_index(
typeid(std::complex<double>)), MPI_CXX_DOUBLE_COMPLEX},
51 {std::type_index(
typeid(std::complex<long double>)), MPI_CXX_LONG_DOUBLE_COMPLEX},
53 {std::type_index(
typeid(Kokkos::complex<double>)), MPI_CXX_FLOAT_COMPLEX},
54 {std::type_index(
typeid(Kokkos::complex<float>)), MPI_CXX_FLOAT_COMPLEX}};
58 constexpr static unsigned Dim = 0;
60 template <
typename T,
unsigned Dim_>
62 constexpr static unsigned Dim = Dim_;
66 MPI_Datatype type = MPI_BYTE;
72 get_mpi_datatype<typename T::value_type>(
typename T::value_type{}), &tp);
80 throw IpplException(
"ippl::mpi::get_mpi_datatype",
"No such type available.");
PartBunch< T, Dim >::ConstIterator end(PartBunch< T, Dim > const &bunch)
const T * find(const T table[], const std::string &name)
Look up name.
Implementations for FFT constructor/destructor and transforms.
MPI_Datatype get_mpi_datatype(const T &)
static std::unordered_map< std::type_index, MPI_Datatype > type_names
static constexpr unsigned Dim