46 std::size_t
const size_tuple, std::string
const& name,
48 unsigned int const n_files,
49 unsigned int const chunk_size_bytes)
50 : data_start(data_start), name(name)
54 auto const& partition_info =
56 auto const& offset_partitioned_dim = partition_info.local_offset;
57 offsets = {offset_partitioned_dim, 0};
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) +
66 partition_info.global_length)
67 : partition_info.longest_local_length;
69 if (chunk_size_bytes > 0 && space == partition_info.global_length)
71 INFO(
"HDF5: Using a single chunk for dataset {:s} .",
name);
74 chunk_space = (size_tuple > 1) ? std::vector<Hdf5DimType>{space, size_tuple}
75 : std::vector<Hdf5DimType>{space};
78 ? std::vector<Hdf5DimType>{unified_length, size_tuple}
79 : std::vector<Hdf5DimType>{unified_length};
82 ? std::vector<Hdf5DimType>{partition_info.global_length, size_tuple}
83 : std::vector<Hdf5DimType>{partition_info.global_length};
86 "HDF: dataset name: {:s}, offset: {:d}, data_space: {:d}, chunk_space "
87 "{:d}, file_space: {:d}, tuples: {:d}",
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, unsigned int chunk_size_bytes)