ATLAS Offline Software
common.icc
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "defaults.h"
6 
7 namespace H5Utils {
8  namespace internal {
9  template <size_t N>
10  H5::DSetCreatPropList getChunckedDatasetParams(
11  const WriterConfiguration<N>& cfg) {
12  H5::DSetCreatPropList params;
13  hsize_t batch_size = (
14  cfg.batch_size ? *cfg.batch_size : defaults::batch_size);
15  std::vector<hsize_t> chunk_size{batch_size};
16  if (cfg.chunks) {
17  chunk_size.insert(
18  chunk_size.end(), cfg.chunks->begin(), cfg.chunks->end());
19  } else {
20  chunk_size.insert(
21  chunk_size.end(), cfg.extent.begin(), cfg.extent.end());
22  }
23  params.setChunk(chunk_size.size(), chunk_size.data());
24  if (cfg.deflate) params.setDeflate(*cfg.deflate);
25  return params;
26  }
27  }
28 }