19 std::set<std::string> inserted;
20 H5::CompType
type(fillers.size() *
sizeof(data_buffer_t));
22 for (
const auto& filler: fillers) {
23 const std::string&
name = filler->name();
24 if (inserted.count(name)) {
25 throw std::logic_error(name +
" inserted twice");
27 inserted.insert(name);
28 type.insertMember(filler->name(), dt_offset, filler->get_type());
29 dt_offset +=
sizeof(data_buffer_t);
35 const std::vector<hsize_t>& extent,
37 H5::DSetCreatPropList
params;
39 chunk_size.insert(chunk_size.end(), extent.begin(), extent.end());
40 params.setChunk(chunk_size.size(), chunk_size.data());
53 std::vector<hsize_t> max_length,
55 m_type(build_type(fillers)),
63 throw std::logic_error(
"batch size must be > 0");
69 H5::DSetCreatPropList params = getChunckedDatasetParams(
70 max_length, batch_size);
83 }
catch (H5::Exception& err) {
85 }
catch (std::exception& err) {
98 std::vector<internal::data_buffer_t> temp;
100 std::fill(indices.begin(), indices.end(), 0);
101 for (
size_t gidx = 0; gidx <
m_dim_stride.front(); gidx++) {
104 for (
size_t iii = 0; iii < indices.size(); iii++) {
110 temp.push_back(filler->get_buffer());
122 m_ds.extend(total_dims.data());
125 H5::DataSpace file_space =
m_ds.getSpace();
126 H5::DataSpace mem_space(slab_dims.size(), slab_dims.data());
127 std::vector<hsize_t> offset_dims{
m_offset};
128 offset_dims.resize(slab_dims.size(), 0);
129 file_space.selectHyperslab(H5S_SELECT_SET,
130 slab_dims.data(), offset_dims.data());
133 assert(
static_cast<size_t>(file_space.getSelectNpoints())
void fillWhileIncrementing(std::vector< size_t > &indices)
VariableFillers m_fillers
WriterXd(H5::Group &group, const std::string &name, VariableFillers fillers, std::vector< hsize_t > dataset_dimensions, hsize_t chunk_size=2048)
std::vector< hsize_t > m_dim_stride
hsize_t buffer_size() const
std::vector< hsize_t > m_max_length
std::vector< internal::data_buffer_t > m_buffer
H5::CompType packed(H5::CompType in)
H5::DSetCreatPropList getChunckedDatasetParams(const WriterConfiguration< N > &)
std::vector< hsize_t > getStriding(std::vector< hsize_t > max_length)
H5::DataSpace getUnlimitedSpace(const std::vector< hsize_t > &max_length)
void printDestructorError(const std::string &msg)
void throwIfExists(const std::string &name, const H5::Group &in_group)