Add isIORank_ member to avoid repeated calls.

This commit is contained in:
Atgeirr Flø Rasmussen 2016-10-19 12:45:48 +02:00
parent e4731fc14d
commit a2c9e64291

View File

@ -174,6 +174,7 @@ namespace Opm
const boost::any& parallelInformation_arg=boost::any()) const boost::any& parallelInformation_arg=boost::any())
: iterations_( 0 ), : iterations_( 0 ),
parallelInformation_(parallelInformation_arg), parallelInformation_(parallelInformation_arg),
isIORank_(isIORank(parallelInformation_arg)),
parameters_( param ) parameters_( param )
{ {
} }
@ -488,7 +489,7 @@ namespace Opm
// Check for failure of linear solver. // Check for failure of linear solver.
if (!parameters_.ignoreConvergenceFailure_ && !result.converged) { if (!parameters_.ignoreConvergenceFailure_ && !result.converged) {
const std::string msg("Convergence failure for linear solver."); const std::string msg("Convergence failure for linear solver.");
if (isIORank(parallelInformation_)) { if (isIORank_) {
OpmLog::problem(msg); OpmLog::problem(msg);
} }
OPM_THROW_NOLOG(LinearSolverProblem, msg); OPM_THROW_NOLOG(LinearSolverProblem, msg);
@ -513,6 +514,7 @@ namespace Opm
protected: protected:
mutable int iterations_; mutable int iterations_;
boost::any parallelInformation_; boost::any parallelInformation_;
bool isIORank_;
NewtonIterationBlackoilInterleavedParameters parameters_; NewtonIterationBlackoilInterleavedParameters parameters_;
}; // end NewtonIterationBlackoilInterleavedImpl }; // end NewtonIterationBlackoilInterleavedImpl