bug fix for not covering the end of 3D HDF5 datasets

This commit is contained in:
Mingzhe Li 2024-07-09 16:22:52 -07:00 committed by Gunther H. Weber
parent e22051a0bc
commit c6136dd501

@ -233,6 +233,19 @@ bool read3DHDF5File(const int& mpi_rank,
{
count[2] = globalSize[2] - offset[2];
}
// Check that we cover the end of the dataset
if (blockIndex[0] == blocksPerDim[0] - 1 && (vtkm::Id(offset[0] + count[0]) != globalSize[0]))
{
count[0] = globalSize[0] - offset[0];
}
if (blockIndex[1] == blocksPerDim[1] - 1 && (vtkm::Id(offset[1] + count[1]) != globalSize[1]))
{
count[1] = globalSize[1] - offset[1];
}
if (blockIndex[2] == blocksPerDim[2] - 1 && (vtkm::Id(offset[2] + count[2]) != globalSize[2]))
{
count[2] = globalSize[2] - offset[2];
}
blockSize = vtkm::Id3{ static_cast<vtkm::Id>(count[0]),
static_cast<vtkm::Id>(count[1]),
static_cast<vtkm::Id>(count[2]) };