25 std::filesystem::path
const& basic_filepath,
int const file_group)
27 std::string
const filename = (file_group > 0)
28 ? basic_filepath.stem().string() +
'_' +
29 std::to_string(file_group) +
30 basic_filepath.extension().string()
31 : basic_filepath.filename().string();
32 std::filesystem::path
const filepathwithextension =
33 basic_filepath.parent_path() / filename;
34 DBUG(
"HDF Filepath: {:s}.", filepathwithextension.string());
35 return filepathwithextension;
39 unsigned int const n_files)
42 MPI_Comm
const comm = communicator.mpi_communicator;
43 MPI_Info
const info = MPI_INFO_NULL;
44 hid_t
const plist_id = H5Pcreate(H5P_FILE_ACCESS);
46 H5Pset_fapl_mpio(plist_id, comm, info);
47 H5Pset_coll_metadata_write(plist_id,
true);
49 std::filesystem::path
const partition_filename =
51 hid_t file = H5Fcreate(partition_filename.string().c_str(), H5F_ACC_TRUNC,
52 H5P_DEFAULT, plist_id);
59 unsigned int const n_files)
62 MPI_Info info = MPI_INFO_NULL;
63 hid_t
const plist_id = H5Pcreate(H5P_FILE_ACCESS);
64 H5Pset_fapl_mpio(plist_id, comm, info);
65 hid_t file = H5Fopen(filepath.string().c_str(), H5F_ACC_RDWR, plist_id);
73 hid_t io_transfer_property = H5Pcreate(H5P_DATASET_XFER);
74 H5Pset_dxpl_mpio(io_transfer_property, H5FD_MPIO_COLLECTIVE);
75 return io_transfer_property;
void DBUG(fmt::format_string< Args... > fmt, Args &&... 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 createHDF5TransferPolicy()
int64_t openHDF5File(std::filesystem::path const &filepath, unsigned int n_files)
int64_t createFile(std::filesystem::path const &filepath, unsigned int n_files)
MPI_Comm mpi_communicator