From 5d1eff51070a6f650d62758c0e98728080aa15bf Mon Sep 17 00:00:00 2001 From: Markus Blatt Date: Thu, 7 Sep 2017 14:14:49 +0000 Subject: [PATCH 1/2] Log debug messages about wells only on master. Previously all ranks logged the message and did clutter the output files quite a bit. --- opm/autodiff/StandardWellsDense_impl.hpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/opm/autodiff/StandardWellsDense_impl.hpp b/opm/autodiff/StandardWellsDense_impl.hpp index 84d47d00d..99e3e0431 100644 --- a/opm/autodiff/StandardWellsDense_impl.hpp +++ b/opm/autodiff/StandardWellsDense_impl.hpp @@ -451,9 +451,13 @@ namespace Opm { } while (it < 15); if (converged) { - OpmLog::debug("Well equation solution gets converged with " + std::to_string(it) + " iterations"); + if ( terminal_output_ ) { + OpmLog::debug("Well equation solution gets converged with " + std::to_string(it) + " iterations"); + } } else { - OpmLog::debug("Well equation solution failed in getting converged with " + std::to_string(it) + " iterations"); + if ( terminal_output_ ) { + OpmLog::debug("Well equation solution failed in getting converged with " + std::to_string(it) + " iterations"); + } well_state = well_state0; updatePrimaryVariables(well_state); @@ -496,7 +500,9 @@ namespace Opm { if (nan_residual_found) { for (const auto& well : report.nan_residual_wells) { - OpmLog::debug("NaN residual found with phase " + well.phase_name + " for well " + well.well_name); + if ( terminal_output_ ) { + OpmLog::debug("NaN residual found with phase " + well.phase_name + " for well " + well.well_name); + } } OPM_THROW(Opm::NumericalProblem, "NaN residual found!"); } @@ -511,7 +517,9 @@ namespace Opm { too_large_residual_found = grid.comm().max(value); if (too_large_residual_found) { for (const auto& well : report.too_large_residual_wells) { - OpmLog::debug("Too large residual found with phase " + well.phase_name + " fow well " + well.well_name); + if ( terminal_output_ ) { + OpmLog::debug("Too large residual found with phase " + well.phase_name + " fow well " + well.well_name); + } } OPM_THROW(Opm::NumericalProblem, "Too large residual found!"); } From a1f960b4675c06951e932a3dcc2494eb4cbe6afb Mon Sep 17 00:00:00 2001 From: Markus Blatt Date: Thu, 7 Sep 2017 14:45:00 +0000 Subject: [PATCH 2/2] Reallow logging fatal errors for well convergence on all ranks --- opm/autodiff/StandardWellsDense_impl.hpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/opm/autodiff/StandardWellsDense_impl.hpp b/opm/autodiff/StandardWellsDense_impl.hpp index 99e3e0431..295add6ac 100644 --- a/opm/autodiff/StandardWellsDense_impl.hpp +++ b/opm/autodiff/StandardWellsDense_impl.hpp @@ -500,9 +500,7 @@ namespace Opm { if (nan_residual_found) { for (const auto& well : report.nan_residual_wells) { - if ( terminal_output_ ) { - OpmLog::debug("NaN residual found with phase " + well.phase_name + " for well " + well.well_name); - } + OpmLog::debug("NaN residual found with phase " + well.phase_name + " for well " + well.well_name); } OPM_THROW(Opm::NumericalProblem, "NaN residual found!"); } @@ -517,9 +515,7 @@ namespace Opm { too_large_residual_found = grid.comm().max(value); if (too_large_residual_found) { for (const auto& well : report.too_large_residual_wells) { - if ( terminal_output_ ) { - OpmLog::debug("Too large residual found with phase " + well.phase_name + " fow well " + well.well_name); - } + OpmLog::debug("Too large residual found with phase " + well.phase_name + " fow well " + well.well_name); } OPM_THROW(Opm::NumericalProblem, "Too large residual found!"); }