]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Remove duplicate ranks when ArborX is available 15754/head
authorMarco Feder <marco.feder@sissa.it>
Sat, 15 Jul 2023 19:01:36 +0000 (21:01 +0200)
committerMarco Feder <marco.feder@sissa.it>
Sat, 15 Jul 2023 19:01:36 +0000 (21:01 +0200)
source/grid/grid_tools.cc

index 03f8dc3dd37aebcb0dcf6c6f4d5d4f56e50c486b..6d84bbd0ede1b137f8a433c065ca6961bc8e4d8a 100644 (file)
@@ -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<unsigned int> 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
             {

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.