From 9e0b2fed4fc2a36c7633a730f75bbfb37f1ada5c Mon Sep 17 00:00:00 2001 From: Markus Blatt Date: Tue, 12 May 2015 16:37:47 +0200 Subject: [PATCH 01/10] Notify well manager whether this is a parallel run. In a parallel the well handling needs to be slightly adapted, see PR OPM/opm-core#799. Therefore, we need to pass a boolean flag to the well manager indicating whether this is a parallel run or not. With this commit we do this. --- opm/autodiff/SimulatorFullyImplicitBlackoil_impl.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/opm/autodiff/SimulatorFullyImplicitBlackoil_impl.hpp b/opm/autodiff/SimulatorFullyImplicitBlackoil_impl.hpp index 2df70b396..17049c307 100644 --- a/opm/autodiff/SimulatorFullyImplicitBlackoil_impl.hpp +++ b/opm/autodiff/SimulatorFullyImplicitBlackoil_impl.hpp @@ -120,6 +120,8 @@ namespace Opm RateConverterType rateConverter_; // Threshold pressures. std::vector threshold_pressures_by_face_; + // Whether this a parallel simulation or not + bool is_parallel_run_; void computeRESV(const std::size_t step, @@ -205,6 +207,7 @@ namespace Opm boost::any_cast(solver_.parallelInformation()); // Only rank 0 does print to std::cout terminal_output_= (info.communicator().rank()==0); + is_parallel_run_ = info.communicator().size(); } } #endif @@ -269,7 +272,8 @@ namespace Opm Opm::UgGridHelpers::dimensions(grid_), Opm::UgGridHelpers::cell2Faces(grid_), Opm::UgGridHelpers::beginFaceCentroids(grid_), - props_.permeability()); + props_.permeability(), + is_parallel_run_); const Wells* wells = wells_manager.c_wells(); WellStateFullyImplicitBlackoil well_state; well_state.init(wells, state, prev_well_state); From 48ce90fcc7f387de792a7b9a406c0cb08545552b Mon Sep 17 00:00:00 2001 From: Markus Blatt Date: Wed, 13 May 2015 12:00:38 +0200 Subject: [PATCH 02/10] Compute scaled well residuals correctly for parallel runs. This commit adapts the PR #375 for parallel runs. That is, the norms are calculated over all wells, not just the ones that perforate the local grid cells. As this is a reduction, too, we move the computation to convergenceReduction method. --- opm/autodiff/FullyImplicitBlackoilSolver.hpp | 6 +++- .../FullyImplicitBlackoilSolver_impl.hpp | 35 ++++++++++++------- 2 files changed, 27 insertions(+), 14 deletions(-) diff --git a/opm/autodiff/FullyImplicitBlackoilSolver.hpp b/opm/autodiff/FullyImplicitBlackoilSolver.hpp index 5fd4dc046..943b540f8 100644 --- a/opm/autodiff/FullyImplicitBlackoilSolver.hpp +++ b/opm/autodiff/FullyImplicitBlackoilSolver.hpp @@ -389,7 +389,9 @@ namespace Opm { /// maximum of tempV for the phase i. /// \param[out] B_avg An array of size MaxNumPhases where entry i contains the average /// of B for the phase i. + /// \param[out] maxNormWell The maximum of the well equations for each phase. /// \param[in] nc The number of cells of the local grid. + /// \param[in] nw The number of wells on the local grid. /// \return The total pore volume over all cells. double convergenceReduction(const Eigen::Array& B, @@ -398,7 +400,9 @@ namespace Opm { std::array& R_sum, std::array& maxCoeff, std::array& B_avg, - int nc) const; + std::vector& maxNormWell, + int nc, + int nw) const; void detectNewtonOscillations(const std::vector>& residual_history, const int it, const double relaxRelTol, diff --git a/opm/autodiff/FullyImplicitBlackoilSolver_impl.hpp b/opm/autodiff/FullyImplicitBlackoilSolver_impl.hpp index d92b4aed0..086b1b9ee 100644 --- a/opm/autodiff/FullyImplicitBlackoilSolver_impl.hpp +++ b/opm/autodiff/FullyImplicitBlackoilSolver_impl.hpp @@ -1834,7 +1834,9 @@ namespace detail { std::array& R_sum, std::array& maxCoeff, std::array& B_avg, - int nc) const + std::vector& maxNormWell, + int nc, + int nw) const { // Do the global reductions #if HAVE_MPI @@ -1862,15 +1864,21 @@ namespace detail { Opm::Reduction::makeGlobalMaxFunctor(), Opm::Reduction::makeGlobalSumFunctor()); info.computeReduction(containers, operators, values); - B_avg[idx] = std::get<0>(values)/std::get<0>(nc_and_pv); - maxCoeff[idx] = std::get<1>(values); - R_sum[idx] = std::get<2>(values); + B_avg[idx] = std::get<0>(values)/std::get<0>(nc_and_pv); + maxCoeff[idx] = std::get<1>(values); + R_sum[idx] = std::get<2>(values); + maxNormWell[idx] = 0.0; + for ( int w=0; w(nc_and_pv); } @@ -1888,6 +1896,11 @@ namespace detail { { R_sum[idx] = B_avg[idx] = maxCoeff[idx] =0.0; } + maxNormWell[idx] = 0.0; + for ( int w=0; w B(nc, cols); Eigen::Array R(nc, cols); Eigen::Array tempV(nc, cols); + std::vector maxNormWell(MaxNumPhases); for ( int idx=0; idx Date: Wed, 13 May 2015 12:14:52 +0200 Subject: [PATCH 03/10] Correctly compute the infinity norm in parallel. For this we need to use ParallelIstlInformation for the reduction operation. --- .../FullyImplicitBlackoilSolver_impl.hpp | 32 +++++++++++++++---- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/opm/autodiff/FullyImplicitBlackoilSolver_impl.hpp b/opm/autodiff/FullyImplicitBlackoilSolver_impl.hpp index 086b1b9ee..4d04ea889 100644 --- a/opm/autodiff/FullyImplicitBlackoilSolver_impl.hpp +++ b/opm/autodiff/FullyImplicitBlackoilSolver_impl.hpp @@ -1254,14 +1254,31 @@ namespace detail { namespace detail { - - double infinityNorm( const ADB& a ) + /// \brief Compute the L-infinity norm of a vector + /// \warn This function is not suitable to compute on the well equations. + /// \param a The container to compute the infinity norm on. + /// It has to have one entry for each cell. + /// \param info In a parallel this holds the information about the data distribution. + double infinityNorm( const ADB& a, const boost::any& pinfo=boost::any() ) { - if( a.value().size() > 0 ) { - return a.value().matrix().lpNorm (); +#if HAVE_MPI + if ( pinfo.type() == typeid(ParallelISTLInformation) ) + { + const ParallelISTLInformation& real_info = + boost::any_cast(pinfo); + double result=0; + real_info.computeReduction(a.value(), Reduction::makeGlobalMaxFunctor(), result); + return result; } - else { // this situation can occur when no wells are present - return 0.0; + else +#endif + { + if( a.value().size() > 0 ) { + return a.value().matrix().lpNorm (); + } + else { // this situation can occur when no wells are present + return 0.0; + } } } @@ -1732,7 +1749,8 @@ namespace detail { const std::vector::const_iterator endMassBalanceIt = residual_.material_balance_eq.end(); for (; massBalanceIt != endMassBalanceIt; ++massBalanceIt) { - const double massBalanceResid = detail::infinityNorm( (*massBalanceIt) ); + const double massBalanceResid = detail::infinityNorm( (*massBalanceIt), + linsolver_.parallelInformation() ); if (!std::isfinite(massBalanceResid)) { OPM_THROW(Opm::NumericalProblem, "Encountered a non-finite residual"); From 523ba001f662b3826507a37e10983137c46d465d Mon Sep 17 00:00:00 2001 From: Markus Blatt Date: Wed, 13 May 2015 12:16:36 +0200 Subject: [PATCH 04/10] Correctly compute the infinity norms of the well equations in parallel. Here we assume that a complete well can be represented on one process. Thus we only need to compute the local norms followed by a global reduction. --- .../FullyImplicitBlackoilSolver_impl.hpp | 29 +++++++++++++++++-- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/opm/autodiff/FullyImplicitBlackoilSolver_impl.hpp b/opm/autodiff/FullyImplicitBlackoilSolver_impl.hpp index 4d04ea889..f734e30a4 100644 --- a/opm/autodiff/FullyImplicitBlackoilSolver_impl.hpp +++ b/opm/autodiff/FullyImplicitBlackoilSolver_impl.hpp @@ -1282,6 +1282,26 @@ namespace detail { } } + /// \brief Compute the L-infinity norm of a vector representing a well equation. + /// \param a The container to compute the infinity norm on. + /// \param info In a parallel this holds the information about the data distribution. + double infinityNormWell( const ADB& a, const boost::any& pinfo ) + { + double result=0; + if( a.value().size() > 0 ) { + result = a.value().matrix().lpNorm (); + } +#if HAVE_MPI + if ( pinfo.type() == typeid(ParallelISTLInformation) ) + { + const ParallelISTLInformation& real_info = + boost::any_cast(pinfo); + result = real_info.communicator().max(result); + } +#endif + return result; + } + } // namespace detail @@ -1759,14 +1779,16 @@ namespace detail { } // the following residuals are not used in the oscillation detection now - const double wellFluxResid = detail::infinityNorm( residual_.well_flux_eq ); + const double wellFluxResid = detail::infinityNormWell( residual_.well_flux_eq, + linsolver_.parallelInformation() ); if (!std::isfinite(wellFluxResid)) { OPM_THROW(Opm::NumericalProblem, "Encountered a non-finite residual"); } residualNorms.push_back(wellFluxResid); - const double wellResid = detail::infinityNorm( residual_.well_eq ); + const double wellResid = detail::infinityNormWell( residual_.well_eq, + linsolver_.parallelInformation() ); if (!std::isfinite(wellResid)) { OPM_THROW(Opm::NumericalProblem, "Encountered a non-finite residual"); @@ -1982,7 +2004,8 @@ namespace detail { converged_Well = converged_Well && (well_flux_residual[idx] < tol_wells); } - const double residualWell = detail::infinityNorm(residual_.well_eq); + const double residualWell = detail::infinityNormWell(residual_.well_eq, + linsolver_.parallelInformation()); converged_Well = converged_Well && (residualWell < Opm::unit::barsa); const bool converged = converged_MB && converged_CNV && converged_Well; From d987e75b6d5a488e8dec414a619c886deaa729b2 Mon Sep 17 00:00:00 2001 From: Markus Blatt Date: Tue, 19 May 2015 19:40:11 +0200 Subject: [PATCH 05/10] Rename createPreconditioner to the more accurate name createEllipticPreconditioner. --- opm/autodiff/CPRPreconditioner.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opm/autodiff/CPRPreconditioner.hpp b/opm/autodiff/CPRPreconditioner.hpp index 56cffe7e5..a2cc64f53 100644 --- a/opm/autodiff/CPRPreconditioner.hpp +++ b/opm/autodiff/CPRPreconditioner.hpp @@ -386,7 +386,7 @@ createEllipticPreconditionerPointer(const M& Ae, double relax, comm_(comm) { // create appropriate preconditioner for elliptic system - createPreconditioner( param_.cpr_use_amg_, comm ); + createEllipticPreconditioner( param_.cpr_use_amg_, comm ); if( param_.cpr_ilu_n_ == 0 ) { pre_ = createILU0Ptr( A_, param_.cpr_relax_, comm ); @@ -537,7 +537,7 @@ createEllipticPreconditionerPointer(const M& Ae, double relax, //! \brief The information about the parallelization const P& comm_; protected: - void createPreconditioner( const bool amg, const P& comm ) + void createEllipticPreconditioner( const bool amg, const P& comm ) { if( amg ) { From cb4970c9a69046fb354edf50e42d8106da2cc36b Mon Sep 17 00:00:00 2001 From: Markus Blatt Date: Tue, 19 May 2015 19:40:59 +0200 Subject: [PATCH 06/10] Prevent unused paramerter warning for RedistributeDatahandle. --- opm/autodiff/RedistributeDataHandles.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opm/autodiff/RedistributeDataHandles.hpp b/opm/autodiff/RedistributeDataHandles.hpp index 29617014e..eee180af4 100644 --- a/opm/autodiff/RedistributeDataHandles.hpp +++ b/opm/autodiff/RedistributeDataHandles.hpp @@ -71,7 +71,7 @@ public: } } template - void scatter(B& buffer, const T& e, std::size_t size) + void scatter(B& buffer, const T& e, std::size_t /* size */) { assert( T::codimension == 0); double val; From 764e1e26c111af24616778ab1c0de58e02f20bb3 Mon Sep 17 00:00:00 2001 From: Markus Blatt Date: Tue, 19 May 2015 19:41:32 +0200 Subject: [PATCH 07/10] Used the correct parallel information for the whole system. The whole system consists out of three equations per cell. Using the parallel index set of the grid cells for it is wrong. Therefore we use PR OPM/opm-core#803 to set up an additional parallel index set for the whole system and use this for the communication that is needed e.g. by the ILU preconditioner. --- opm/autodiff/CPRPreconditioner.hpp | 24 ++++++++++++++------- opm/autodiff/NewtonIterationBlackoilCPR.cpp | 9 +++++--- opm/autodiff/NewtonIterationBlackoilCPR.hpp | 4 +++- 3 files changed, 25 insertions(+), 12 deletions(-) diff --git a/opm/autodiff/CPRPreconditioner.hpp b/opm/autodiff/CPRPreconditioner.hpp index a2cc64f53..955e2b09e 100644 --- a/opm/autodiff/CPRPreconditioner.hpp +++ b/opm/autodiff/CPRPreconditioner.hpp @@ -371,28 +371,31 @@ createEllipticPreconditionerPointer(const M& Ae, double relax, parallel run */ CPRPreconditioner (const CPRParameter& param, const M& A, const M& Ae, - const ParallelInformation& comm=ParallelInformation()) + const ParallelInformation& comm=ParallelInformation(), + const ParallelInformation& commAe=ParallelInformation()) : param_( param ), A_(A), Ae_(Ae), de_( Ae_.N() ), ve_( Ae_.M() ), dmodified_( A_.N() ), - opAe_(CPRSelector::makeOperator(Ae_, comm)), + opAe_(CPRSelector::makeOperator(Ae_, commAe)), precond_(), // ilu0 preconditioner for elliptic system amg_(), // amg preconditioner for elliptic system pre_(), // copy A will be made be the preconditioner vilu_( A_.N() ), - comm_(comm) + comm_(comm), + commAe_(commAe) { // create appropriate preconditioner for elliptic system - createEllipticPreconditioner( param_.cpr_use_amg_, comm ); + createEllipticPreconditioner( param_.cpr_use_amg_, commAe_ ); + // create the preconditioner for the whole system. if( param_.cpr_ilu_n_ == 0 ) { - pre_ = createILU0Ptr( A_, param_.cpr_relax_, comm ); + pre_ = createILU0Ptr( A_, param_.cpr_relax_, comm_ ); } else { - pre_ = createILUnPtr( A_, param_.cpr_ilu_n_, param_.cpr_relax_, comm ); + pre_ = createILUnPtr( A_, param_.cpr_ilu_n_, param_.cpr_relax_, comm_ ); } } @@ -430,6 +433,8 @@ createEllipticPreconditionerPointer(const M& Ae, double relax, // dmodified = d - A * vfull dmodified_ = d; A_.mmv(v, dmodified_); + // A is not parallel, do communication manually. + comm_.copyOwnerToAll(dmodified_, dmodified_); // Apply Preconditioner for whole system (relax will be applied already) pre_->apply( vilu_, dmodified_); @@ -470,7 +475,7 @@ createEllipticPreconditionerPointer(const M& Ae, double relax, ScalarProductChooser; // the scalar product. std::unique_ptr - sp(ScalarProductChooser::construct(comm_)); + sp(ScalarProductChooser::construct(commAe_)); if( amg_ ) { @@ -534,8 +539,11 @@ createEllipticPreconditionerPointer(const M& Ae, double relax, //! \brief temporary variables for ILU solve Y vilu_; - //! \brief The information about the parallelization + //! \brief The information about the parallelization of the whole system. const P& comm_; + //! \brief The information about the parallelization of the elliptic part + //! of the system + const P& commAe_; protected: void createEllipticPreconditioner( const bool amg, const P& comm ) { diff --git a/opm/autodiff/NewtonIterationBlackoilCPR.cpp b/opm/autodiff/NewtonIterationBlackoilCPR.cpp index f38c85e5f..63c872c40 100644 --- a/opm/autodiff/NewtonIterationBlackoilCPR.cpp +++ b/opm/autodiff/NewtonIterationBlackoilCPR.cpp @@ -188,11 +188,14 @@ namespace Opm const ParallelISTLInformation& info = boost::any_cast( parallelInformation_); Comm istlComm(info.communicator()); - info.copyValuesTo(istlComm.indexSet(), istlComm.remoteIndices()); + Comm istlAeComm(info.communicator()); + info.copyValuesTo(istlAeComm.indexSet(), istlAeComm.remoteIndices()); + info.copyValuesTo(istlComm.indexSet(), istlComm.remoteIndices(), + istlAe.N(), istlA.N()/istlAe.N()); // Construct operator, scalar product and vectors needed. typedef Dune::OverlappingSchwarzOperator Operator; Operator opA(istlA, istlComm); - constructPreconditionerAndSolve(opA, istlAe, x, istlb, istlComm, result); + constructPreconditionerAndSolve(opA, istlAe, x, istlb, istlComm, istlAeComm, result); } else #endif @@ -201,7 +204,7 @@ namespace Opm typedef Dune::MatrixAdapter Operator; Operator opA(istlA); Dune::Amg::SequentialInformation info; - constructPreconditionerAndSolve(opA, istlAe, x, istlb, info, result); + constructPreconditionerAndSolve(opA, istlAe, x, istlb, info, info, result); } // store number of iterations diff --git a/opm/autodiff/NewtonIterationBlackoilCPR.hpp b/opm/autodiff/NewtonIterationBlackoilCPR.hpp index eb42ea16b..393b569b3 100644 --- a/opm/autodiff/NewtonIterationBlackoilCPR.hpp +++ b/opm/autodiff/NewtonIterationBlackoilCPR.hpp @@ -85,6 +85,7 @@ namespace Opm void constructPreconditionerAndSolve(O& opA, DuneMatrix& istlAe, Vector& x, Vector& istlb, const P& parallelInformation, + const P& parallelInformationAe, Dune::InverseOperatorResult& result) const { typedef Dune::ScalarProductChooser ScalarProductChooser; @@ -94,7 +95,8 @@ namespace Opm // typedef Dune::SeqILU0 Preconditioner; typedef Opm::CPRPreconditioner Preconditioner; parallelInformation.copyOwnerToAll(istlb, istlb); - Preconditioner precond(cpr_param_, opA.getmat(), istlAe, parallelInformation); + Preconditioner precond(cpr_param_, opA.getmat(), istlAe, parallelInformation, + parallelInformationAe); // TODO: Revise when linear solvers interface opm-core is done // Construct linear solver. From 11211ca7d2bcdb1beaf719bf409ab1237585391d Mon Sep 17 00:00:00 2001 From: Markus Blatt Date: Wed, 20 May 2015 09:26:25 +0200 Subject: [PATCH 08/10] Update copyright notices --- opm/autodiff/CPRPreconditioner.hpp | 1 + opm/autodiff/FullyImplicitBlackoilSolver.hpp | 3 +++ opm/autodiff/FullyImplicitBlackoilSolver_impl.hpp | 3 ++- opm/autodiff/NewtonIterationBlackoilCPR.cpp | 1 + opm/autodiff/NewtonIterationBlackoilCPR.hpp | 3 +++ opm/autodiff/RedistributeDataHandles.hpp | 1 + 6 files changed, 11 insertions(+), 1 deletion(-) diff --git a/opm/autodiff/CPRPreconditioner.hpp b/opm/autodiff/CPRPreconditioner.hpp index 955e2b09e..91a5962de 100644 --- a/opm/autodiff/CPRPreconditioner.hpp +++ b/opm/autodiff/CPRPreconditioner.hpp @@ -3,6 +3,7 @@ Copyright 2014 IRIS AS. Copyright 2015 Dr. Blatt - HPC-Simulation-Software & Services Copyright 2015 NTNU + Copyright 2015 Statoil AS This file is part of the Open Porous Media project (OPM). diff --git a/opm/autodiff/FullyImplicitBlackoilSolver.hpp b/opm/autodiff/FullyImplicitBlackoilSolver.hpp index 943b540f8..f67e38b30 100644 --- a/opm/autodiff/FullyImplicitBlackoilSolver.hpp +++ b/opm/autodiff/FullyImplicitBlackoilSolver.hpp @@ -1,5 +1,8 @@ /* Copyright 2013 SINTEF ICT, Applied Mathematics. + Copyright 2014, 2015 Dr. Markus Blatt - HPC-Simulation-Software & Services + Copyright 2014, 2015 Statoil AS + Copyright 2015 NTNU This file is part of the Open Porous Media project (OPM). diff --git a/opm/autodiff/FullyImplicitBlackoilSolver_impl.hpp b/opm/autodiff/FullyImplicitBlackoilSolver_impl.hpp index f734e30a4..5362d142a 100644 --- a/opm/autodiff/FullyImplicitBlackoilSolver_impl.hpp +++ b/opm/autodiff/FullyImplicitBlackoilSolver_impl.hpp @@ -1,6 +1,7 @@ /* Copyright 2013 SINTEF ICT, Applied Mathematics. - Copyright 2015 Dr. Blatt - HPC-Simulation-Software & Services + Copyright 2014, 2015 Dr. Blatt - HPC-Simulation-Software & Services + Copyright 2014, 2015 Statoil AS Copyright 2015 NTNU Copyright 2015 IRIS AS diff --git a/opm/autodiff/NewtonIterationBlackoilCPR.cpp b/opm/autodiff/NewtonIterationBlackoilCPR.cpp index 63c872c40..ba920acac 100644 --- a/opm/autodiff/NewtonIterationBlackoilCPR.cpp +++ b/opm/autodiff/NewtonIterationBlackoilCPR.cpp @@ -2,6 +2,7 @@ Copyright 2014 SINTEF ICT, Applied Mathematics. Copyright 2015 Dr. Blatt - HPC-Simulation-Software & Services Copyright 2015 NTNU + Copyright 2015 Statoil AS This file is part of the Open Porous Media project (OPM). diff --git a/opm/autodiff/NewtonIterationBlackoilCPR.hpp b/opm/autodiff/NewtonIterationBlackoilCPR.hpp index 393b569b3..6a67ecd16 100644 --- a/opm/autodiff/NewtonIterationBlackoilCPR.hpp +++ b/opm/autodiff/NewtonIterationBlackoilCPR.hpp @@ -1,6 +1,9 @@ /* Copyright 2014 SINTEF ICT, Applied Mathematics. Copyright 2015 IRIS AS + Copyright 2015 Dr. Blatt - HPC-Simulation-Software & Services + Copyright 2015 NTNU + Copyright 2015 Statoil AS This file is part of the Open Porous Media project (OPM). diff --git a/opm/autodiff/RedistributeDataHandles.hpp b/opm/autodiff/RedistributeDataHandles.hpp index eee180af4..9b833b089 100644 --- a/opm/autodiff/RedistributeDataHandles.hpp +++ b/opm/autodiff/RedistributeDataHandles.hpp @@ -1,6 +1,7 @@ /* Copyright 2015 Dr. Blatt - HPC-Simulation-Software & Services. Coypright 2015 NTNU + Copyright 2015 Statoil AS This file is part of the Open Porous Media project (OPM). From f0f38d7ac2b5ed2f0ca9026d1275da23755411e5 Mon Sep 17 00:00:00 2001 From: Markus Blatt Date: Wed, 20 May 2015 17:53:54 +0200 Subject: [PATCH 09/10] Fix seting of parallel_run_ member. We are having a parallel only if there are more than one processes, and not already with only one. Kudos to @atgeirr for finding this in the review. --- opm/autodiff/SimulatorFullyImplicitBlackoil_impl.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opm/autodiff/SimulatorFullyImplicitBlackoil_impl.hpp b/opm/autodiff/SimulatorFullyImplicitBlackoil_impl.hpp index 17049c307..79ae18044 100644 --- a/opm/autodiff/SimulatorFullyImplicitBlackoil_impl.hpp +++ b/opm/autodiff/SimulatorFullyImplicitBlackoil_impl.hpp @@ -207,7 +207,7 @@ namespace Opm boost::any_cast(solver_.parallelInformation()); // Only rank 0 does print to std::cout terminal_output_= (info.communicator().rank()==0); - is_parallel_run_ = info.communicator().size(); + is_parallel_run_ = ( info.communicator().size() > 1 ); } } #endif From f6e3be53816e1147966b9913319eb338ccc7dfb8 Mon Sep 17 00:00:00 2001 From: Markus Blatt Date: Wed, 20 May 2015 17:54:43 +0200 Subject: [PATCH 10/10] Adds space around some binary operators. --- opm/autodiff/SimulatorFullyImplicitBlackoil_impl.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opm/autodiff/SimulatorFullyImplicitBlackoil_impl.hpp b/opm/autodiff/SimulatorFullyImplicitBlackoil_impl.hpp index 79ae18044..a2740789b 100644 --- a/opm/autodiff/SimulatorFullyImplicitBlackoil_impl.hpp +++ b/opm/autodiff/SimulatorFullyImplicitBlackoil_impl.hpp @@ -206,7 +206,7 @@ namespace Opm const ParallelISTLInformation& info = boost::any_cast(solver_.parallelInformation()); // Only rank 0 does print to std::cout - terminal_output_= (info.communicator().rank()==0); + terminal_output_ = ( info.communicator().rank() == 0 ); is_parallel_run_ = ( info.communicator().size() > 1 ); } }