#1032: change HDF5's file open options to close all sub-file objects when a file is closed --------------------------+------------------------------------------------- Reporter: rhaas | Owner: eschnett Type: enhancement | Status: new Priority: minor | Milestone: Component: Carpet | Version: Keywords: CarpetIOHDF5 | --------------------------+------------------------------------------------- this is strictly speaking not necessary, since any need for it is caused by a HDF5 object leak. On the other hand it does not hurt either additionally one could overload H5Fclose and warn the user when there are still open objects when a file is closed, ie: {{{ ////////////////////////////////////////////////////////////////////////////// // Close HDF5 file checking for leaked objects ////////////////////////////////////////////////////////////////////////////// static herr_t H5Fclose (hid_t file) { DECLARE_CCTK_PARAMETERS;
herr_t retval; int error_count = 0;
hsize_t objectcount; HDF5_ERROR (objectcount = H5Fget_obj_count(file, H5F_OBJ_ALL | H5F_OBJ_LOCAL)); if (objectcount > 1) { std::vector<char> fn; hsize_t sz_fn;
HDF5_ERROR (sz_fn = H5Fget_name(file, NULL, 0)); fn.resize(sz_fn+1); HDF5_ERROR (H5Fget_name(file, &fn[0], fn.size()));
CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING, "%d open HDF5 objects when closing file '%s'", int(objectcount)-1, &fn[0]); } HDF5_ERROR (retval = ::H5Fclose (file));
return retval; } }}}
#1032: change HDF5's file open options to close all sub-file objects when a file is closed --------------------------+------------------------------------------------- Reporter: rhaas | Owner: eschnett Type: enhancement | Status: review Priority: minor | Milestone: Component: Carpet | Version: Resolution: | Keywords: CarpetIOHDF5 --------------------------+------------------------------------------------- Changes (by rhaas):
* status: new => review
#1032: change HDF5's file open options to close all sub-file objects when a file is closed --------------------------+------------------------------------------------- Reporter: rhaas | Owner: eschnett Type: enhancement | Status: reviewed_ok Priority: minor | Milestone: Component: Carpet | Version: Resolution: | Keywords: CarpetIOHDF5 --------------------------+------------------------------------------------- Changes (by eschnett):
* status: review => reviewed_ok
Comment:
I assume this will help reduce memory usage for HDF5. Please apply.
#1032: change HDF5's file open options to close all sub-file objects when a file is closed --------------------------+------------------------------------------------- Reporter: rhaas | Owner: eschnett Type: enhancement | Status: closed Priority: minor | Milestone: Component: Carpet | Version: Resolution: fixed | Keywords: CarpetIOHDF5 --------------------------+------------------------------------------------- Changes (by rhaas):
* status: reviewed_ok => closed * resolution: => fixed
Comment:
I applied the patch (but not the overloaded HDF5 close function) as Carpet hash f0dc71726af0 "CarpetIOHDF5: close all HDF5 objects when closing a file".
trac@lists.einsteintoolkit.org