]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix ConsensusAlgorithm_NBX 8930/head
authorPeter Munch <peterrmuench@gmail.com>
Fri, 18 Oct 2019 21:44:32 +0000 (23:44 +0200)
committerPeter Munch <peterrmuench@gmail.com>
Mon, 21 Oct 2019 07:23:09 +0000 (09:23 +0200)
include/deal.II/base/mpi.h
source/base/mpi.cc

index e144aea01e07154ee86ddb168f46e82f9e458699..294994e744ecc84fcbf93f2bdbe4870c1d247628 100644 (file)
@@ -941,12 +941,12 @@ namespace Utilities
       /**
        * Buffers for sending answers to requests.
        */
-      std::vector<std::vector<T2>> request_buffers;
+      std::vector<std::unique_ptr<std::vector<T2>>> request_buffers;
 
       /**
        * Requests for sending answers to requests.
        */
-      std::vector<std::shared_ptr<MPI_Request>> request_requests;
+      std::vector<std::unique_ptr<MPI_Request>> request_requests;
 
       // request for barrier
       MPI_Request barrier_request;
index 0050303b5f3d01a99ed8d16d2f369a3ab1ae21fa..0e05f412cedf1e6806597d4bff3ef3ef38d13b75 100644 (file)
@@ -1011,11 +1011,12 @@ namespace Utilities
           AssertThrowMPI(ierr);
 
           // allocate memory for answer message
-          request_buffers.emplace_back();
-          request_requests.emplace_back(new MPI_Request);
+          request_buffers.emplace_back(
+            std_cxx14::make_unique<std::vector<T2>>());
+          request_requests.emplace_back(std_cxx14::make_unique<MPI_Request>());
 
           // process request
-          auto &request_buffer = request_buffers.back();
+          auto &request_buffer = *request_buffers.back();
           this->process.process_request(other_rank,
                                         buffer_recv,
                                         request_buffer);

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.