-
Notifications
You must be signed in to change notification settings - Fork 222
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
Clock keeps ticking if we insist running the simulation beyond a stop criterion #4253
Comments
Or check the simulation perhaps should check the stop_criteria before it ticks the clock? |
I think that's because I tried to simplify I thought it was ok that we always take one time step. But we can reinstate that check ! We used to throw an error of the nature "simulation stopped during initialization". Or maybe there is a better way? We can move the check into |
A related question, which is really just a definition, is whether callbacks should always be executed at the beginning of Oceananigans.jl/src/Simulations/run.jl Lines 223 to 239 in dbb67af
Another idea is to make "stop_criteria" into a special kind of callback that has different behavior than the other callbacks. Presumably there's no harm in running stop criteria as much needed (vs other callbacks / output writers, which if called more than desired can do things like mess up your time series of data). |
Another simplification would be to combine diagnostics, output writers, and callbacks into a single dict, and just label them all as "callbacks". |
Actually I am confused whether the change I noted actually caused this. Anyways, note this line used to present, but is no longer there. Oceananigans.jl/src/Simulations/run.jl Line 135 in df1b959
I have a new idea. What if we define
The advantage of this approach, instead of hard-coding the dependency on
Next, we place a call to So now, sim.initialized = false
sim.running = true
sim.run_wall_time = 0.0
initialize!(sim)
while sim.running
time_step!(sim)
end then |
I can write this up if you agree @navidcy . |
I demonstrate what I mean below:
Should we be ticking the clock at the end of the timestep?
The text was updated successfully, but these errors were encountered: