From a78b01abb2d162943fd830df1401aa85ef639a8c Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Wed, 20 Mar 2019 22:19:55 +0100 Subject: [PATCH] further cleanup of distribute_sparsity_pattern() --- source/lac/sparsity_tools.cc | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/source/lac/sparsity_tools.cc b/source/lac/sparsity_tools.cc index 2ec2422ad6..1a18621296 100644 --- a/source/lac/sparsity_tools.cc +++ b/source/lac/sparsity_tools.cc @@ -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()); } -- 2.39.5