From: Marco Feder Date: Sat, 15 Jul 2023 19:01:36 +0000 (+0200) Subject: Remove duplicate ranks when ArborX is available X-Git-Tag: relicensing~669^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F15754%2Fhead;p=dealii.git Remove duplicate ranks when ArborX is available --- diff --git a/source/grid/grid_tools.cc b/source/grid/grid_tools.cc index 03f8dc3dd3..6d84bbd0ed 100644 --- a/source/grid/grid_tools.cc +++ b/source/grid/grid_tools.cc @@ -5981,9 +5981,16 @@ namespace GridTools query_bounding_boxes); const auto &[indices_ranks, offsets] = distributed_tree.query(bb_intersect); + for (unsigned long int i = 0; i < offsets.size() - 1; ++i) - for (int j = offsets[i]; j < offsets[i + 1]; ++j) - ranks_and_indices.emplace_back(indices_ranks[j].second, i); + { + std::set my_ranks; + for (int j = offsets[i]; j < offsets[i + 1]; ++j) + my_ranks.insert(indices_ranks[j].second); + + for (const auto rank : my_ranks) + ranks_and_indices.emplace_back(rank, i); + } } else {