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

**URL:** https://discourse.paraview.org/t/paraview-report-error-reading-extent-from-piece-0-when-reading-pvts-file/15057
**Category:** ParaView Support
**Tags:** vtk
**Created:** [July 15, 2024, 2:57pm UTC](https://discourse.paraview.org/t/paraview-report-error-reading-extent-from-piece-0-when-reading-pvts-file/15057 "2024-07-15T14:57:22Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![cheapmeow](https://discourse.paraview.org/user_avatar/discourse.paraview.org/cheapmeow/32/14071_2.png) [@cheapmeow](https://discourse.paraview.org/u/cheapmeow)
#### Post date: [July 15, 2024, 2:57pm UTC](https://discourse.paraview.org/t/paraview-report-error-reading-extent-from-piece-0-when-reading-pvts-file/15057/1 "2024-07-15T14:57:22Z")

</div>

## Description

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

```auto
( 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](https://github.com/CheapMeow/VTSWriter)

Most of my code comes from [https://stackoverflow.com/questions/24123432/composing-vtk-file-from-multiple-mpi-outputs](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](https://discourse.paraview.org/uploads/short-url/zSseLQdEuhzdnjFoh8bgtGBMg0o.gz) (3.0 KB)

## Env

Paraview Version

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

---

<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: [July 15, 2024, 3:02pm UTC](https://discourse.paraview.org/t/paraview-report-error-reading-extent-from-piece-0-when-reading-pvts-file/15057/2 "2024-07-15T15:02:21Z")

</div>

There is an issue with your archive, test\_output\_0.vts is not a vts file but a tar.gz archive itself.

---

<div class="post-metadata">

### Author: ![cheapmeow](https://discourse.paraview.org/user_avatar/discourse.paraview.org/cheapmeow/32/14071_2.png) [@cheapmeow](https://discourse.paraview.org/u/cheapmeow)
#### Post date: [July 16, 2024, 3:13am UTC](https://discourse.paraview.org/t/paraview-report-error-reading-extent-from-piece-0-when-reading-pvts-file/15057/3 "2024-07-16T03:13:53Z")

</div>

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

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

```

but not

```xml
  <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:

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

---

<div class="post-metadata">

### Author: ![cheapmeow](https://discourse.paraview.org/user_avatar/discourse.paraview.org/cheapmeow/32/14071_2.png) [@cheapmeow](https://discourse.paraview.org/u/cheapmeow)
#### Post date: [July 16, 2024, 5:26am UTC](https://discourse.paraview.org/t/paraview-report-error-reading-extent-from-piece-0-when-reading-pvts-file/15057/4 "2024-07-16T05:26:04Z")

</div>

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.
