From 9307fa64bbecdbd5a597c9793a96af6815958351 Mon Sep 17 00:00:00 2001 From: David Wells Date: Sat, 8 Apr 2017 13:13:41 -0400 Subject: [PATCH] Revert eb5db19276 to get consistent memory usage. Rather than rely on details of std::vector's reallocation scheme, just copy things. --- source/base/partitioner.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/source/base/partitioner.cc b/source/base/partitioner.cc index 3f4d01522b..500d762864 100644 --- a/source/base/partitioner.cc +++ b/source/base/partitioner.cc @@ -269,7 +269,6 @@ namespace Utilities // allocate memory for import data std::vector > import_targets_temp; - import_targets_temp.reserve(n_procs); n_import_indices_data = 0; for (unsigned int i=0; i 0) @@ -278,8 +277,8 @@ namespace Utilities import_targets_temp.push_back(std::pair (i, receive_buffer[i])); } - - import_targets_data = std::move(import_targets_temp); + // copy, don't move, to get deterministic memory usage. + import_targets_data = import_targets_temp; } // send and receive indices for import data. non-blocking receives and -- 2.39.5