mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-12-28 18:21:00 -06:00
Disable GPU when using MPI
This commit is contained in:
parent
d067c08be7
commit
ce73337769
@ -236,8 +236,13 @@ protected:
|
||||
converged_(false)
|
||||
{
|
||||
parameters_.template init<TypeTag>();
|
||||
const auto& gridForConn = simulator_.vanguard().grid();
|
||||
#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 double tolerance = EWOMS_GET_PARAM(TypeTag, double, LinearSolverReduction);
|
||||
const int linear_solver_verbosity = parameters_.linear_solver_verbosity_;
|
||||
@ -249,7 +254,6 @@ protected:
|
||||
}
|
||||
#endif
|
||||
extractParallelGridInformationToISTL(simulator_.vanguard().grid(), parallelInformation_);
|
||||
const auto& gridForConn = simulator_.vanguard().grid();
|
||||
const auto wellsForConn = simulator_.vanguard().schedule().getWellsatEnd();
|
||||
const bool useWellConn = EWOMS_GET_PARAM(TypeTag, bool, MatrixAddWellContributions);
|
||||
|
||||
@ -440,7 +444,7 @@ protected:
|
||||
#if HAVE_CUDA
|
||||
WellContributions wellContribs;
|
||||
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)
|
||||
{
|
||||
simulator_.problem().wellModel().getWellContributions(wellContribs);
|
||||
|
@ -69,6 +69,12 @@ public:
|
||||
template <class BridgeVector>
|
||||
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
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user