|
ATLAS Offline Software
|
Go to the documentation of this file.
15 bool requireSameFormat,
16 std::size_t bufferSize,
18 m_mergeAxis(mergeAxis),
20 m_requireSameFormat(requireSameFormat),
21 m_bufferSize(bufferSize),
22 m_measureBufferInRows(bufferInRows) {}
31 bool isEmpty =
target.getNumObjs() == 0;
34 for (hsize_t ii = 0; ii <
source.getNumObjs(); ++ii) {
35 H5G_obj_t childType =
source.getObjTypeByIdx(ii);
36 std::string childName =
source.getObjnameByIdx(ii);
38 hsize_t targetIdx = 0;
39 for (; targetIdx <
target.getNumObjs(); ++targetIdx)
40 if (
target.getObjnameByIdx(targetIdx) == childName)
45 if (
target.getObjTypeByIdx(targetIdx) != childType)
46 throw std::invalid_argument(
47 "Both target and source contain " + childName +
48 " but they have different types!");
51 throw std::invalid_argument(
52 "Target and source have different formats!");
59 target.openGroup(childName) :
65 std::cerr <<
"Encountered an error merging child " << childName << std::endl;
72 H5::DataSet
sd =
source.openDataSet(childName);
73 if (
sd.getSpace().getSimpleExtentNdims() == 0) {
74 std::cerr <<
"WARNING: skipping scalar '"
75 << childName <<
"'" << std::endl;
78 H5::DataSet td =
found ?
79 target.openDataSet(childName) :
85 std::cerr <<
"Encountered an error merging child " << childName << std::endl;
100 const H5::DataSet&
source)
107 std::overflow_error(
"Requested buffer would overflow the register!");
114 H5::H5Location& targetLocation,
115 const H5::DataSet&
source)
Group
Properties of a chain group.
hsize_t m_mergeAxis
The axis to merge along.
DefaultMerger(hsize_t mergeAxis=0, int chunkSize=-1, bool requireSameFormat=true, std::size_t bufferSize=-1, bool bufferInRows=false)
Create the merger.
int m_chunkSize
The chunk size to apply.
std::size_t m_bufferSize
The size of the buffer.
void merge(H5::Group &target, const H5::Group &source) override
Merge a source group into a target group.
bool m_requireSameFormat
Whether to require the same group structure.
bool m_measureBufferInRows
Whether to measure the buffer in bytes or rows.
std::size_t getRowSize(const H5::DataSet &ds, hsize_t axis)
Calculate the size of a row of a dataset in bytes.
void mergeDatasets(H5::DataSet &target, const H5::DataSet &source, hsize_t mergeAxis, std::size_t bufferSize=-1)
Merge two datasets.
H5::DataSet createFrom(H5::H5Location &targetLocation, const H5::DataSet &source) override
Make a new dataset from information in a source dataset.
H5::DataSet createDataSet(H5::H5Location &targetLocation, const H5::DataSet &source, hsize_t mergeAxis, int chunkSize=-1, int mergeExtent=-1)
Make a new dataset using the properties of another.