]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Simplify assignment of dofs_per_process. 17638/head
authorMarc Fehling <mafehling.git@gmail.com>
Fri, 30 Aug 2024 17:53:43 +0000 (11:53 -0600)
committerMarc Fehling <mafehling.git@gmail.com>
Fri, 30 Aug 2024 20:23:15 +0000 (14:23 -0600)
source/base/mpi_compute_index_owner_internal.cc

index d6795a0f35f780b0fc17d7f37033ba8b39d04a68..44dc278d520c3f433fc4adb2b3af1d267f4df6fb 100644 (file)
@@ -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<types::global_dof_index>((size + n_procs - 1) / n_procs,
+                                              range_minimum_grain_size);
 
           stride_small_size =
             std::max<unsigned int>(dofs_per_process * n_procs / size, 1);

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.