From 4c72af95462a5a1dc8af35f7a5a81706ed570059 Mon Sep 17 00:00:00 2001 From: Markus Blatt Date: Tue, 12 May 2020 18:06:20 +0200 Subject: [PATCH] Make only rank zero honor verbosity in flexible solvers. Previously all the ranks print linear solver statistics in verbose mode which cluttered the output in parallel runs. Now only rank 0 will print like it should be. --- opm/simulators/linalg/FlexibleSolver.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/opm/simulators/linalg/FlexibleSolver.hpp b/opm/simulators/linalg/FlexibleSolver.hpp index 2d8bda743..f18039e98 100644 --- a/opm/simulators/linalg/FlexibleSolver.hpp +++ b/opm/simulators/linalg/FlexibleSolver.hpp @@ -143,11 +143,11 @@ private: scalarproduct_ = std::make_shared>(); } - void initSolver(const boost::property_tree::ptree& prm) + void initSolver(const boost::property_tree::ptree& prm, bool isMaster) { const double tol = prm.get("tol", 1e-2); const int maxiter = prm.get("maxiter", 200); - const int verbosity = prm.get("verbosity", 0); + const int verbosity = isMaster? prm.get("verbosity", 0) : 0; const std::string solver_type = prm.get("solver", "bicgstab"); if (solver_type == "bicgstab") { linsolver_.reset(new Dune::BiCGSTABSolver(*linearoperator_, @@ -190,7 +190,7 @@ private: const std::function weightsCalculator, const Comm& comm) { initOpPrecSp(matrix, prm, weightsCalculator, comm); - initSolver(prm); + initSolver(prm, comm.communicator().rank()==0); } std::shared_ptr linearoperator_;