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:
parent
70fcb864a0
commit
cd63cc83c2
@ -306,14 +306,8 @@ std::unique_ptr<Matrix> blockJacobiAdjacency(const Grid& grid,
|
||||
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);
|
||||
#if HAVE_MPI
|
||||
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") {
|
||||
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();
|
||||
}
|
||||
|
||||
|
@ -182,7 +182,15 @@ public:
|
||||
{
|
||||
OPM_TIMEBLOCK(prepare);
|
||||
[[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);
|
||||
}
|
||||
|
||||
#if HAVE_OPENCL
|
||||
// update matrix entries for solvers.
|
||||
|
Loading…
Reference in New Issue
Block a user