HDF5: Use strong file close FAPL

This commit is contained in:
2026-05-05 16:04:35 +02:00
parent aa21786005
commit cae8577c85
2 changed files with 7 additions and 0 deletions
+6
View File
@@ -348,6 +348,10 @@ void HDF5Fapl::SetVersionTo1p10orNewer() {
H5Pset_libver_bounds(id, H5F_LIBVER_V110, H5F_LIBVER_LATEST);
}
void HDF5Fapl::SetCloseStrong() {
H5Pset_fclose_degree(id, H5F_CLOSE_STRONG);
}
template <typename T>
static HDF5Object& WriteOrCreateScalarAttr(HDF5Object& object, const std::string& name, const T& val) {
HDF5DataSpace dataspace(HDF5DataSpace::Scalar);
@@ -731,6 +735,8 @@ HDF5File::HDF5File(const std::string& filename, bool v1_10) : HDF5Object() {
if (v1_10)
fapl.SetVersionTo1p10orNewer();
fapl.SetCloseStrong();
id = H5Fcreate(filename.c_str(), H5F_ACC_TRUNC, H5P_DEFAULT, fapl.GetID());
if (id < 0)
throw JFJochException(JFJochExceptionCategory::HDF5, "Cannot open/create data HDF5 file " + filename);
+1
View File
@@ -123,6 +123,7 @@ public:
HDF5Fapl();
~HDF5Fapl();
void SetVersionTo1p10orNewer();
void SetCloseStrong();
};
class HDF5Object : public HDF5Id {