Merge pull request #2612 from blattms/fix-flexible-parallel-verbosity

Make only rank zero honor verbosity in flexible solvers.
This commit is contained in:
Atgeirr Flø Rasmussen 2020-05-13 08:41:01 +02:00 committed by GitHub
commit df58d44f70
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -143,11 +143,11 @@ private:
scalarproduct_ = std::make_shared<Dune::SeqScalarProduct<VectorType>>();
}
void initSolver(const boost::property_tree::ptree& prm)
void initSolver(const boost::property_tree::ptree& prm, bool isMaster)
{
const double tol = prm.get<double>("tol", 1e-2);
const int maxiter = prm.get<int>("maxiter", 200);
const int verbosity = prm.get<int>("verbosity", 0);
const int verbosity = isMaster? prm.get<int>("verbosity", 0) : 0;
const std::string solver_type = prm.get<std::string>("solver", "bicgstab");
if (solver_type == "bicgstab") {
linsolver_.reset(new Dune::BiCGSTABSolver<VectorType>(*linearoperator_,
@ -190,7 +190,7 @@ private:
const std::function<VectorTypeT()> weightsCalculator, const Comm& comm)
{
initOpPrecSp(matrix, prm, weightsCalculator, comm);
initSolver(prm);
initSolver(prm, comm.communicator().rank()==0);
}
std::shared_ptr<AbstractOperatorType> linearoperator_;