-
-
Notifications
You must be signed in to change notification settings - Fork 268
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
H5Fget_obj_ids/count no longer count copies of transient types #3928
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't call API routines from internal library routines.
src/H5F.c
Outdated
FUNC_ENTER_PACKAGE_NOERR | ||
FUNC_ENTER_PACKAGE | ||
|
||
if ((obj_type = H5Iget_type(obj_id)) < 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a bug and should be corrected. However, the library internal routines should never (with very few exceptions) call API routines. I'll take a look at which internal routines to use later tonight. (If someone else doesn't get to it before me :-) ).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replaced H5Iget_type
-> H5I_get_type
, H5Tcommitted
-> H5I_object_verify
+ H5T_is_named
It seems inconsistent that an object is not considered "technically" open (and thus not counted), yet it can still be closed using the H5Tclose function. Additionally, a copied type should be closed even if not created. This is similar to the debate on whether the objects opened through an external link should be counted, as they are also considered "transient." ref. HDFFV-11231. Regardless, I'm assuming most applications use H5Fget_obj_count to get a count of objects that need to be closed, including H5Tcopy ids. Besides, we currently don't provide a way to detect these types of open objects ( property lists, datatypes, etc...) otherwise, which is another issue. |
This is true - these changes should be paired with some kind of API addition that does return all ids that need to be closed, whether that's a new API call or a new option for these calls. That would be for the next release, since it's definitely an API change. For now, I'll mark this as draft and update the current documentation for |
For now, this work is being moved to the h5f_get_obj_rework feature branch. |
When using
H5Fget_obj_ids
/H5Fget_obj_count
over all files, copies of transient datatypes are considered open object identifiers. Transient datatypes don't exist on any file, don't need to be closed, and the documentation specifically states that only committed datatypes are returned, so this behavior doesn't make sense.The Fortran mounting test previously used copies of transient datatypes to test object counting in mounted files. It now uses groups for that purpose.
This could be considered a change to the behavior of API functions, so I added a note to RELEASE.txt.
Addresses #3316