mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Use Communication instead of CollectiveCommunication for DUNE>=2.7.
The later is removed in 2.9.
This commit is contained in:
parent
f137d15c65
commit
b9b6f7defd
@ -181,14 +181,22 @@ class NewtonMethod
|
|||||||
using ConvergenceWriter = GetPropType<TypeTag, Properties::NewtonConvergenceWriter>;
|
using ConvergenceWriter = GetPropType<TypeTag, Properties::NewtonConvergenceWriter>;
|
||||||
|
|
||||||
using Communicator = typename Dune::MPIHelper::MPICommunicator;
|
using Communicator = typename Dune::MPIHelper::MPICommunicator;
|
||||||
|
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 7)
|
||||||
|
using CollectiveCommunication = typename Dune::Communication<typename Dune::MPIHelper::MPICommunicator>;
|
||||||
|
#else
|
||||||
using CollectiveCommunication = Dune::CollectiveCommunication<Communicator>;
|
using CollectiveCommunication = Dune::CollectiveCommunication<Communicator>;
|
||||||
|
#endif
|
||||||
|
|
||||||
public:
|
public:
|
||||||
NewtonMethod(Simulator& simulator)
|
NewtonMethod(Simulator& simulator)
|
||||||
: simulator_(simulator)
|
: simulator_(simulator)
|
||||||
, endIterMsgStream_(std::ostringstream::out)
|
, endIterMsgStream_(std::ostringstream::out)
|
||||||
, linearSolver_(simulator)
|
, linearSolver_(simulator)
|
||||||
|
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 7)
|
||||||
, comm_(Dune::MPIHelper::getCommunicator())
|
, comm_(Dune::MPIHelper::getCommunicator())
|
||||||
|
#else
|
||||||
|
, comm_(Dune::MPIHelper::getCollectiveCommunicator())
|
||||||
|
#endif
|
||||||
, convergenceWriter_(asImp_())
|
, convergenceWriter_(asImp_())
|
||||||
{
|
{
|
||||||
lastError_ = 1e100;
|
lastError_ = 1e100;
|
||||||
|
@ -47,9 +47,24 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
#define EWOMS_CATCH_PARALLEL_EXCEPTIONS_FATAL(code) \
|
namespace Opm
|
||||||
|
{
|
||||||
|
namespace detail
|
||||||
|
{
|
||||||
|
inline auto getMPIHelperCommunication()
|
||||||
|
{
|
||||||
|
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 7)
|
||||||
|
return Dune::MPIHelper::getCommunication();
|
||||||
|
#else
|
||||||
|
return Dune::MPIHelper::getCollectiveCommunication();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
} // end namespace detail
|
||||||
|
} // end namespace Opm
|
||||||
|
|
||||||
|
#define EWOMS_CATCH_PARALLEL_EXCEPTIONS_FATAL(code) \
|
||||||
{ \
|
{ \
|
||||||
const auto& comm = Dune::MPIHelper::getCollectiveCommunication(); \
|
const auto& comm = ::Opm::detail::getMPIHelperCommunication(); \
|
||||||
bool exceptionThrown = false; \
|
bool exceptionThrown = false; \
|
||||||
try { code; } \
|
try { code; } \
|
||||||
catch (const Dune::Exception& e) { \
|
catch (const Dune::Exception& e) { \
|
||||||
|
@ -43,8 +43,12 @@ class OverlappingScalarProduct
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
using field_type = typename OverlappingBlockVector::field_type;
|
using field_type = typename OverlappingBlockVector::field_type;
|
||||||
using CollectiveCommunication = typename Dune::CollectiveCommunication<typename Dune::MPIHelper::MPICommunicator>;
|
|
||||||
|
|
||||||
|
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 7)
|
||||||
|
using CollectiveCommunication = typename Dune::Communication<typename Dune::MPIHelper::MPICommunicator>;
|
||||||
|
#else
|
||||||
|
using CollectiveCommunication = typename Dune::CollectiveCommunication<typename Dune::MPIHelper::MPICommunicator>;
|
||||||
|
#endif
|
||||||
using real_type = typename Dune::ScalarProduct<OverlappingBlockVector>::real_type;
|
using real_type = typename Dune::ScalarProduct<OverlappingBlockVector>::real_type;
|
||||||
|
|
||||||
//! the kind of computations supported by the operator. Either overlapping or non-overlapping
|
//! the kind of computations supported by the operator. Either overlapping or non-overlapping
|
||||||
@ -52,7 +56,12 @@ public:
|
|||||||
{ return Dune::SolverCategory::overlapping; }
|
{ return Dune::SolverCategory::overlapping; }
|
||||||
|
|
||||||
OverlappingScalarProduct(const Overlap& overlap)
|
OverlappingScalarProduct(const Overlap& overlap)
|
||||||
: overlap_(overlap), comm_( Dune::MPIHelper::getCollectiveCommunication() )
|
: overlap_(overlap),
|
||||||
|
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 7)
|
||||||
|
comm_( Dune::MPIHelper::getCommunication() )
|
||||||
|
#else
|
||||||
|
comm_( Dune::MPIHelper::getCollectiveCommunication() )
|
||||||
|
#endif
|
||||||
{}
|
{}
|
||||||
|
|
||||||
#if DUNE_VERSION_NEWER(DUNE_ISTL, 2,7)
|
#if DUNE_VERSION_NEWER(DUNE_ISTL, 2,7)
|
||||||
|
Loading…
Reference in New Issue
Block a user