]> https://gitweb.dealii.org/ - dealii.git/commitdiff
MG transfer global coarsening: Avoid sending empty messages 16633/head
authorMartin Kronbichler <martin.kronbichler@rub.de>
Mon, 12 Feb 2024 12:13:23 +0000 (13:13 +0100)
committerMartin Kronbichler <martin.kronbichler@rub.de>
Mon, 12 Feb 2024 12:13:23 +0000 (13:13 +0100)
include/deal.II/multigrid/mg_transfer_global_coarsening.templates.h

index bb3e24d4b2855573121e02b044a52db5396f82cd..d3c154e0a1a7dd294b37ae7f7081cf1a5787ef23 100644 (file)
@@ -866,7 +866,11 @@ namespace internal
 
         for (const auto &i : targets_with_indexset)
           {
-            if (i.first == my_rank)
+            // Skip communication in case we would send to ourselves or when
+            // there are no indices to send (this can still happen in the run
+            // of the consensus algorithms above if the index spaces are
+            // sparse).
+            if (i.first == my_rank || i.second.begin() == i.second.end())
               continue;
 
             indices_to_be_sent[i.first] = {};

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.