fixed: build without MPI

This commit is contained in:
Arne Morten Kvarving 2020-03-13 16:01:02 +01:00
parent c0938e74f4
commit c40c733a57
4 changed files with 14 additions and 7 deletions

View File

@ -37,7 +37,6 @@ list (APPEND MAIN_SOURCE_FILES
opm/simulators/utils/DeferredLogger.cpp
opm/simulators/utils/gatherDeferredLogger.cpp
opm/simulators/utils/moduleVersion.cpp
opm/simulators/utils/ParallelEclipseState.cpp
opm/simulators/utils/ParallelRestart.cpp
opm/simulators/wells/VFPProdProperties.cpp
opm/simulators/wells/VFPInjProperties.cpp
@ -46,6 +45,9 @@ list (APPEND MAIN_SOURCE_FILES
if(CUDA_FOUND)
list (APPEND MAIN_SOURCE_FILES opm/simulators/linalg/bda/cusparseSolverBackend.cu)
endif()
if(MPI_FOUND)
list(APPEND MAIN_SOURCE_FILES opm/simulators/utils/ParallelEclipseState.cpp)
endif()
# originally generated with the command:
# find tests -name '*.cpp' -a ! -wholename '*/not-unit/*' -printf '\t%p\n' | sort
@ -68,12 +70,12 @@ list (APPEND TEST_SOURCE_FILES
tests/test_stoppedwells.cpp
tests/test_relpermdiagnostics.cpp
tests/test_norne_pvt.cpp
tests/test_ParallelRestart.cpp
tests/test_wellstatefullyimplicitblackoil.cpp
)
if(MPI_FOUND)
list(APPEND TEST_SOURCE_FILES tests/test_parallelistlinformation.cpp)
list(APPEND TEST_SOURCE_FILES tests/test_parallelistlinformation.cpp
tests/test_ParallelRestart.cpp)
endif()
list (APPEND TEST_DATA_FILES

View File

@ -53,7 +53,6 @@
#endif
#include "eclwellmanager.hh"
#include "eclequilinitializer.hh"
#include "eclmpiserializer.hh"
#include "eclwriter.hh"
#include "ecloutputblackoilmodule.hh"
#include "ecltransmissibility.hh"

View File

@ -20,8 +20,6 @@
*/
#include "config.h"
#include <ebos/eclmpiserializer.hh>
#include <flow/flow_ebos_blackoil.hpp>
#ifndef FLOW_BLACKOIL_ONLY
@ -39,7 +37,6 @@
#include <opm/simulators/flow/SimulatorFullyImplicitBlackoilEbos.hpp>
#include <opm/simulators/flow/FlowMainEbos.hpp>
#include <opm/simulators/utils/moduleVersion.hpp>
#include <opm/simulators/utils/ParallelEclipseState.hpp>
#include <opm/models/utils/propertysystem.hh>
#include <opm/models/utils/parametersystem.hh>
#include <opm/simulators/flow/MissingFeatures.hpp>
@ -71,6 +68,11 @@
#include <dune/common/parallel/mpihelper.hh>
#endif
#if HAVE_MPI
#include <ebos/eclmpiserializer.hh>
#include <opm/simulators/utils/ParallelEclipseState.hpp>
#endif
BEGIN_PROPERTIES
// this is a dummy type tag that is used to setup the parameters before the actual

View File

@ -451,13 +451,17 @@ namespace Opm
if (FluidSystem::numActivePhases() > 1) {
RelpermDiagnostics diagnostic;
if (mpi_size_ > 1) {
#if HAVE_MPI
this->grid().switchToGlobalView();
static_cast<ParallelEclipseState&>(this->eclState()).switchToGlobalProps();
#endif
}
diagnostic.diagnosis(eclState(), deck(), this->grid());
if (mpi_size_ > 1) {
#if HAVE_MPI
this->grid().switchToDistributedView();
static_cast<ParallelEclipseState&>(this->eclState()).switchToDistributedProps();
#endif
}
}
}