From 4c615d42332ba971db7a5fbf80209f9ecd030d29 Mon Sep 17 00:00:00 2001 From: Marc Fehling Date: Fri, 30 Aug 2024 11:53:43 -0600 Subject: [PATCH] Simplify assignment of dofs_per_process. --- source/base/mpi_compute_index_owner_internal.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/base/mpi_compute_index_owner_internal.cc b/source/base/mpi_compute_index_owner_internal.cc index d6795a0f35..44dc278d52 100644 --- a/source/base/mpi_compute_index_owner_internal.cc +++ b/source/base/mpi_compute_index_owner_internal.cc @@ -439,9 +439,9 @@ namespace Utilities Assert(size > 0, ExcNotImplemented()); - dofs_per_process = (size + n_procs - 1) / n_procs; - if (dofs_per_process < range_minimum_grain_size) - dofs_per_process = range_minimum_grain_size; + dofs_per_process = + std::max((size + n_procs - 1) / n_procs, + range_minimum_grain_size); stride_small_size = std::max(dofs_per_process * n_procs / size, 1); -- 2.39.5