22 using namespace std::string_literals;
26 std::filesystem::path
const& basic_filepath,
int const file_group)
28 std::string
const filename = (file_group > 0)
29 ? basic_filepath.stem().string() +
"_"s +
30 std::to_string(file_group) +
31 basic_filepath.extension().string()
32 : basic_filepath.filename().string();
33 std::filesystem::path
const filepathwithextension =
34 basic_filepath.parent_path() / filename;
35 DBUG(
"HDF Filepath: {:s}.", filepathwithextension.string());
36 return filepathwithextension;
40 unsigned int const n_files)
43 MPI_Comm
const comm = communicator.mpi_communicator;
44 MPI_Info
const info = MPI_INFO_NULL;
45 hid_t
const plist_id = H5Pcreate(H5P_FILE_ACCESS);
47 H5Pset_fapl_mpio(plist_id, comm, info);
48 std::filesystem::path
const partition_filename =
50 hid_t file = H5Fcreate(partition_filename.string().c_str(), H5F_ACC_TRUNC,
51 H5P_DEFAULT, plist_id);
58 unsigned int const n_files)
61 MPI_Info info = MPI_INFO_NULL;
62 hid_t
const plist_id = H5Pcreate(H5P_FILE_ACCESS);
63 H5Pset_fapl_mpio(plist_id, comm, info);
64 hid_t file = H5Fopen(filepath.string().c_str(), H5F_ACC_RDWR, plist_id);
72 hid_t io_transfer_property = H5Pcreate(H5P_DATASET_XFER);
73 H5Pset_dxpl_mpio(io_transfer_property, H5FD_MPIO_COLLECTIVE);
74 return io_transfer_property;
void DBUG(char const *fmt, Args const &... args)
Dispatches HDF5 functions specific to execution platform (w/o MPI). There are multiple implementation...
Assigns to each MPI communicator an output file name by attribute color There are multiple implementa...
std::filesystem::path partitionFilename(std::filesystem::path const &basic_filepath, int const file_group)
FileCommunicator getCommunicator(unsigned int const n_files)
int64_t openHDF5File(std::filesystem::path const &filepath)
int64_t createHDF5TransferPolicy()
int64_t createFile(std::filesystem::path const &filepath, unsigned int n_files)
MPI_Comm mpi_communicator