FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
0078 — Sink/Progress rewrites its output file on every accepted step
ID 0078
Class KNOWN-LIMITATION
Severity 1
Status ready

Models: Progress

Found: 2026-10-11, CI of main (jobs 3684029, 3684201), at 984ee34

Decision needed:

Evidence

src/sink/CProgress.cpp (CProgress::AcceptedStep): every accepted step opens m_output_name with std::ofstream(..., std::ios::out), truncating it, and writes the percentage. SimObj-Progress_in.xml runs 99 s at StepMax="0.002", about 50 000 accepted steps and so about 50 000 file rewrites.

fhsim_base.SimObject.Progress takes 0.08 s to 4 s on most CI cells, 27.5 s on job 3684058 and more than its 30 s wall-time budget on jobs 3684029 and 3684201 (Linux Release, "Simulation wall-time budget exceeded"), when eight jobs share one host. The test's budget and wall_max are now 120 s.

Effect

A model with Sink/Progress and small steps spends its wall time on file I/O on a slow or busy disk.

Possible fix

Write only when the rounded percentage changes (at most 10 001 writes), or at most once per wall-clock interval. The final file content is unchanged; the file is updated less often.

Test that would prove it

SimObject.Progress with an unchanged output reference and a wall time below 1 s on a loaded runner.

Risk

Low: a reader that polls the file sees the same values, only fewer intermediate ones.