From 9f95e16348eb9d1fcba3262301cf5aa7b2d5c971 Mon Sep 17 00:00:00 2001 From: Martin Kronbichler Date: Mon, 12 Feb 2024 13:13:23 +0100 Subject: [PATCH] MG transfer global coarsening: Avoid sending empty messages --- .../multigrid/mg_transfer_global_coarsening.templates.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/deal.II/multigrid/mg_transfer_global_coarsening.templates.h b/include/deal.II/multigrid/mg_transfer_global_coarsening.templates.h index bb3e24d4b2..d3c154e0a1 100644 --- a/include/deal.II/multigrid/mg_transfer_global_coarsening.templates.h +++ b/include/deal.II/multigrid/mg_transfer_global_coarsening.templates.h @@ -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] = {}; -- 2.39.5