Skip to content

Commit

Permalink
voloctree: fix _recoverPartition method
Browse files Browse the repository at this point in the history
  • Loading branch information
marcocisternino committed Jan 25, 2024
1 parent 386261f commit 238b763
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/voloctree/voloctree_mapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1233,17 +1233,25 @@ bool VolOctreeMapper::_recoverPartition()
std::map<int, std::vector<long>> list_id;
std::map<int, std::vector<long>> list_globalId;
uint32_t idx = 0;
uint64_t morton = mappedPatch->getTree().getLastDescMorton(idx);
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
uint64_t morton = mappedPatch->getTree().getLastDescMorton(idx);
while (morton < reference_first_morton) {
idx++;
if (idx == mappedPatch->getTree().getNumOctants()) {
break;
}
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);
Expand All @@ -1255,6 +1263,7 @@ bool VolOctreeMapper::_recoverPartition()
m_partitionIR.list_sent_octantIR.emplace_back(oct, id, globalId, reference_rank);
idx++;
if (idx == mappedPatch->getTree().getNumOctants()) {
--idx;
break;
}
morton = mappedPatch->getTree().getMorton(idx);
Expand Down

0 comments on commit 238b763

Please sign in to comment.