Skip to content

Add estimated time remaining (ETA) to simulation time-step output #1276

@sbryngelson

Description

@sbryngelson

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):

  1. Compute steps_remaining:
    • Fixed dt: t_step_stop - t_step
    • CFL dt: nint((t_stop - mytime) / dt) (approximate, since dt can change)
  2. Compute eta_seconds = wall_time_avg * steps_remaining
  3. Convert to hours/minutes/seconds integers
  4. Append to the existing print format 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions