]> https://gitweb.dealii.org/ - dealii.git/commitdiff
further cleanup of distribute_sparsity_pattern() 7831/head
authorDenis Davydov <davydden@gmail.com>
Wed, 20 Mar 2019 21:19:55 +0000 (22:19 +0100)
committerDenis Davydov <davydden@gmail.com>
Wed, 20 Mar 2019 21:19:55 +0000 (22:19 +0100)
source/lac/sparsity_tools.cc

index 2ec2422ad64f60d6f08d948fa971e9777ed5e7bf..1a18621296bc245cd17e4fcd7390243b40a29683 100644 (file)
@@ -954,15 +954,13 @@ namespace SparsityTools
             continue;
 
           // save entries
-          auto &dst = send_data[dest_cpu];
-
-          dst.push_back(rlen); // number of entries
-          dst.push_back(row);  // row index
+          send_data[dest_cpu].push_back(row);  // row index
+          send_data[dest_cpu].push_back(rlen); // number of entries
           for (DynamicSparsityPattern::size_type c = 0; c < rlen; ++c)
             {
               // columns
               const auto column = dsp.column_number(row, c);
-              dst.push_back(column);
+              send_data[dest_cpu].push_back(column);
             }
         }
     }
@@ -977,13 +975,13 @@ namespace SparsityTools
         const auto  end      = recv_buf.end();
         while (ptr != end)
           {
-            const DynamicSparsityPattern::size_type num = *(ptr++);
+            const auto row = *(ptr++);
             Assert(ptr != end, ExcInternalError());
-            const DynamicSparsityPattern::size_type row = *(ptr++);
+            const auto n_entries = *(ptr++);
 
-            Assert(ptr + (num - 1) != end, ExcInternalError());
-            dsp.add_entries(row, ptr, ptr + num, true);
-            ptr += num;
+            Assert(ptr + (n_entries - 1) != end, ExcInternalError());
+            dsp.add_entries(row, ptr, ptr + n_entries, true);
+            ptr += n_entries;
           }
         Assert(ptr == end, ExcInternalError());
       }

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.