Possible VTKHDF bug

I’ve developed a VTKHDF writer for our code that is working for small development test cases, but which is causing errors in paraview for large application-like cases. I’m generating a MultiBlockDataSet file with 4 blocks. Each block is an UnstructuredGrid with multiple parts written by the individual MPI ranks. One possibly significant feature of this case is that many MPI ranks do not contain a piece of all blocks, so that there are lots of 0-sized parts in the different blocks.

If I only write the mesh (no cell or point arrays), the generated file loads into paraview without error and displays exactly what it should. I can toggle on/off the various blocks using the MultiBlock inspector panel and that does exactly as I expect, however after doing this 6 or 8 times paraview segfaults without any error message.

If I add a scalar cell array to the output I get the following error from paraview:

vtkDataSet.cxx:757 WARN| vtkUnstructuredGrid (0x37b43410): Cell array FUBAR with 1 components, has 0 tuples but there are only -1 cells.

Despite this the cell array displays exactly as expected.

Any thoughts about what might be going wrong? I’ll be looking into working up some smaller cases that show the same problems.

Please share an example data.

FYI @lgivord @Louis_Gombert

Can you please try pushing a single 0 value in your Offsets array when there are no cells?

I checked, and I am already doing that as the size of Offsets is supposed to be 1 greater than the number of cells. The NumberOf…are also 0, and no data is written to the Connectivity, Types, and Points arrays.

Here’s a google drive download link to my current case; it’s probably larger (10M) than you’d like to see uploaded here. If I can find a small test case I’ll upload it here.