23#include "openPMD/config.hpp"
25#include "openPMD/auxiliary/TypeTraits.hpp"
36namespace openPMD::auxiliary
43 constexpr MPI_Datatype openPMD_MPI_type()
45 using T_decay = std::decay_t<T>;
46 if constexpr (std::is_same_v<T_decay, char>)
50 else if constexpr (std::is_same_v<T_decay, signed char>)
52 return MPI_SIGNED_CHAR;
54 else if constexpr (std::is_same_v<T_decay, unsigned char>)
56 return MPI_UNSIGNED_CHAR;
58 else if constexpr (std::is_same_v<T_decay, short>)
62 else if constexpr (std::is_same_v<T_decay, short unsigned>)
64 return MPI_UNSIGNED_SHORT;
66 else if constexpr (std::is_same_v<T_decay, unsigned>)
70 else if constexpr (std::is_same_v<T_decay, int>)
74 else if constexpr (std::is_same_v<T_decay, long>)
78 else if constexpr (std::is_same_v<T_decay, long long>)
82 else if constexpr (std::is_same_v<T_decay, unsigned long>)
84 return MPI_UNSIGNED_LONG;
86 else if constexpr (std::is_same_v<T_decay, unsigned long long>)
88 return MPI_UNSIGNED_LONG_LONG;
90 else if constexpr (std::is_same_v<T_decay, float>)
94 else if constexpr (std::is_same_v<T_decay, double>)
98 else if constexpr (std::is_same_v<T_decay, long double>)
100 return MPI_LONG_DOUBLE;
105 dependent_false_v<T>,
"openPMD_MPI_type: Unsupported type.");
120 std::vector<char> char_buffer;
121 size_t line_length = 0;
122 size_t num_lines = 0;
143 MPI_Comm communicator,
int destRank, std::string
const &thisRankString);
155std::vector<std::string> distributeStringsToAllRanks(
156 MPI_Comm communicator, std::string
const &thisRankString);
Multiple variable-length strings represented in one single buffer with a fixed line width.
Definition Mpi.hpp:119