Not able to set flag for track order while creating a group.

Hi, I am trying to create VTKHDF group with track order flag(like we do in python).
I am creating a C++ API, so trying to add the flags while creating a group.
I tried to use both C++ based and C based functions from HDF5 Api. But the group is still showing
“Creation Order NOT Tracked”.
This is important because, as far as I know, we need the VTKHDF and Assembly group to be tracked for reading MultiblockDataset. That is why I am not able read in Paraview.

bool createGroup(const std::string grpNm )
{
    if (grpNm.empty()) {
        return false;
    }

    try {
        // Create a property list for the creation of the group
        hid_t gcpl = H5Pcreate(H5P_GROUP_CREATE);

        // Set the link creation order
        herr_t status = H5Pset_link_creation_order(gcpl, H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED);
        std::cout<<status;
        // Create the group with the property list
        hid_t group = H5Gcreate(H5F_OBJ_FILE, grpNm.c_str(), H5P_DEFAULT, gcpl, H5P_DEFAULT);
        std::cout<<group;
        // Close the group and property list
        H5Gclose(group);
        H5Pclose(gcpl);
    } catch(...) {
        return false;
    }
    return true;
}

Am I missing something?

@Lucas_Givord

Hello @mrx

indeed you need that for the MultiBlock or PartitionedDataSetCollection vtkhdf file. However your method looks ok, you can also look at this method https://gitlab.kitware.com/vtk/vtk/-/blob/master/IO/HDF/vtkHDFWriterImplementation.cxx#L250-L260 and how we call it

Yes I did see it. I tried mimicking your function, but still it isn’t working.

the only thing that I see here is that you use directly the H5F_OBJ_FILE, in the writer we pass the hid_t of the file directly.

Also maybe the issue come from another part of your code and not from this snippet?

Rest all is actually working fine, and this is more or less standalone code. The other function which I am just using to create groups is working fine.
Okay I will check the id thing. Thanks!