Extent attributes in StructuredGrid

Dear users,
I am trying to output my numerical simulation data in vtk format.
My grid is structured and I need to use the VTK’s XML format.
My greatest confusion is about the WholeExtent and the Piece Extent attributes.
E.g., the VTK pdf manual says

StructuredGrid WholeExtent=“x1 x2 y1 y2 z1 z2”.

What exactly are these x1, x2’s, etc? A similar question is about the x1, x2’s in the Piece Extent attribute.
Thank you!

WholeExtent is the range of indices for points, for the whole grid. So a 2x3x4 grid could have WholeExtent=“0 1 0 2 0 3”. Note that the start and end indices can be any values including negative values, but start should be less or equal with end.

PieceExtent refers to the range of indices present on a certain MPI rank. Data is partitioned based on that.

Dear Dan,
thank a lot for your response.
It did work out for a single rank case, but I’m having hard time with more ranks.
Specifically, I have this Minimum (non)-working example:

10x6x1 (2D) grid, 2 CPUs in x direction, 1 CPU in the remaining directions.
So Proc 1 has 6x6x1 and Proc 2 has 5x6x1 grid points. I’ve these lines in each of the .vts files:

Processor 1:
StructuredGrid WholeExtent=" 1 10 1 6 1 1 "
Piece Extent=" 1 6 1 6 1 1 "

Processor 2:
StructuredGrid WholeExtent=" 1 10 1 6 1 1 "
Piece Extent=" 6 10 1 6 1 1 "

Thank you!

This looks right. I generated a pvts from one of VTK’s sample data files.

You can load this in ParaView and see what is different from what you are generating. How do you write your files?

Dear Dan,
thank you for your response. I think I found the issue by looking at the file you shared with me.

The “StructuredGrid WholeExtent” and the “Piece Extent” attributes have the same values in your file, and that also fixed problem for me.