49 for (
const auto &
s : labels) {
60 bool desc,
bool formulas)
61 : fname(file), timeChunk(chunking),
62 enableDescriptions(desc), enableFormula(formulas),
68 H5::Exception::dontPrint();
81 dumpCount > 0 ? H5F_ACC_RDWR : H5F_ACC_TRUNC);
110 }
catch (
const H5::FileIException&
e) {
112 }
catch (
const H5::GroupIException&
e) {
122 assert(!
path.empty());
132 hsize_t fdims[1] = { 0, };
147 warn_once(
"HDF5 stat files don't support distributions.\n");
153 warn_once(
"HDF5 stat files don't support vector distributions.\n");
162 hsize_t fdims[3] = { 0, info.
x, info.
y };
163 H5::DataSet data_set =
appendStat(info, 3, fdims, info.
cvec.data());
192 warn_once(
"HDF5 stat files don't support sparse histograms.\n");
202 hsize_t fdims[2] = { 0, vr.size() };
203 H5::DataSet data_set =
appendStat(info, 2, fdims, vr.data());
219 H5::Group group =
path.top();
220 H5::DataSet data_set;
221 H5::DataSpace fspace;
228 data_set = group.openDataSet(info.
name);
229 data_set.extend(dims);
230 fspace = data_set.getSpace();
234 H5::DSetCreatPropList props;
238 std::copy(dims, dims + rank, max_dims.begin());
239 max_dims[0] = H5S_UNLIMITED;
243 std::copy(dims, dims + rank, chunk_dims.begin());
245 props.setChunk(rank, chunk_dims.data());
250 fspace = H5::DataSpace(rank, dims, max_dims.data());
251 data_set = group.createDataSet(info.
name, H5::PredType::NATIVE_DOUBLE,
261 H5::DataSpace mspace(rank, dims);
265 fspace.selectHyperslab(H5S_SELECT_SET, dims, foffset.data());
266 data_set.write(
data, H5::PredType::NATIVE_DOUBLE, mspace, fspace);
275 H5::StrType
type(H5::PredType::C_S1, H5T_VARIABLE);
276 hsize_t dims[1] = { values.size(), };
277 H5::DataSpace space(1, dims);
278 H5::Attribute attribute = loc.createAttribute(
name,
type, space);
279 attribute.write(
type, values.data());
287 for (
int i = 0;
i < values.size(); ++
i)
288 cstrs[
i] = values[
i].c_str();
295 const std::string &value)
297 H5::StrType
type(H5::PredType::C_S1, value.length() + 1);
298 hsize_t dims[1] = { 1, };
299 H5::DataSpace space(1, dims);
300 H5::Attribute attribute = loc.createAttribute(
name,
type, space);
301 attribute.write(
type, value.c_str());
307 hsize_t dims[1] = { 1, };
308 H5::DataSpace space(1, dims);
309 H5::Attribute attribute = loc.createAttribute(
310 name, H5::PredType::NATIVE_DOUBLE, space);
311 attribute.write(H5::PredType::NATIVE_DOUBLE, &value);
315 std::unique_ptr<Output>
316 initHDF5(
const std::string &filename,
unsigned chunking,
317 bool desc,
bool formulas)
319 return std::unique_ptr<Output>(