diff --git a/src/voloctree/voloctree_mapper.cpp b/src/voloctree/voloctree_mapper.cpp index 6ea1ef829f..76166eab04 100644 --- a/src/voloctree/voloctree_mapper.cpp +++ b/src/voloctree/voloctree_mapper.cpp @@ -1237,6 +1237,8 @@ bool VolOctreeMapper::_recoverPartition() for (int reference_rank : toreference_rank[m_rank]) { uint64_t reference_first_morton = partitionFDReference[reference_rank]; uint64_t reference_last_morton = partitionLDReference[reference_rank]; + // Initialize idx position in mapped tree to the first mapped + // octant inside the overlapping region while (morton < reference_first_morton) { idx++; if (idx == mappedPatch->getTree().getNumOctants()) { @@ -1244,6 +1246,12 @@ bool VolOctreeMapper::_recoverPartition() } morton = mappedPatch->getTree().getLastDescMorton(idx); } + if (idx == mappedPatch->getTree().getNumOctants()) { + continue; + } + // Fill partitioning info structure with mapped octants in the + // overlapping region + morton = mappedPatch->getTree().getMorton(idx); while (morton < reference_last_morton) { Octant oct = *mappedPatch->getTree().getOctant(idx); list_octant[reference_rank].push_back(oct);