From 932e3c8fb966de4abb7302cd4c5aab92e310fbb6 Mon Sep 17 00:00:00 2001 From: Markus Blatt Date: Mon, 7 Dec 2020 11:44:10 +0100 Subject: [PATCH] Use a custom handle for copying doubles for above. The one previously used is unfortunately protected upstream (not noticed with gcc <=8). --- opm/simulators/wells/ParallelWellInfo.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/opm/simulators/wells/ParallelWellInfo.cpp b/opm/simulators/wells/ParallelWellInfo.cpp index 4dc653b13..5e8964406 100644 --- a/opm/simulators/wells/ParallelWellInfo.cpp +++ b/opm/simulators/wells/ParallelWellInfo.cpp @@ -90,6 +90,20 @@ void CommunicateAbove::endReset() #endif } +struct CopyGatherScatter +{ + static const double& gather(const double* a, std::size_t i) + { + return a[i]; + } + + static void scatter(double* a, const double& v, std::size_t i) + { + a[i] = v; + } +}; + + std::vector CommunicateAbove::communicate(double first_above, const double* current, std::size_t size) @@ -99,13 +113,12 @@ std::vector CommunicateAbove::communicate(double first_above, #if HAVE_MPI if (comm_.size() > 1) { - using Handle = Dune::OwnerOverlapCopyCommunication::CopyGatherScatter; auto aboveData = above.data(); // Ugly const_cast needed as my compiler says, that // passing const double*& and double* as parameter is // incompatible with function decl template forward(const Data&, Data&)) // That would need the first argument to be double* const& - communicator_.forward(const_cast(current), aboveData); + communicator_.forward(const_cast(current), aboveData); } else #endif