Skip to content

Group creation properties are not propagated to the intermediate groups #3945

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

Closed
radistmorse opened this issue Jan 19, 2024 · 2 comments · Fixed by #4139
Closed

Group creation properties are not propagated to the intermediate groups #3945

radistmorse opened this issue Jan 19, 2024 · 2 comments · Fixed by #4139
Assignees
Labels
Component - C Library Core C library issues (usually in the src directory) Priority - 1. High These are important issues that should be resolved in the next release
Milestone

Comments

@radistmorse
Copy link

Describe the bug
When creating the group with link property set to create the intermediate groups, one would assume that the group creation properties would be propagated to all the created groups, but it is not so. This is the minimal reproduction example.

#include <assert.h>
#include "hdf5.h"

int main(void)
{
        hid_t linkProps, groupProps, file, group;
        unsigned crOrder;
 
        linkProps = H5Pcreate(H5P_LINK_CREATE);
        groupProps = H5Pcreate(H5P_GROUP_CREATE);
        
        H5Pset_create_intermediate_group(linkProps, 1);
        H5Pset_attr_creation_order(groupProps, H5P_CRT_ORDER_TRACKED);
        
        file = H5Fcreate("test.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
        
        H5Gcreate2(file, "test/test", linkProps, groupProps, H5P_DEFAULT);
        
        group = H5Gopen2(file, "test", H5P_DEFAULT);
        groupProps = H5Gget_create_plist(group);
        H5Pget_attr_creation_order(groupProps, &crOrder); 
        
        /* this assert will fail */
        assert(crOrder == H5P_CRT_ORDER_TRACKED);

        return 0;
}

Expected behavior
The intermadiate groups being created with the same creation properties.

@derobins derobins added Priority - 1. High These are important issues that should be resolved in the next release Component - C Library Core C library issues (usually in the src directory) Type - Bug and removed Merge - To 1.14 labels Jan 22, 2024
@derobins derobins added this to the 1.14.4 milestone Jan 24, 2024
@derobins
Copy link
Member

We should fix this, though it might require some property list changes for when we create a dataset.

@radistmorse
Copy link
Author

Yes, I thought to include the dataset case as well, but since dataset doesn't have group creation properties at all, this would be more of a feature request (also, breaks API). For group creation this seems more obvious. If a single function call creates several groups, it's unintuitive to create these groups with different properties.

vchoi-hdfgroup added a commit to vchoi-hdfgroup/hdf5 that referenced this issue Mar 14, 2024
Propagate object creation properties to intermediate groups.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component - C Library Core C library issues (usually in the src directory) Priority - 1. High These are important issues that should be resolved in the next release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants