From 047ae8f44490143fa8f68497c5e34666f41b30c2 Mon Sep 17 00:00:00 2001 From: Markus Blatt Date: Mon, 4 Jul 2016 13:46:29 +0200 Subject: [PATCH] Use termininal_output_ to only print time step status once for parallel runs. Previously each process printed this to the terminal --- opm/autodiff/SimulatorBase_impl.hpp | 40 +++++++++++++++++------------ 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/opm/autodiff/SimulatorBase_impl.hpp b/opm/autodiff/SimulatorBase_impl.hpp index ac92c1557..4ca654349 100644 --- a/opm/autodiff/SimulatorBase_impl.hpp +++ b/opm/autodiff/SimulatorBase_impl.hpp @@ -180,14 +180,18 @@ namespace Opm auto solver = asImpl().createSolver(well_model); std::ostringstream step_msg; - boost::posix_time::time_facet* facet = new boost::posix_time::time_facet("%d-%b-%Y"); - step_msg.imbue(std::locale(std::locale::classic(), facet)); - step_msg << "\nTime step " << std::setw(4) <step(timer.currentStepLength(), state, well_state); - std::ostringstream iter_msg; - iter_msg << "Stepsize " << (double)unit::convert::to(timer.currentStepLength(), unit::day); - if (solver->wellIterations() != std::numeric_limits::min()) { - iter_msg << " days well iterations = " << solver->wellIterations() << ", "; + + if( terminal_output_ ) + { + std::ostringstream iter_msg; + iter_msg << "Stepsize " << (double)unit::convert::to(timer.currentStepLength(), unit::day); + if (solver->wellIterations() != std::numeric_limits::min()) { + iter_msg << " days well iterations = " << solver->wellIterations() << ", "; + } + iter_msg << "non-linear iterations = " << solver->nonlinearIterations() + << ", total linear iterations = " << solver->linearIterations() + << "\n"; + OpmLog::info(iter_msg.str()); } - iter_msg << "non-linear iterations = " << solver->nonlinearIterations() - << ", total linear iterations = " << solver->linearIterations() - << "\n"; - OpmLog::info(iter_msg.str()); } // update the derived geology (transmissibilities, pore volumes, etc) if the