-
Notifications
You must be signed in to change notification settings - Fork 134
Add ETA print to time-step output #1351
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
c720137
3a8b377
00d3a24
d6edf3b
800c254
2e9c16d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -139,16 +139,27 @@ contains | |
| impure subroutine s_perform_time_step(t_step) | ||
|
|
||
| integer, intent(inout) :: t_step | ||
| integer :: eta_hh, eta_mm, eta_ss | ||
| real(wp) :: eta_sec | ||
|
|
||
| if (proc_rank == 0) then | ||
| if (cfl_dt) then | ||
| print '(" [", I3, "%] Saving ", I8, " of ", I0, " Time Avg = ", ES16.6, " Time/step = ", ES12.6, "")', & | ||
| & int(ceiling(100._wp*(real(t_step - n_start)/(n_save)))), t_step, n_save, wall_time_avg, wall_time | ||
| eta_sec = wall_time_avg*real(n_save - 1 - t_step, wp) | ||
| eta_hh = int(eta_sec)/3600 | ||
| eta_mm = mod(int(eta_sec), 3600)/60 | ||
| eta_ss = mod(int(eta_sec), 60) | ||
| print '(" [", I3, "%] Saving ", I8, " of ", I0, " Time Avg = ", ES16.6, " Time/step = ", ES12.6, " ETA (HH:MM:SS) = ", I0, ":", I2.2, ":", I2.2)', & | ||
| & int(ceiling(100._wp*(real(t_step - n_start)/(n_save)))), t_step, n_save, wall_time_avg, wall_time, eta_hh, & | ||
| & eta_mm, eta_ss | ||
|
Comment on lines
+142
to
+153
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 3. Eta changes outside s_perform_time_step ETA-related functionality and timing logic were modified outside src/simulation/m_start_up.fpp:s_perform_time_step, violating the constraint to keep the implementation as a small localized change in that subroutine. This increases surface area and breaks the checklist’s location/approach requirement. Agent Prompt
|
||
| else | ||
| print '(" [", I3, "%] Saving ", I8, " of ", I0, " @ t_step = ", I8, " Time Avg = ", ES16.6, " Time/step = ", ES12.6, "")', & | ||
| eta_sec = wall_time_avg*real((t_step_stop - t_step)/t_step_save, wp) | ||
| eta_hh = int(eta_sec)/3600 | ||
| eta_mm = mod(int(eta_sec), 3600)/60 | ||
| eta_ss = mod(int(eta_sec), 60) | ||
| print '(" [", I3, "%] Saving ", I8, " of ", I0, " @ t_step = ", I8, " Time Avg = ", ES16.6, " Time/step = ", ES12.6, " ETA (HH:MM:SS) = ", I0, ":", I2.2, ":", I2.2)', & | ||
| & int(ceiling(100._wp*(real(t_step - t_step_start)/(t_step_stop - t_step_start + 1)))), & | ||
| & (t_step - t_step_start)/t_step_save + 1, (t_step_stop - t_step_start)/t_step_save + 1, t_step, & | ||
| & wall_time_avg, wall_time | ||
| & wall_time_avg, wall_time, eta_hh, eta_mm, eta_ss | ||
| end if | ||
| end if | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -606,7 +606,8 @@ contains | |
|
|
||
| integer, intent(inout) :: t_step | ||
| real(wp), intent(inout) :: time_avg | ||
| integer :: i | ||
| integer :: i, eta_hh, eta_mm, eta_ss | ||
| real(wp) :: eta_sec | ||
|
|
||
| if (cfl_dt) then | ||
| if (cfl_const_dt .and. t_step == 0) call s_compute_dt() | ||
|
|
@@ -635,14 +636,23 @@ contains | |
|
|
||
| if (cfl_dt) then | ||
| if (proc_rank == 0 .and. mod(t_step - t_step_start, t_step_print) == 0) then | ||
| print '(" [", I3, "%] Time ", ES16.6, " dt = ", ES16.6, " @ Time Step = ", I8, " Time Avg = ", ES16.6, " Time/step = ", ES12.6, "")', & | ||
| & int(ceiling(100._wp*(mytime/t_stop))), mytime, dt, t_step, wall_time_avg, wall_time | ||
| eta_sec = wall_time_avg*(t_stop - mytime)/max(dt, tiny(dt)) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 1. eta_sec lacks nint steps_remaining In CFL-based mode, the new ETA computation uses a real-valued division `(t_stop - mytime)/max(dt, tiny(dt)) instead of computing integer steps_remaining = nint((t_stop - mytime)/dt)` and then eta_seconds = wall_time_avg * steps_remaining as required. This deviates from the specified formula and can produce inconsistent ETA estimates. Agent Prompt
|
||
| eta_hh = int(eta_sec)/3600 | ||
| eta_mm = mod(int(eta_sec), 3600)/60 | ||
| eta_ss = mod(int(eta_sec), 60) | ||
| print '(" [", I3, "%] Time ", ES16.6, " dt = ", ES16.6, " @ Time Step = ", I8, " Time Avg = ", ES16.6, " Time/step = ", ES12.6, " ETA (HH:MM:SS) = ", I0, ":", I2.2, ":", I2.2)', & | ||
| & int(ceiling(100._wp*(mytime/t_stop))), mytime, dt, t_step, wall_time_avg, wall_time, eta_hh, eta_mm, eta_ss | ||
|
Comment on lines
+643
to
+644
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 2. Nonstandard eta (hh:mm:ss) label The progress output prints ETA (HH:MM:SS) = ... instead of the required ETA = <duration> convention. This breaks the specified output label/style for ETA. Agent Prompt
|
||
| end if | ||
| else | ||
| if (proc_rank == 0 .and. mod(t_step - t_step_start, t_step_print) == 0) then | ||
| print '(" [", I3, "%] Time step ", I8, " of ", I0, " @ t_step = ", I8, " Time Avg = ", ES12.6, " Time/step= ", ES12.6, "")', & | ||
| eta_sec = wall_time_avg*real(t_step_stop - t_step, wp) | ||
| eta_hh = int(eta_sec)/3600 | ||
| eta_mm = mod(int(eta_sec), 3600)/60 | ||
| eta_ss = mod(int(eta_sec), 60) | ||
| print '(" [", I3, "%] Time step ", I8, " of ", I0, " @ t_step = ", I8, " Time Avg = ", ES12.6, " Time/step= ", ES12.6, " ETA (HH:MM:SS) = ", I0, ":", I2.2, ":", I2.2)', & | ||
| & int(ceiling(100._wp*(real(t_step - t_step_start)/(t_step_stop - t_step_start + 1)))), & | ||
| & t_step - t_step_start + 1, t_step_stop - t_step_start + 1, t_step, wall_time_avg, wall_time | ||
| & t_step - t_step_start + 1, t_step_stop - t_step_start + 1, t_step, wall_time_avg, wall_time, eta_hh, & | ||
| & eta_mm, eta_ss | ||
| end if | ||
| end if | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -586,8 +586,8 @@ contains | |
|
|
||
| wall_time = abs(finish - start) | ||
|
|
||
| if (t_step >= 2) then | ||
| wall_time_avg = (wall_time + (t_step - 2)*wall_time_avg)/(t_step - 1) | ||
| if (t_step - t_step_start >= 2) then | ||
| wall_time_avg = (wall_time + (t_step - t_step_start - 2)*wall_time_avg)/(t_step - t_step_start - 1) | ||
|
Comment on lines
+589
to
+590
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 4. Cfl avg uses t_step_start In simulation, wall_time_avg is now updated using (t_step - t_step_start), but in cfl_dt mode the main loop initializes t_step=0 while t_step_start can remain the default sentinel (-100) and is not validated. This can make wall_time_avg (and the new ETA) drastically too small during early steps. Agent Prompt
|
||
| else | ||
| wall_time_avg = 0._wp | ||
| end if | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.