Error in parallel unstructured VTKHDF file

Hello,

I’m trying to make my own parallel VTKHDF writing routine.
For the serial execution, the output file looks fine and it could be opened well through Paraview.
However, for the parallel run, the mesh doesn’t show nicely as was intended (also sometimes Paraview is killed).
I couldn’t find any clue for the fix.
Below I attached h5dump output of the serial and parallel files.
Thank you in advance!

Serial

HDF5 "output.hdf" {
GROUP "/" {
   GROUP "VTKHDF" {
      ATTRIBUTE "Type" {
         DATATYPE  H5T_STRING {
            STRSIZE 16;
            STRPAD H5T_STR_NULLTERM;
            CSET H5T_CSET_ASCII;
            CTYPE H5T_C_S1;
         }
         DATASPACE  SCALAR
         DATA {
         (0): "UnstructuredGrid"
         }
      }
      ATTRIBUTE "Version" {
         DATATYPE  H5T_STD_I32LE
         DATASPACE  SIMPLE { ( 2 ) / ( 2 ) }
         DATA {
         (0): 2, 0
         }
      }
      DATASET "Connectivity" {
         DATATYPE  H5T_STD_I32LE
         DATASPACE  SIMPLE { ( 144 ) / ( 144 ) }
         DATA {
         (0): 16, 9, 2, 18, 11, 19, 3, 10, 9, 16, 2, 1, 2, 9, 10, 18, 2, 18,
         (18): 14, 16, 8, 5, 12, 15, 12, 13, 7, 8, 18, 2, 14, 10, 16, 15, 9,
         (35): 18, 3, 19, 11, 13, 15, 6, 16, 5, 15, 14, 18, 16, 6, 15, 16,
         (51): 14, 0, 3, 8, 7, 1, 0, 8, 5, 13, 3, 8, 11, 3, 13, 8, 7, 2, 14,
         (70): 6, 16, 4, 7, 8, 12, 8, 7, 4, 0, 8, 5, 4, 12, 4, 5, 8, 0, 7,
         (89): 17, 14, 6, 2, 14, 17, 6, 3, 10, 17, 2, 3, 17, 10, 19, 14, 17,
         (106): 10, 2, 14, 10, 17, 19, 16, 15, 1, 9, 16, 1, 15, 5, 8, 1, 15,
         (123): 9, 8, 15, 1, 5, 3, 13, 17, 19, 3, 17, 13, 7, 14, 17, 13, 19,
         (140): 14, 13, 17, 7
         }
      }
      DATASET "NumberOfCells" {
         DATATYPE  H5T_STD_I32LE
         DATASPACE  SIMPLE { ( 1 ) / ( 1 ) }
         DATA {
         (0): 36
         }
      }
      DATASET "NumberOfConnectivityIds" {
         DATATYPE  H5T_STD_I32LE
         DATASPACE  SIMPLE { ( 1 ) / ( 1 ) }
         DATA {
         (0): 144
         }
      }
      DATASET "NumberOfPoints" {
         DATATYPE  H5T_STD_I32LE
         DATASPACE  SIMPLE { ( 1 ) / ( 1 ) }
         DATA {
         (0): 20
         }
      }
      DATASET "Offsets" {
         DATATYPE  H5T_STD_I32LE
         DATASPACE  SIMPLE { ( 37 ) / ( 37 ) }
         DATA {
         (0): 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60,
         (16): 64, 68, 72, 76, 80, 84, 88, 92, 96, 100, 104, 108, 112, 116,
         (30): 120, 124, 128, 132, 136, 140, 144
         }
      }
      DATASET "Points" {
         DATATYPE  H5T_IEEE_F64LE
         DATASPACE  SIMPLE { ( 20, 3 ) / ( 20, 3 ) }
         DATA {
         (0,0): 0, 0, 0,
         (1,0): 0.294, 0, 0,
         (2,0): 0.294, 0.294, 0,
         (3,0): 0, 0.294, 0,
         (4,0): 0.018, 0.018, 0,
         (5,0): 0.126, 0.018, 0,
         (6,0): 0.126, 0.126, 0,
         (7,0): 0.018, 0.126, 0,
         (8,0): 0, 0, 0.019,
         (9,0): 0.294, 0, 0.019,
         (10,0): 0.294, 0.294, 0.019,
         (11,0): 0, 0.294, 0.019,
         (12,0): 0.018, 0.018, 0.019,
         (13,0): 0.018, 0.126, 0.019,
         (14,0): 0.126, 0.126, 0.019,
         (15,0): 0.126, 0.018, 0.019,
         (16,0): 0.211929, 0.0987857, 0,
         (17,0): 0.0987857, 0.211929, 0,
         (18,0): 0.211929, 0.0987857, 0.019,
         (19,0): 0.0987857, 0.211929, 0.019
         }
      }
      DATASET "Types" {
         DATATYPE  H5T_STD_U8LE
         DATASPACE  SIMPLE { ( 36 ) / ( 36 ) }
         DATA {
         (0): 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
         (16): 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
         (31): 10, 10, 10, 10, 10
         }
      }
   }
}
}

Parallel

