Skip to content

Commit

Permalink
Improve names
Browse files Browse the repository at this point in the history
  • Loading branch information
charleskawczynski committed Dec 14, 2023
1 parent 6045d55 commit 1a23407
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/callbacks/callbacks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -449,18 +449,18 @@ function print_walltime_estimate(integrator)
(; walltime_estimate, dt, t_end) = integrator.p
wte = walltime_estimate
# 1st call initializes `t_wall_last` (during integrator init)
# 2nd call computes `Δt` for the first time (but also includes compilation), so we skip
# 2nd call computes `Δt_wall` for the first time (but also includes compilation), so we skip
cond = wte.n_calls > 1
if cond
# We need to account for skipping cost of `Δt` when `n_calls == 1`:
# We need to account for skipping cost of `Δt_wall` when `n_calls == 1`:
factor = wte.n_calls == 2 ? 2 : 1
Δt = factor * (time() - wte.t_wall_last)
Δt_wall = factor * (time() - wte.t_wall_last)
else
wte.n_calls == 1 && @info "Progress: Completed first step"
Δt = Float64(0)
Δt_wall = Float64(0)
wte.n_next = wte.n_calls + 1
end
wte.∑Δt_wall += Δt
wte.∑Δt_wall += Δt_wall
wte.t_wall_last = time()

if wte.n_calls == wte.n_next && cond
Expand Down

0 comments on commit 1a23407

Please sign in to comment.