Fix some logging fallout to non-zero MPI ranks

In multi-rank MPI runs, some log messages were written by all ranks instead
of only rank 0, causing "logging fallout" files (e.g., CASE.1.DBG, CASE.2.DBG).

Changes:
- Add rank check before calling logPressures() in FlowThresholdPressure
- Make TimeStepControl verbose flag rank-aware in createController()

This ensures only rank 0 produces log output for these code paths.
This commit is contained in:
Håkon Hægland committed 2026-01-26 13:44:57 +01:00
1 parent 2ee0e7a4b6
commit 56caf85a10
2 files changed
+6 -2

No files matched your search

@@ -156,7 +156,9 @@ private:
for (unsigned i = 0; i < this->thpresDefault_.size(); ++i)
this->thpresDefault_[i] = gridView.comm().max(this->thpresDefault_[i]);
this->logPressures();
if (gridView.comm().rank() == 0) {
this->logPressures();
}
}
const Simulator& simulator_;
@@ -8,6 +8,7 @@
#include <opm/input/eclipse/Units/Units.hpp>
#include <opm/simulators/flow/FlowGenericVanguard.hpp>
#include <opm/simulators/timestepping/AdaptiveSimulatorTimer.hpp>
#include <opm/simulators/timestepping/ConvergenceReport.hpp>
@@ -169,7 +170,8 @@ std::tuple<TimeStepControlType, std::unique_ptr<TimeStepControlInterface>, bool>
createController(const UnitSystem& unitSystem)
{
const double tol = Parameters::Get<Parameters::TimeStepControlTolerance>();
const bool verbose = Parameters::Get<Parameters::TimeStepVerbosity>();
const auto& comm = FlowGenericVanguard::comm();
const bool verbose = Parameters::Get<Parameters::TimeStepVerbosity>() && (comm.rank() == 0);
using RetVal = std::tuple<TimeStepControlType, std::unique_ptr<TimeStepControlInterface>, bool>;
using Func = std::function<RetVal()>;
const auto creators = std::unordered_map<std::string, Func> {