mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Remove redundant cpu decomposition when using gpu
This commit is contained in:
@@ -306,14 +306,8 @@ std::unique_ptr<Matrix> blockJacobiAdjacency(const Grid& grid,
|
|||||||
return flexibleSolver_.size();
|
return flexibleSolver_.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
void prepare(const SparseMatrixAdapter& M, Vector& b)
|
void initPrepare(const Matrix& M, Vector& b)
|
||||||
{
|
{
|
||||||
prepare(M.istlMatrix(), b);
|
|
||||||
}
|
|
||||||
|
|
||||||
void prepare(const Matrix& M, Vector& b)
|
|
||||||
{
|
|
||||||
OPM_TIMEBLOCK(istlSolverEbosPrepare);
|
|
||||||
const bool firstcall = (matrix_ == nullptr);
|
const bool firstcall = (matrix_ == nullptr);
|
||||||
#if HAVE_MPI
|
#if HAVE_MPI
|
||||||
if (firstcall && isParallel()) {
|
if (firstcall && isParallel()) {
|
||||||
@@ -344,6 +338,19 @@ std::unique_ptr<Matrix> blockJacobiAdjacency(const Grid& grid,
|
|||||||
if (isParallel() && prm_[activeSolverNum_].template get<std::string>("preconditioner.type") != "ParOverILU0") {
|
if (isParallel() && prm_[activeSolverNum_].template get<std::string>("preconditioner.type") != "ParOverILU0") {
|
||||||
detail::makeOverlapRowsInvalid(getMatrix(), overlapRows_);
|
detail::makeOverlapRowsInvalid(getMatrix(), overlapRows_);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void prepare(const SparseMatrixAdapter& M, Vector& b)
|
||||||
|
{
|
||||||
|
prepare(M.istlMatrix(), b);
|
||||||
|
}
|
||||||
|
|
||||||
|
void prepare(const Matrix& M, Vector& b)
|
||||||
|
{
|
||||||
|
OPM_TIMEBLOCK(istlSolverEbosPrepare);
|
||||||
|
|
||||||
|
initPrepare(M,b);
|
||||||
|
|
||||||
prepareFlexibleSolver();
|
prepareFlexibleSolver();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -182,7 +182,15 @@ public:
|
|||||||
{
|
{
|
||||||
OPM_TIMEBLOCK(prepare);
|
OPM_TIMEBLOCK(prepare);
|
||||||
[[maybe_unused]] const bool firstcall = (this->matrix_ == nullptr);
|
[[maybe_unused]] const bool firstcall = (this->matrix_ == nullptr);
|
||||||
|
|
||||||
|
// Avoid performing the decomposition on CPU when we also do it on GPU, but we do
|
||||||
|
// need to initialize the pointers.
|
||||||
|
if(bdaBridge_){
|
||||||
|
ParentType::initPrepare(M,b);
|
||||||
|
}
|
||||||
|
else {
|
||||||
ParentType::prepare(M,b);
|
ParentType::prepare(M,b);
|
||||||
|
}
|
||||||
|
|
||||||
#if HAVE_OPENCL
|
#if HAVE_OPENCL
|
||||||
// update matrix entries for solvers.
|
// update matrix entries for solvers.
|
||||||
|
|||||||
Reference in New Issue
Block a user