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

**URL:** https://discourse.paraview.org/t/not-able-to-set-flag-for-track-order-while-creating-a-group/14496
**Category:** In Situ Support
**Created:** [April 26, 2024, 4:14am UTC](https://discourse.paraview.org/t/not-able-to-set-flag-for-track-order-while-creating-a-group/14496 "2024-04-26T04:14:10Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![mrx](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/m/9de053/32.png) [@mrx](https://discourse.paraview.org/u/mrx)
#### Post date: [April 26, 2024, 4:14am UTC](https://discourse.paraview.org/t/not-able-to-set-flag-for-track-order-while-creating-a-group/14496/1 "2024-04-26T04:14:10Z")

</div>

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.

```auto
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?

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [April 26, 2024, 7:16am UTC](https://discourse.paraview.org/t/not-able-to-set-flag-for-track-order-while-creating-a-group/14496/2 "2024-04-26T07:16:17Z")

</div>

@Lucas_Givord

---

<div class="post-metadata">

### Author: ![Lucas\_Givord](https://discourse.paraview.org/user_avatar/discourse.paraview.org/lucas_givord/32/6851_2.png) [@Lucas\_Givord](https://discourse.paraview.org/u/Lucas_Givord)
#### Post date: [April 26, 2024, 7:25am UTC](https://discourse.paraview.org/t/not-able-to-set-flag-for-track-order-while-creating-a-group/14496/3 "2024-04-26T07:25:27Z")

</div>

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](https://gitlab.kitware.com/vtk/vtk/-/blob/master/IO/HDF/vtkHDFWriterImplementation.cxx#L250-L260) and how we call it

---

<div class="post-metadata">

### Author: ![mrx](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/m/9de053/32.png) [@mrx](https://discourse.paraview.org/u/mrx)
#### Post date: [April 26, 2024, 7:27am UTC](https://discourse.paraview.org/t/not-able-to-set-flag-for-track-order-while-creating-a-group/14496/4 "2024-04-26T07:27:07Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Lucas\_Givord](https://discourse.paraview.org/user_avatar/discourse.paraview.org/lucas_givord/32/6851_2.png) [@Lucas\_Givord](https://discourse.paraview.org/u/Lucas_Givord)
#### Post date: [April 26, 2024, 7:50am UTC](https://discourse.paraview.org/t/not-able-to-set-flag-for-track-order-while-creating-a-group/14496/5 "2024-04-26T07:50:50Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![mrx](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/m/9de053/32.png) [@mrx](https://discourse.paraview.org/u/mrx)
#### Post date: [April 26, 2024, 7:58am UTC](https://discourse.paraview.org/t/not-able-to-set-flag-for-track-order-while-creating-a-group/14496/6 "2024-04-26T07:58:30Z")

</div>

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!
