23 explicit Datatype(MPI_Datatype type) noexcept : type_(type) {}
41 MPI_Datatype get()
const noexcept {
42 return mpi_active() ? type_ : MPI_DATATYPE_NULL;
46 operator MPI_Datatype()
const noexcept {
return get(); }
48 explicit operator bool()
const noexcept {
return get() != MPI_DATATYPE_NULL; }
51 MPI_Datatype release()
noexcept;
57 void get_extent(MPI_Aint* lb, MPI_Aint* extent)
const;
58 void get_true_extent(MPI_Aint* true_lb, MPI_Aint* true_extent)
const;
61 bool is_builtin()
const noexcept;
69 static Datatype contiguous(
int count, MPI_Datatype oldtype);
73 int count,
int blocklength,
int stride, MPI_Datatype oldtype
78 int count,
int blocklength, MPI_Aint stride, MPI_Datatype oldtype
83 int count,
const int* array_of_blocklengths,
84 const int* array_of_displacements, MPI_Datatype oldtype
89 int count,
const int* array_of_blocklengths,
90 const MPI_Aint* array_of_displacements, MPI_Datatype oldtype
95 int count,
int blocklength,
const int* array_of_displacements,
101 int count,
int blocklength,
const MPI_Aint* array_of_displacements,
107 int count,
const int* array_of_blocklengths,
108 const MPI_Aint* array_of_displacements,
const MPI_Datatype* array_of_types
113 int ndims,
const int* array_of_sizes,
const int* array_of_subsizes,
114 const int* array_of_starts,
int order, MPI_Datatype oldtype
119 int size,
int rank,
int ndims,
const int* array_of_gsizes,
120 const int* array_of_distribs,
const int* array_of_dargs,
121 const int* array_of_psizes,
int order, MPI_Datatype oldtype
125 static Datatype resized(MPI_Datatype oldtype, MPI_Aint lb, MPI_Aint extent);
128 static Datatype dup(MPI_Datatype oldtype);
134 std::vector<uint8_t> serialize()
const;
138 static Datatype deserialize(
const std::vector<uint8_t>& buffer);
139 static Datatype deserialize(
const uint8_t* data,
size_t size);
142 MPI_Datatype type_ = MPI_DATATYPE_NULL;
145 static bool is_builtin_type(MPI_Datatype type)
noexcept;
149 static TypeInfo introspect(MPI_Datatype type);
150 static void serialize_recursive(
151 MPI_Datatype type, std::vector<uint8_t>& buffer
153 static Datatype deserialize_recursive(
154 const uint8_t*& ptr,
const uint8_t* end