From 1842df7cfde6b79f0ff332e7817cf6a7c210e8b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Atgeirr=20Fl=C3=B8=20Rasmussen?= Date: Fri, 19 Jan 2024 16:15:53 +0100 Subject: [PATCH] Output well subdomain info properly in the parallel case. --- opm/simulators/wells/BlackoilWellModel_impl.hpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/opm/simulators/wells/BlackoilWellModel_impl.hpp b/opm/simulators/wells/BlackoilWellModel_impl.hpp index a338224ad..209c7496d 100644 --- a/opm/simulators/wells/BlackoilWellModel_impl.hpp +++ b/opm/simulators/wells/BlackoilWellModel_impl.hpp @@ -2665,13 +2665,20 @@ namespace Opm { ebosSimulator_.gridView().comm()); // Write well/domain info to the DBG file. - if (ebosSimulator_.gridView().comm().rank() == 0) { + const Opm::Parallel::Communication& comm = grid().comm(); + const int rank = comm.rank(); + DeferredLogger local_log; + { std::ostringstream os; - os << "Well name Domain\n"; + os << "Well name Rank Domain\n"; for (const auto& [wname, domain] : well_domain_) { - os << wname << std::setw(21 - wname.size()) << domain << '\n'; + os << wname << std::setw(19 - wname.size()) << rank << std::setw(12) << domain << '\n'; } - OpmLog::debug(os.str()); + local_log.debug(os.str()); + } + auto global_log = gatherDeferredLogger(local_log, comm); + if (terminal_output_) { + global_log.logMessages(); } }