Function utils::overwriteULongAttr
Defined in File HDF5Utils.hpp
Function Documentation
-
void utils::overwriteULongAttr(hid_t loc, const std::string &name, unsigned long value)
Overwrite an already-existing scalar unsigned long attribute.
Unlike writeULongAttr(), which creates a brand-new attribute (and fails if one of that name already exists), this opens and rewrites one already written by an earlier writeULongAttr() call – used by OutputManagerH5::syncCheckpoints() to replace a rank-local trials_completed/max_trial value, already written by closeOutputFile(), with the run-wide value summed/maxed across every rank.
- Parameters:
loc – Handle to the object (a group, dataset, or file) the attribute is attached to
name – Name of the attribute
value – New value of the attribute
- Throws:
std::runtime_error – if the attribute does not already exist or cannot be opened