-
Notifications
You must be signed in to change notification settings - Fork 132
Description
Summary
The simulation already prints progress info every t_step_print steps, including Time Avg (running average wall time per step) and Time/step (current step wall time). We should use this data to compute and display the estimated time remaining (ETA).
Current output
Fixed timestep mode:
[ 25%] Time step 250 of 1000 @ t_step = 250 Time Avg = 1.234567E-01 Time/step= 1.200000E-01
CFL-based dt mode:
[ 25%] Time 1.250000E-03 dt = 5.000000E-06 @ Time Step = 250 Time Avg = 1.234567E-01 Time/step = 1.200000E-01
Proposed change
Append an ETA field to each line computed from:
ETA = wall_time_avg * steps_remaining
where steps_remaining = t_step_stop - t_step (fixed dt) or estimated from (t_stop - mytime) / dt (CFL mode).
Format the ETA in human-readable form (e.g., 2h 13m 05s or 45m 30s or 12s).
Example output:
[ 25%] Time step 250 of 1000 @ t_step = 250 Time Avg = 1.234567E-01 Time/step= 1.200000E-01 ETA = 1h 33m 08s
Implementation
All changes are in src/simulation/m_start_up.fpp, lines ~821-839 (s_perform_time_step):
- Compute
steps_remaining:- Fixed dt:
t_step_stop - t_step - CFL dt:
nint((t_stop - mytime) / dt)(approximate, since dt can change)
- Fixed dt:
- Compute
eta_seconds = wall_time_avg * steps_remaining - Convert to hours/minutes/seconds integers
- Append to the existing
printformat string
This is a ~15-line change in a single subroutine. No new parameters needed — it uses existing wall_time_avg, t_step_stop, t_step, t_stop, mytime, and dt.