From ddd947bf0a6a7f5f9d9aa1ee7844de871f28b9ba Mon Sep 17 00:00:00 2001 From: Markus Blatt Date: Tue, 12 May 2020 19:06:12 +0200 Subject: [PATCH] Use correct matrix for flexible solver when parallel. In this case matrix_ is a nullptr and noGhostMat_ is the optimized matrix to use. Before this commit we experienced a segmentation fault as the nullptr was dereferenced and passed to the solver. --- opm/simulators/linalg/ISTLSolverEbos.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/opm/simulators/linalg/ISTLSolverEbos.hpp b/opm/simulators/linalg/ISTLSolverEbos.hpp index 91f89dcc1..ab0078a27 100644 --- a/opm/simulators/linalg/ISTLSolverEbos.hpp +++ b/opm/simulators/linalg/ISTLSolverEbos.hpp @@ -892,7 +892,8 @@ protected: if (recreate_solver || !flexibleSolver_) { if (isParallel()) { #if HAVE_MPI - flexibleSolver_.reset(new FlexibleSolverType(prm_, *matrix_, weightsCalculator, *comm_)); + assert(noGhostMat_); + flexibleSolver_.reset(new FlexibleSolverType(prm_, *noGhostMat_, weightsCalculator, *comm_)); #endif } else { flexibleSolver_.reset(new FlexibleSolverType(prm_, *matrix_, weightsCalculator));