Metall  v0.28
A persistent memory allocator for data-centric analytics
metall_mpi_datastore.hpp
Go to the documentation of this file.
1 // Copyright 2020 Lawrence Livermore National Security, LLC and other Metall
2 // Project Developers. See the top-level COPYRIGHT file for details.
3 //
4 // SPDX-License-Identifier: (Apache-2.0 OR MIT)
5 
6 #ifndef METALL_UTILITY_METALL_MPI_DATASTORE_HPP
7 #define METALL_UTILITY_METALL_MPI_DATASTORE_HPP
8 
9 #include <string>
10 
14 
19 inline std::string make_root_dir_path(const std::string &root_dir_prefix) {
20  return root_dir_prefix + "/";
21 }
22 
29 inline std::string make_local_dir_path(const std::string &root_dir_prefix,
30  const int rank) {
31  return make_root_dir_path(root_dir_prefix) + "/subdir-" +
32  std::to_string(rank);
33 }
34 
35 } // namespace metall::utility::mpi_datastore
36 
37 #endif // METALL_UTILITY_METALL_MPI_DATASTORE_HPP
basic_string< char > string
A string container that uses char as its character type and Metall as its default allocator.
Definition: string.hpp:23
Namespace for MPI datastore.
std::string make_root_dir_path(const std::string &root_dir_prefix)
Makes a path of a root directory. The MPI ranks that share the same storage space create their data s...
Definition: metall_mpi_datastore.hpp:19
std::string make_local_dir_path(const std::string &root_dir_prefix, const int rank)
Makes the data store path of a MPI rank.
Definition: metall_mpi_datastore.hpp:29