Skip to content

Commit e8a1df6

Browse files
committed
Rename MpiArchive to mpi_archive
1 parent 9394743 commit e8a1df6

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

c++/mpi/datatypes.hpp

+7-6
Original file line numberDiff line numberDiff line change
@@ -181,20 +181,21 @@ namespace mpi {
181181
};
182182

183183
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 {
186187
std::vector<int> block_lengths{};
187188
std::vector<MPI_Aint> displacements{};
188189
std::vector<MPI_Datatype> types{};
189190
MPI_Aint base_address{};
190191

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); }
193194

194195
// Overloaded operator& to process members to set the block lengths, displacements and MPI types.
195196
template <typename T>
196197
requires(has_mpi_type<T>)
197-
MpiArchive &operator&(const T &member) {
198+
mpi_archive &operator&(const T &member) {
198199
types.push_back(mpi_type<T>::get());
199200
MPI_Aint address{};
200201
MPI_Get_address(&member, &address);
@@ -224,7 +225,7 @@ namespace mpi {
224225
* @tparam T Type to be converted to an `MPI_Datatype`.
225226
*/
226227
template <Serializable T> [[nodiscard]] MPI_Datatype get_mpi_type(const T &obj) {
227-
detail::MpiArchive ar(&obj);
228+
detail::mpi_archive ar(&obj);
228229
obj.serialize(ar);
229230
MPI_Datatype mpi_type{};
230231
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

Comments
 (0)