@@ -181,20 +181,21 @@ namespace mpi {
181
181
};
182
182
183
183
namespace detail {
184
- // Archive helper class obtain MPI custom type info using reference to class members
185
- struct MpiArchive {
184
+
185
+ // Archive helper class to obtain MPI custom type info using references to class members.
186
+ struct mpi_archive {
186
187
std::vector<int > block_lengths{};
187
188
std::vector<MPI_Aint> displacements{};
188
189
std::vector<MPI_Datatype> types{};
189
190
MPI_Aint base_address{};
190
191
191
- public:
192
- explicit MpiArchive (const void *base) { MPI_Get_address (base, &base_address); }
192
+ // Constructor sets the base address of the object.
193
+ explicit mpi_archive (const void *base) { MPI_Get_address (base, &base_address); }
193
194
194
195
// Overloaded operator& to process members to set the block lengths, displacements and MPI types.
195
196
template <typename T>
196
197
requires (has_mpi_type<T>)
197
- MpiArchive &operator &(const T &member) {
198
+ mpi_archive &operator &(const T &member) {
198
199
types.push_back (mpi_type<T>::get ());
199
200
MPI_Aint address{};
200
201
MPI_Get_address (&member, &address);
@@ -224,7 +225,7 @@ namespace mpi {
224
225
* @tparam T Type to be converted to an `MPI_Datatype`.
225
226
*/
226
227
template <Serializable T> [[nodiscard]] MPI_Datatype get_mpi_type (const T &obj) {
227
- detail::MpiArchive ar (&obj);
228
+ detail::mpi_archive ar (&obj);
228
229
obj.serialize (ar);
229
230
MPI_Datatype mpi_type{};
230
231
MPI_Type_create_struct (static_cast <int >(ar.block_lengths .size ()), ar.block_lengths .data (), ar.displacements .data (), ar.types .data (), &mpi_type);
0 commit comments