HDF5 "output.hdf" {
GROUP "/" {
   GROUP "VTKHDF" {
      ATTRIBUTE "Type" {
         DATATYPE  H5T_STRING {
            STRSIZE 16;
            STRPAD H5T_STR_NULLTERM;
            CSET H5T_CSET_ASCII;
            CTYPE H5T_C_S1;
         }
         DATASPACE  SCALAR
         DATA {
         (0): "UnstructuredGrid"
         }
      }
      ATTRIBUTE "Version" {
         DATATYPE  H5T_STD_I32LE
         DATASPACE  SIMPLE { ( 2 ) / ( 2 ) }
         DATA {
         (0): 2, 0
         }
      }
      DATASET "Connectivity" {
         DATATYPE  H5T_STD_I32LE
         DATASPACE  SIMPLE { ( 144 ) / ( 144 ) }
         DATA {
         (0): 15, 8, 2, 16, 10, 17, 3, 9, 8, 15, 2, 1, 2, 8, 9, 16, 2, 16,
         (18): 13, 15, 7, 4, 11, 14, 11, 12, 6, 7, 16, 2, 13, 9, 15, 14, 8,
         (35): 16, 3, 17, 10, 12, 14, 5, 15, 4, 14, 13, 16, 15, 5, 14, 15,
         (51): 13, 0, 3, 7, 6, 1, 0, 7, 4, 12, 3, 7, 10, 3, 12, 7, 6, 2, 13,
         (70): 5, 15, 18, 6, 7, 11, 7, 6, 18, 0, 7, 4, 18, 11, 18, 4, 7, 0,
         (88): 6, 19, 13, 5, 2, 13, 19, 5, 3, 9, 19, 2, 3, 19, 9, 17, 13, 19,
         (106): 9, 2, 13, 9, 19, 17, 15, 14, 1, 8, 15, 1, 14, 4, 7, 1, 14, 8,
         (124): 7, 14, 1, 4, 3, 12, 19, 17, 3, 19, 12, 6, 13, 19, 12, 17, 13,
         (141): 12, 19, 6
         }
      }
      DATASET "NumberOfCells" {
         DATATYPE  H5T_STD_I32LE
         DATASPACE  SIMPLE { ( 2 ) / ( 2 ) }
         DATA {
         (0): 18, 18
         }
      }
      DATASET "NumberOfConnectivityIds" {
         DATATYPE  H5T_STD_I32LE
         DATASPACE  SIMPLE { ( 2 ) / ( 2 ) }
         DATA {
         (0): 72, 72
         }
      }
      DATASET "NumberOfPoints" {
         DATATYPE  H5T_STD_I32LE
         DATASPACE  SIMPLE { ( 2 ) / ( 2 ) }
         DATA {
         (0): 18, 2
         }
      }
      DATASET "Offsets" {
         DATATYPE  H5T_STD_I32LE
         DATASPACE  SIMPLE { ( 38 ) / ( 38 ) }
         DATA {
         (0): 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60,
         (16): 64, 68, 72, 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48,
         (32): 52, 56, 60, 64, 68, 72
         }
      }
      DATASET "Points" {
         DATATYPE  H5T_IEEE_F64LE
         DATASPACE  SIMPLE { ( 20, 3 ) / ( 20, 3 ) }
         DATA {
         (0,0): 0, 0, 0,
         (1,0): 0.294, 0, 0,
         (2,0): 0.294, 0.294, 0,
         (3,0): 0, 0.294, 0,
         (4,0): 0.126, 0.018, 0,
         (5,0): 0.126, 0.126, 0,
         (6,0): 0.018, 0.126, 0,
         (7,0): 0, 0, 0.019,
         (8,0): 0.294, 0, 0.019,
         (9,0): 0.294, 0.294, 0.019,
         (10,0): 0, 0.294, 0.019,
         (11,0): 0.018, 0.018, 0.019,
         (12,0): 0.018, 0.126, 0.019,
         (13,0): 0.126, 0.126, 0.019,
         (14,0): 0.126, 0.018, 0.019,
         (15,0): 0.211929, 0.0987857, 0,
         (16,0): 0.211929, 0.0987857, 0.019,
         (17,0): 0.0987857, 0.211929, 0.019,
         (18,0): 0.018, 0.018, 0,
         (19,0): 0.0987857, 0.211929, 0
         }
      }
      DATASET "Types" {
         DATATYPE  H5T_STD_U8LE
         DATASPACE  SIMPLE { ( 36 ) / ( 36 ) }
         DATA {
         (0): 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
         (16): 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
         (31): 10, 10, 10, 10, 10
         }
      }
   }
}
}

hello @sori,

UnstructuredGrid in parallel is expected to work, however just with a dump its a bit hard, I could find what is missing in your file if you can share it (your .vtkhdf file in parallel and in serial would be nice).

Bests,

Hello @lgivord, and thank you for reply!
I was not able to upload hdf file because I’m a new user.

And… I just realized that I’ve been erroneously using the “global” index for the index data.
It was fixed by duplicating Points data on multiple processes and use “local” index for the Connectivity data.

I think the problem is related to the previous one, but I didn’t notice VTKHDF point ownership - Support - VTK.

Thank you

Nice!