Use Communication instead of CollectiveCommunication for DUNE>=2.7.

The later is removed in 2.9.
This commit is contained in:
Markus Blatt
2022-10-10 21:58:46 +02:00
parent f137d15c65
commit b9b6f7defd
3 changed files with 36 additions and 4 deletions

View File

@@ -47,9 +47,24 @@
#include <string>
#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; \
try { code; } \
catch (const Dune::Exception& e) { \