# Error loading VTKHDF unstructured grid

**URL:** https://discourse.paraview.org/t/error-loading-vtkhdf-unstructured-grid/13171
**Category:** ParaView Support
**Created:** [November 2, 2023, 1:51pm UTC](https://discourse.paraview.org/t/error-loading-vtkhdf-unstructured-grid/13171 "2023-11-02T13:51:03Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![Juan\_Jose\_Casafranca](https://discourse.paraview.org/user_avatar/discourse.paraview.org/juan_jose_casafranca/32/3499_2.png) [@Juan\_Jose\_Casafranca](https://discourse.paraview.org/u/Juan_Jose_Casafranca)
#### Post date: [November 2, 2023, 1:51pm UTC](https://discourse.paraview.org/t/error-loading-vtkhdf-unstructured-grid/13171/1 "2023-11-02T13:51:03Z")

</div>

I am tryinv to use VTKHDF format and I have create a sample file to test it, but paraview is giving errors when trying to read it:

```auto
( 113.892s) [paraview] vtkExecutive.cxx:729 ERR| vtkPVCompositeDataPipeline (0x7073a80): Algorithm vtkFileSeriesReader (0x71770e0) returned failure for request: vtkInformation (0x7073dc0)                                                                                                                
  Debug: Off                                                                                                                                                                                                                                                                                                                
  Modified Time: 513016                                                                                                                                                                                                                                                                                                     
  Reference Count: 1                                                                                                                                                                                                                                                                                                        
  Registered Events: (none)                                                                                                                                                                                                                                                                                                 
  Request: REQUEST_DATA_OBJECT                                                                                                                                                                                                                                                                                              
  ALGORITHM_AFTER_FORWARD: 1                                                                                                                                                                                                                                                                                                
  FORWARD_DIRECTION: 0                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                            
                                                                                                                                                                                                                                                                                                                            
( 113.945s) [paraview]vtkHDFReaderImplementat:323 ERR| vtkHDFReader (0x69eb5c0): Cannot get number of steps if the group is not open                                                                                                                                                                             
( 113.945s) [paraview] vtkHDFReader.cxx:526 ERR| vtkHDFReader (0x69eb5c0): HDF dataset type unknown: -1                                                                                                                                                                                                    
( 113.945s) [paraview] vtkExecutive.cxx:729 ERR| vtkPVCompositeDataPipeline (0x7073a80): Algorithm vtkFileSeriesReader (0x71770e0) returned failure for request: vtkInformation (0x7073dc0)                                                                                                                
  Debug: Off                                                                                                                                                                                                                                                                                                                
  Modified Time: 513016                                                                                                                                                                                                                                                                                                     
  Reference Count: 1                                                                                                                                                                                                                                                                                                        
  Registered Events: (none)                                                                                                                                                                                                                                                                                                 
  Request: REQUEST_DATA_OBJECT                                                                                                                                                                                                                                                                                              
  ALGORITHM_AFTER_FORWARD: 1                                                                                                                                                                                                                                                                                                
  FORWARD_DIRECTION: 0                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                            
                                                                                                                                                                                                                                                                                                                            
( 113.949s) [paraview]vtkHDFReaderImplementat:323 ERR| vtkHDFReader (0x69eb5c0): Cannot get number of steps if the group is not open
( 113.949s) [paraview] vtkHDFReader.cxx:526 ERR| vtkHDFReader (0x69eb5c0): HDF dataset type unknown: -1
( 113.949s) [paraview] vtkExecutive.cxx:729 ERR| vtkPVCompositeDataPipeline (0x7073a80): Algorithm vtkFileSeriesReader (0x71770e0) returned failure for request: vtkInformation (0x7073dc0)
  Debug: Off
  Modified Time: 513016
  Reference Count: 1
  Registered Events: (none)
  Request: REQUEST_DATA_OBJECT
  ALGORITHM_AFTER_FORWARD: 1
  FORWARD_DIRECTION: 0

...

```

Is there something wrong in my file?

This is the file I am trying to load  
[geodesic.0.hdf](https://discourse.paraview.org/uploads/short-url/x8B10PaMJWWqgVFxrvhQamkTR9X.hdf) (97.2 KB)

---

<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: [November 2, 2023, 3:18pm UTC](https://discourse.paraview.org/t/error-loading-vtkhdf-unstructured-grid/13171/2 "2023-11-02T15:18:37Z")

</div>

I confirm that your file is not correctly written. Please read [https://www.kitware.com/how-to-write-time-dependent-data-in-vtkhdf-files/](https://www.kitware.com/how-to-write-time-dependent-data-in-vtkhdf-files/) and [VTK: VTK HDF File Format](https://vtk.org/doc/nightly/html/VTKHDFFileFormat.html)

FYI @Lucas_Givord

---

<div class="post-metadata">

### Author: ![Juan\_Jose\_Casafranca](https://discourse.paraview.org/user_avatar/discourse.paraview.org/juan_jose_casafranca/32/3499_2.png) [@Juan\_Jose\_Casafranca](https://discourse.paraview.org/u/Juan_Jose_Casafranca)
#### Post date: [November 2, 2023, 5:16pm UTC](https://discourse.paraview.org/t/error-loading-vtkhdf-unstructured-grid/13171/3 "2023-11-02T17:16:44Z")

</div>

Could you point me where the file is wrong. I am unable to find it. I have read the documentation before writing my code, and I have read it again, but I can’t find the issue.

I have seen that the Points dataset must be an 1D dataset instead of 2D, but even with that changes, its still giving the same errors

---

<div class="post-metadata">

### Author: ![Juan\_Jose\_Casafranca](https://discourse.paraview.org/user_avatar/discourse.paraview.org/juan_jose_casafranca/32/3499_2.png) [@Juan\_Jose\_Casafranca](https://discourse.paraview.org/u/Juan_Jose_Casafranca)
#### Post date: [November 2, 2023, 6:19pm UTC](https://discourse.paraview.org/t/error-loading-vtkhdf-unstructured-grid/13171/4 "2023-11-02T18:19:29Z")

</div>

I have checked again and I found that I am missing the VTKHDF initial group. I thought that the initial group was directly the file, but it looks like we need to write all the data below `/VTKHDF`, and not directly below `/`. Probably that could be make more clear in the documentation.

In any case, I still get the same errors…

---

<div class="post-metadata">

### Author: ![Juan\_Jose\_Casafranca](https://discourse.paraview.org/user_avatar/discourse.paraview.org/juan_jose_casafranca/32/3499_2.png) [@Juan\_Jose\_Casafranca](https://discourse.paraview.org/u/Juan_Jose_Casafranca)
#### Post date: [November 2, 2023, 8:54pm UTC](https://discourse.paraview.org/t/error-loading-vtkhdf-unstructured-grid/13171/5 "2023-11-02T20:54:59Z")

</div>

I have finally managed to open my file. So there were several issues. I will write the issues and some thoughts as a user/developer:

First of all, the Type attribute in VTKHDF must be an ASCII. This is in the documentation, but I clearly didn’t read it. However, I find it a bit unconvenient. I think I would be better to have an enum, the same way there is the vtkCellType enum. 0: Image Data, 1: Unstructured grid…

Second, the data type for the datasets is not clear. I was writing them as unsigned int, just to get some errors while reading the file with the VTKHDF reader in ParaView. I haven’t found anywhere where the data type expected for each dataset is documented.

---

<div class="post-metadata">

### Author: ![danlipsa](https://discourse.paraview.org/user_avatar/discourse.paraview.org/danlipsa/32/1563_2.png) [@danlipsa](https://discourse.paraview.org/u/danlipsa)
#### Post date: [November 2, 2023, 10:18pm UTC](https://discourse.paraview.org/t/error-loading-vtkhdf-unstructured-grid/13171/6 "2023-11-02T22:18:26Z")

</div>

> I have finally managed to open my file. So there were several issues. I will write the issues and some thoughts as a user/developer:

Great!

> First of all, the Type attribute in VTKHDF must be an ASCII. This is in the documentation, but I clearly didn’t read it. However, I find it a bit unconvenient. I think I would be better to have an enum, the same way there is the vtkCellType enum. 0: Image Data, 1: Unstructured grid…

We matched the other VTK formats and also it is self documented. But numbers would have been fine as well.

> Second, the data type for the datasets is not clear. I was writing them as unsigned int, just to get some errors while reading the file with the VTKHDF reader in ParaView. I haven’t found anywhere where the data type expected for each dataset is documented.

Is the third paragraph from the following link answering your question?

[https://examples.vtk.org/site/VTKFileFormats/#hdf-file-formats](https://examples.vtk.org/site/VTKFileFormats/#hdf-file-formats)

---

<div class="post-metadata">

### Author: ![Juan\_Jose\_Casafranca](https://discourse.paraview.org/user_avatar/discourse.paraview.org/juan_jose_casafranca/32/3499_2.png) [@Juan\_Jose\_Casafranca](https://discourse.paraview.org/u/Juan_Jose_Casafranca)
#### Post date: [November 3, 2023, 5:50am UTC](https://discourse.paraview.org/t/error-loading-vtkhdf-unstructured-grid/13171/7 "2023-11-03T05:50:48Z")

</div>

Not really. In that paragraph it says, at least as I understand, that datasets will be converted to VTK arrays matching the underlying data type.

However, Types array must be unsigned char, according to paraview error if you use another data type. Connectivity and Offset arrays must be signed integers, I have tested `unsigned int` and `int` and only the `int` was working. Not sure if it also works with long int. AFAIK, this is not documented for the VTKHDF format.

---

<div class="post-metadata">

### Author: ![danlipsa](https://discourse.paraview.org/user_avatar/discourse.paraview.org/danlipsa/32/1563_2.png) [@danlipsa](https://discourse.paraview.org/u/danlipsa)
#### Post date: [November 3, 2023, 12:54pm UTC](https://discourse.paraview.org/t/error-loading-vtkhdf-unstructured-grid/13171/8 "2023-11-03T12:54:08Z")

</div>

I see, yes you are right. Thanks for the report. I’ll update the documentation.

You can also check the examples at the end of the document  
[https://examples.vtk.org/site/VTKFileFormats/#examples](https://examples.vtk.org/site/VTKFileFormats/#examples)  
and the tests in VTK for actual data that works with the readers.

---

<div class="post-metadata">

### Author: ![Juan\_Jose\_Casafranca](https://discourse.paraview.org/user_avatar/discourse.paraview.org/juan_jose_casafranca/32/3499_2.png) [@Juan\_Jose\_Casafranca](https://discourse.paraview.org/u/Juan_Jose_Casafranca)
#### Post date: [November 3, 2023, 12:59pm UTC](https://discourse.paraview.org/t/error-loading-vtkhdf-unstructured-grid/13171/9 "2023-11-03T12:59:32Z")

</div>

Yes, I actually had to look into those examples to find that my offsets/connectivity ids should be signed integers instead of unsigned. Not sure if long or even short signed integers will work. Would be nice if the documentation specifies this.

I would consider this topic closed, as the issues are solved. However, I would like to ask also if there is any estimation of when VTKHDF will support hierarchical datasets (vtkMultiBlockDataset for example).

---

<div class="post-metadata">

### Author: ![danlipsa](https://discourse.paraview.org/user_avatar/discourse.paraview.org/danlipsa/32/1563_2.png) [@danlipsa](https://discourse.paraview.org/u/danlipsa)
#### Post date: [November 3, 2023, 2:48pm UTC](https://discourse.paraview.org/t/error-loading-vtkhdf-unstructured-grid/13171/10 "2023-11-03T14:48:25Z")

</div>

This is the design:  
[https://discourse.vtk.org/t/composite-data-sets-for-the-vtkhdf-format/12190](https://discourse.vtk.org/t/composite-data-sets-for-the-vtkhdf-format/12190)

[@Mathieu Westphal](mailto:mathieu.westphal@kitware.com) Any plans to continue this work?

---

<div class="post-metadata">

### Author: ![Juan\_Jose\_Casafranca](https://discourse.paraview.org/user_avatar/discourse.paraview.org/juan_jose_casafranca/32/3499_2.png) [@Juan\_Jose\_Casafranca](https://discourse.paraview.org/u/Juan_Jose_Casafranca)
#### Post date: [November 3, 2023, 8:44pm UTC](https://discourse.paraview.org/t/error-loading-vtkhdf-unstructured-grid/13171/11 "2023-11-03T20:44:13Z")

</div>

If the development is stalled, I guess I could contribute. I recently made a HDF reader for my own format, similar to what VTKHDF provides, where the groups hierarchy was converted into a vtkMultiBlockDataSet.

---

<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: [November 6, 2023, 8:02am UTC](https://discourse.paraview.org/t/error-loading-vtkhdf-unstructured-grid/13171/12 "2023-11-06T08:02:10Z")

</div>

Hi @Juan_Jose_Casafranca @danlipsa,

I am precisely working on it, I would tell you when the MR will be ready if you want to review it 🙂

Also, thanks for all of theses feedback if you can ping me directly on each issue that you will open, it would be great

---

<div class="post-metadata">

### Author: ![Juan\_Jose\_Casafranca](https://discourse.paraview.org/user_avatar/discourse.paraview.org/juan_jose_casafranca/32/3499_2.png) [@Juan\_Jose\_Casafranca](https://discourse.paraview.org/u/Juan_Jose_Casafranca)
#### Post date: [November 6, 2023, 8:24am UTC](https://discourse.paraview.org/t/error-loading-vtkhdf-unstructured-grid/13171/13 "2023-11-06T08:24:50Z")

</div>

In which repo should I posted the bugs I find? VTK or ParaView? I think I have found a problem regarding the Type string

---

<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: [November 6, 2023, 8:32am UTC](https://discourse.paraview.org/t/error-loading-vtkhdf-unstructured-grid/13171/14 "2023-11-06T08:32:15Z")

</div>

as vtkHDF is a file format specific to vtk, I think the best place for these issues should be in vtk [https://gitlab.kitware.com/vtk/vtk/-/issues](https://gitlab.kitware.com/vtk/vtk/-/issues)

Thanks!
