Ensure logging only on first rank.

This commit is contained in:
Atgeirr Flø Rasmussen
2016-10-17 13:28:43 +02:00
parent ad6b77cc15
commit 83b3d8a149

View File

@@ -291,7 +291,12 @@ namespace Opm {
{
// increase restart counter
if( restarts >= solver_restart_max_ ) {
OPM_THROW(Opm::NumericalProblem,"Solver failed to converge after " << restarts << " restarts.");
const auto msg = std::string("Solver failed to converge after ")
+ std::to_string(restarts) + " restarts.";
if (solver_verbose_) {
OpmLog::error(msg);
}
OPM_THROW_NOLOG(Opm::NumericalProblem, msg);
}
const double newTimeStep = restart_factor_ * dt;