]> https://gitweb.dealii.org/ - dealii.git/commitdiff
simplify the zero fix 7096/head
authorDenis Davydov <davydden@gmail.com>
Tue, 21 Aug 2018 16:31:18 +0000 (18:31 +0200)
committerDenis Davydov <davydden@gmail.com>
Tue, 21 Aug 2018 16:31:18 +0000 (18:31 +0200)
source/base/partitioner.cc

index 84d3b73f19108a6948a94184e6f4e433665d7ac9..72dfaec531fd503ea242787f338526b145e294db 100644 (file)
@@ -213,19 +213,13 @@ namespace Utilities
 
       // fix case when there are some processors without any locally owned
       // indices: then there might be a zero in some entries. The reason
-      // is that local_range_data will contain [0,0) and second indix is
-      // incorrect inside the Allgather'ed first_index.
+      // is that local_range_data will contain [0,0) and second index is
+      // incorrect inside the Allgather'ed first_index. Below we fix this
+      // by ensuring that the start point is always the end index of the
+      // processor immediately before.
       if (global_size > 0)
         {
-          unsigned int first_proc_with_nonzero_dofs = 0;
-          for (unsigned int i = 0; i < n_procs; ++i)
-            if (first_index[i + 1] > 0)
-              {
-                first_proc_with_nonzero_dofs = i;
-                break;
-              }
-          for (unsigned int i = first_proc_with_nonzero_dofs + 1; i < n_procs;
-               ++i)
+          for (unsigned int i = 1; i < n_procs; ++i)
             if (first_index[i] == 0)
               first_index[i] = first_index[i - 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.