Paraview report error reading extent ... from piece 0 when reading pvts file

Description

When reading pvts file which is vtkXMLPStructuredGridWriter’s output, Paraview report error reading extent:

(   9.396s) [paraview        ]vtkXMLStructuredDataRea:345    ERR| vtkXMLStructuredGridReader (0x1871ab50): Error reading extent 0 8 0 8 0 8 from piece 0
(   9.437s) [paraview        ]   vtkXMLDataReader.cxx:410    ERR| vtkXMLStructuredGridReader (0x1871ab50): Cannot read point data array "Velocity" from PointData in piece 0.  The data array in the element may be too short.
(   9.437s) [paraview        ]  vtkXMLPDataReader.cxx:359    ERR| vtkXMLPStructuredGridReader (0x1b527920): Piece point data array Velocity not found
(   9.437s) [paraview        ]  vtkXMLPDataReader.cxx:359    ERR| vtkXMLPStructuredGridReader (0x1b527920): Piece point data array Pressure not found

Minimal reproduction is published to github.

https://github.com/CheapMeow/VTSWriter

Most of my code comes from https://stackoverflow.com/questions/24123432/composing-vtk-file-from-multiple-mpi-outputs, and his code run well. I don’t know what is the difference to make thing crashs.

File

my_vts_files.tar.gz (3.0 KB)

Env

Paraview Version

Client Information:
Version: 5.11.1
VTK Version: 9.2.20220823
Qt Version: 5.15.2
vtkIdType size: 64bits
Embedded Python: On
Python Library Path: /public/software/ParaView-5.11.1/lib/python3.9
Python Library Version: 3.9.13 (main, Mar 30 2023, 16:46:40) [GCC 7.3.1 20180303 (Red Hat 7.3.1-5)]
Python Numpy Support: On
Python Numpy Path: /public/software/ParaView-5.11.1/lib/python3.9/site-packages/numpy
Python Numpy Version: 1.21.1
Python Matplotlib Support: On
Python Matplotlib Path: /public/software/ParaView-5.11.1/lib/python3.9/site-packages/matplotlib
Python Matplotlib Version: 3.2.1
Python Testing: Off
MPI Enabled: On
ParaView Build ID: superbuild 2c64f06366aa320e98d98577af18bad64ad9a630 (!1076)
Disable Registry: Off
Test Directory:
Data Directory:
SMP Backend: TBB
SMP Max Number of Threads: 52
OpenGL Vendor: VMware, Inc.
OpenGL Version: 3.3 (Core Profile) Mesa 18.0.5
OpenGL Renderer: llvmpipe (LLVM 6.0, 256 bits)
Accelerated filters overrides available: No

Connection Information:
Remote Connection: No

VTK version I linked to: 9.1.0

Thank you for your reply!

There is an issue with your archive, test_output_0.vts is not a vts file but a tar.gz archive itself.

Finally I know why my vts file has issue, it is problem about dimension.
For example, I have 8 cells in each dimension, then xml should be

  <StructuredGrid WholeExtent="0 7 0 7 0 7">
  <Piece Extent="0 7 0 7 0 7">

but not

  <StructuredGrid WholeExtent="0 8 0 8 0 8">
  <Piece Extent="0 8 0 8 0 8">

Fix this bug, then each of my vts file can be read by paraview, but the pvts file has another error:

(5660.785s) [paraview        ]vtkXMLPStructuredDataRe:429    ERR| vtkXMLPStructuredGridReader (0x1c50b150): No available piece provides data for the following extents:
    7 8  0 7  0 7

It is the pvts file content

<?xml version="1.0"?>
<VTKFile type="PStructuredGrid" version="0.1" byte_order="LittleEndian" header_type="UInt32" compressor="vtkZLibDataCompressor">
  <PStructuredGrid WholeExtent="0 15 0 7 0 7" GhostLevel="0">
    <PPointData>
      <PDataArray type="Float64" Name="Velocity" NumberOfComponents="3"/>
      <PDataArray type="Float64" Name="Pressure"/>
    </PPointData>
    <PPoints>
      <PDataArray type="Float32" Name="Points" NumberOfComponents="3"/>
    </PPoints>
    <Piece Extent="0 7 0 7 0 7" Source="test_output_0.vts"/>
    <Piece Extent="8 15 0 7 0 7" Source="test_output_1.vts"/>
  </PStructuredGrid>
</VTKFile>

It is part of xml of part 0 vts

<?xml version="1.0"?>
<VTKFile type="StructuredGrid" version="0.1" byte_order="LittleEndian" header_type="UInt32" compressor="vtkZLibDataCompressor">
  <StructuredGrid WholeExtent="0 7 0 7 0 7">
  <Piece Extent="0 7 0 7 0 7">

part 1

<?xml version="1.0"?>
<VTKFile type="StructuredGrid" version="0.1" byte_order="LittleEndian" header_type="UInt32" compressor="vtkZLibDataCompressor">
  <StructuredGrid WholeExtent="8 15 0 7 0 7">
  <Piece Extent="8 15 0 7 0 7">

So paraview need to fit the gap between different part of vts file. But it is strange, because I think [0, 7] and [8, 15] should be continuous naturally, there should not be gap between them.

Anyway, paraview insists doing this. So I wonder, if it is right?

For example, if I have a [0, 15, 0, 15, 0, 15] grid in non-mpi program, then in mpi program with two process, i should spilt it into [0, 7, 0, 15, 0, 15] and [7, 14, 0, 15, 0, 15]? Then the total extent is shorten? Is it right?

Maybe the simplest solution is define data as cell data, so point data can be [0, 8] [8, 16], then there is no gap between vts parts.