51{
53
54 auto const& partition_info =
56 auto const& offset_partitioned_dim = partition_info.local_offset;
57 offsets = {offset_partitioned_dim, 0};
58
59 std::size_t const unified_length = partition_info.local_length;
60 int const type_size = H5Tget_size(
data_type);
61 std::size_t const space =
62 (chunk_size_bytes > 0)
63 ? std::min(std::size_t(std::lround(float(chunk_size_bytes) /
64 (size_tuple * type_size) +
65 0.5)),
66 partition_info.global_length)
67 : partition_info.longest_local_length;
68
69 if (chunk_size_bytes > 0 && space == partition_info.global_length)
70 {
71 INFO(
"HDF5: Using a single chunk for dataset {:s} .",
name);
72 }
73
74 chunk_space = (size_tuple > 1) ? std::vector<Hdf5DimType>{space, size_tuple}
75 : std::vector<Hdf5DimType>{space};
76
78 ? std::vector<Hdf5DimType>{unified_length, size_tuple}
79 : std::vector<Hdf5DimType>{unified_length};
81 (size_tuple > 1)
82 ? std::vector<Hdf5DimType>{partition_info.global_length, size_tuple}
83 : std::vector<Hdf5DimType>{partition_info.global_length};
84
86 "HDF: dataset name: {:s}, offset: {:d}, data_space: {:d}, chunk_space "
87 "{:d}, file_space: {:d}, tuples: {:d}",
90}
void INFO(fmt::format_string< Args... > fmt, Args &&... args)
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
static hid_t meshPropertyType2HdfType(MeshPropertyDataType const ogs_data_type)
PartitionInfo getPartitionInfo(std::size_t const size, unsigned int const n_files)
std::vector< Hdf5DimType > file_space
std::vector< Hdf5DimType > offsets
std::vector< Hdf5DimType > chunk_space
std::vector< Hdf5DimType > data_space