mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Disable GPU when using MPI
This commit is contained in:
parent
d067c08be7
commit
ce73337769
@ -236,8 +236,13 @@ protected:
|
|||||||
converged_(false)
|
converged_(false)
|
||||||
{
|
{
|
||||||
parameters_.template init<TypeTag>();
|
parameters_.template init<TypeTag>();
|
||||||
|
const auto& gridForConn = simulator_.vanguard().grid();
|
||||||
#if HAVE_CUDA
|
#if HAVE_CUDA
|
||||||
const bool use_gpu = EWOMS_GET_PARAM(TypeTag, bool, UseGpu);
|
bool use_gpu = EWOMS_GET_PARAM(TypeTag, bool, UseGpu);
|
||||||
|
if (gridForConn.comm().size() > 1 && use_gpu) {
|
||||||
|
OpmLog::warning("Warning cannot use GPU with MPI, GPU is disabled");
|
||||||
|
use_gpu = false;
|
||||||
|
}
|
||||||
const int maxit = EWOMS_GET_PARAM(TypeTag, int, LinearSolverMaxIter);
|
const int maxit = EWOMS_GET_PARAM(TypeTag, int, LinearSolverMaxIter);
|
||||||
const double tolerance = EWOMS_GET_PARAM(TypeTag, double, LinearSolverReduction);
|
const double tolerance = EWOMS_GET_PARAM(TypeTag, double, LinearSolverReduction);
|
||||||
const int linear_solver_verbosity = parameters_.linear_solver_verbosity_;
|
const int linear_solver_verbosity = parameters_.linear_solver_verbosity_;
|
||||||
@ -249,7 +254,6 @@ protected:
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
extractParallelGridInformationToISTL(simulator_.vanguard().grid(), parallelInformation_);
|
extractParallelGridInformationToISTL(simulator_.vanguard().grid(), parallelInformation_);
|
||||||
const auto& gridForConn = simulator_.vanguard().grid();
|
|
||||||
const auto wellsForConn = simulator_.vanguard().schedule().getWellsatEnd();
|
const auto wellsForConn = simulator_.vanguard().schedule().getWellsatEnd();
|
||||||
const bool useWellConn = EWOMS_GET_PARAM(TypeTag, bool, MatrixAddWellContributions);
|
const bool useWellConn = EWOMS_GET_PARAM(TypeTag, bool, MatrixAddWellContributions);
|
||||||
|
|
||||||
@ -440,7 +444,7 @@ protected:
|
|||||||
#if HAVE_CUDA
|
#if HAVE_CUDA
|
||||||
WellContributions wellContribs;
|
WellContributions wellContribs;
|
||||||
const bool addWellContribs = EWOMS_GET_PARAM(TypeTag, bool, MatrixAddWellContributions);
|
const bool addWellContribs = EWOMS_GET_PARAM(TypeTag, bool, MatrixAddWellContributions);
|
||||||
const bool use_gpu = EWOMS_GET_PARAM(TypeTag, bool, UseGpu);
|
const bool use_gpu = bdaBridge->getUseGpu();
|
||||||
if(!addWellContribs && use_gpu)
|
if(!addWellContribs && use_gpu)
|
||||||
{
|
{
|
||||||
simulator_.problem().wellModel().getWellContributions(wellContribs);
|
simulator_.problem().wellModel().getWellContributions(wellContribs);
|
||||||
|
@ -69,6 +69,12 @@ public:
|
|||||||
template <class BridgeVector>
|
template <class BridgeVector>
|
||||||
void get_result(BridgeVector &x);
|
void get_result(BridgeVector &x);
|
||||||
|
|
||||||
|
/// Return whether the BdaBridge will use the GPU or not
|
||||||
|
/// return whether the BdaBridge will use the GPU or not
|
||||||
|
bool getUseGpu(){
|
||||||
|
return use_gpu;
|
||||||
|
}
|
||||||
|
|
||||||
}; // end class BdaBridge
|
}; // end class BdaBridge
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user