24 std::map<MeshPropertyDataType const, hid_t> ogs_to_hdf_type = {
35 return ogs_to_hdf_type.at(ogs_data_type);
37 catch (std::exception
const& e)
39 OGS_FATAL(
"No known HDF5 type for OGS type. {:s}", e.what());
44 std::size_t
const size_tuple, std::string
const&
name,
46 unsigned int const n_files)
49 auto const& partition_info =
51 auto const& offset_partitioned_dim = partition_info.local_offset;
52 offsets = {offset_partitioned_dim, 0};
54 std::size_t unified_length = partition_info.local_length;
58 ? std::vector<Hdf5DimType>{partition_info.longest_local_length,
60 : std::vector<Hdf5DimType>{partition_info.longest_local_length};
63 ? std::vector<Hdf5DimType>{unified_length, size_tuple}
64 : std::vector<Hdf5DimType>{unified_length};
67 ? std::vector<Hdf5DimType>{partition_info.global_length, size_tuple}
68 : std::vector<Hdf5DimType>{partition_info.global_length};
73 "HDF: dataset name: {:s}, offset: {:d}, data_space: {:d}, chunk_space "
74 "{:d}, file_space: {:d}, tuples: {:d}",
Collects and holds all metadata for writing HDF5 file.
void DBUG(char const *fmt, Args const &... args)
static hid_t meshPropertyType2HdfType(MeshPropertyDataType const ogs_data_type)
PartitionInfo getPartitionInfo(std::size_t const size, unsigned int const n_files)
Dispatches functions specific to execution platform (w/o MPI)
std::vector< Hdf5DimType > file_space
std::vector< Hdf5DimType > offsets
std::vector< Hdf5DimType > chunk_space
std::vector< Hdf5DimType > data_space
HdfData(void const *data_start, std::size_t size_partitioned_dim, std::size_t size_tuple, std::string const &name, MeshPropertyDataType mesh_property_data_type, unsigned int n_files)