From 3794c2e0d33afde3430b4396ba5259f74adc9b28 Mon Sep 17 00:00:00 2001 From: Martin Kronbichler Date: Mon, 15 Feb 2021 18:11:04 +0100 Subject: [PATCH] Adjust minimum grain size of dictionary for consensus algorithm --- .../base/mpi_compute_index_owner_internal.h | 24 ++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/include/deal.II/base/mpi_compute_index_owner_internal.h b/include/deal.II/base/mpi_compute_index_owner_internal.h index 91092aa273..cd01457abc 100644 --- a/include/deal.II/base/mpi_compute_index_owner_internal.h +++ b/include/deal.II/base/mpi_compute_index_owner_internal.h @@ -157,9 +157,27 @@ namespace Utilities struct Dictionary { /** - * The minimum grain size for the ranges. - */ - static const unsigned int range_minimum_grain_size = 4096; + * The minimum grain size for the intervals. + * + * We choose to limit the smallest size an interval for the + * two-stage lookup can have with the following two conflicting + * goals in mind: On the one hand, we do not want intervals in the + * dictionary to become too short. For uneven distributions of + * unknowns (some ranks with several thousands of unknowns, others + * with none), the lookup DoFs -> dictionary then involves sending + * from one MPI rank to many other MPI ranks holding dictionary + * intervals, leading to an exceedingly high number of messages some + * ranks have to send. Also, fewer longer intervals are generally + * more efficient to look up. On the other hand, a range size too + * large leads to opposite effect of many messages that come into a + * particular dictionary owner in the lookup DoFs -> + * dictionary. With the current setting, we get at most 64 messages + * coming to a single MPI rank in case there is 1 dof per MPI rank, + * which is reasonably low. At the same time, uneven distributions + * up to factors of 4096 can be handled with at most 64 messages as + * well. + */ + static const unsigned int range_minimum_grain_size = 64; /** * A vector with as many entries as there are dofs in the dictionary -- 2.39.5