From: Marc Fehling Date: Fri, 30 Aug 2024 17:53:43 +0000 (-0600) Subject: Simplify assignment of dofs_per_process. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4c615d42332ba971db7a5fbf80209f9ecd030d29;p=dealii.git Simplify assignment of dofs_per_process. --- 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);