Fix substep log line for reservoir coupling#7031
Open
hakonhagland wants to merge 1 commit into
Open
Conversation
In a reservoir-coupling run the per-substep "Starting time step N, ... at day X/Y" line emitted by detail::logTimer reset N to 0 on every sync chunk and showed Y as the end of the chunk instead of the end of the report step. The same problem applied to the debug output of AdaptiveSimulatorTimer::report(). The cause: runStepReservoirCouplingMaster_ and runStepReservoirCouplingSlave_ construct a fresh AdaptiveSimulatorTimer for every sync chunk, so current_step_ restarts at 0 and total_time_ spans only the chunk. The non-rescoup path constructs one timer per report step and is unaffected. Add a small "report step view" to AdaptiveSimulatorTimer (report_step_start_time_, report_step_total_time_, report_step_substep_offset_) with accessors that fall through to the per-timer fields when unset. The two rescoup outer loops set the view on each per-chunk timer and accumulate the substep offset across chunks. logTimer and report() switch to the new accessors. Defaults preserve existing semantics, so the non-coupled path's output is byte-identical and RSYNC-mode rescoup runs (where the chunk already coincides with the report step) are unchanged. TSYNC-mode runs now show an incrementing counter and the report-step-end denominator on both master and slave.
Contributor
Author
|
jenkins build this serial please |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In a reservoir-coupling run, the per-substep
Starting time step N, stepsize ... days, at day X/Yline emitted bydetail::logTimerresetNto0on every sync chunk and showedYas the end of the chunk instead of the end of the report step. The same problem applied to the debug output ofAdaptiveSimulatorTimer::report().Example — TSYNC, 31-day report step starting Oct 1.
Before:
After:
Root cause
runStepReservoirCouplingMaster_andrunStepReservoirCouplingSlave_construct a freshAdaptiveSimulatorTimerfor every sync chunk, so the timer'scurrent_step_restarts at0andtotal_time_spans only the chunk. The non-coupled path (runStepOriginal_) constructs one timer per report step and is unaffected, which is why the bug only showed up in rescoup runs.Fix
Add a small "report step view" to
AdaptiveSimulatorTimer— three new optional members (report_step_start_time_,report_step_total_time_,report_step_substep_offset_) plus matching accessors (reportStepStartTime(),reportStepTotalTime(),reportStepSubstepNum()) that fall through to the per-timer fields when unset. The two rescoup outer loops set the view on each per-chunk timer and accumulate the substep offset across chunks.detail::logTimerandAdaptiveSimulatorTimer::report()switch to the new accessors.Behavior matrix
--rescoup-sync-at-report-steps=true)runStepOriginal_)Defaults preserve existing semantics, so the non-rescoup output is unchanged.