-
Notifications
You must be signed in to change notification settings - Fork 19
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
Add 3 timestep restart unit test #3031
Conversation
Could we add radiation callback and EDMF too? Maybe we can have two cases, a simple one and a more complex one? |
I think "Make sure restarts work correctly" is a little more nuanced than this.
These are some of the first things that come to mind but I am sure that there are much more. Restarts are not easy to handle properly! |
Right, I don't think this PR should close the issue. I moved your comments to the issue so we can discuss how to address them. |
I'm testing all reasonable combinations of this |
I think this is a good start. Let's address MPI and GPU in this PR if that's easy. We can address other issues in separate PRs. For callbacks and diagnostics, I think for now we can force the simulation time to be multiple of the N or dt of callback and accumulated diagnostics (or throw a warning if it's not). I don't think we need to worry too much about what happens when changing settings across restarts, as it's very unlikely that one will change the settings during one simulation, so there is no truth to compare with. @akshaysridhar @Sbozzolo What do you think? We can move the discussion to the issue. |
Yes, this is a perfectly good test to have, but should not close the issue. |
713bfe7
to
dc847af
Compare
@Sbozzolo Output dirs are now created as temp directories; |
test/restart.jl
Outdated
simulation = CA.get_simulation(config) | ||
CA.solve_atmos!(simulation) | ||
|
||
restart_dir = simulation.output_dir |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine for current main
, but it will probably not be if we restore OutputPathGenerator
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can wait till OutputPathGenerator
is reintroduced if necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we probably want restart_dir = dirname(parsed_args["restart_file"])
here. This is nice in that it is declarative. I would hope that this is compatible with OutputPathGenerator
, or that we can somehow make it compatible with OutputPathGenerator
.
(FT(0), FT(0)) | ||
@test extrema(parent(Y₁.c.ρq_tot) .- parent(Y.c.ρq_tot)) == | ||
(FT(0), FT(0)) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should check some variables in p too.
test/restart.jl
Outdated
# settings (or when tendency computations conflict with | ||
# dt / t_end parsed args) | ||
|
||
for configuration in ["column"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we do spheres too, with topography as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good start, but I think we should keep in mind that this is still a relatively weak test with respect to fully supporting restarts. We should go ahead with this, but we should also think about restarts more in general and what we want to support
We may need to look at the HDF5Reader / Writer features: on spheres, we get exact matches for scalar tracers and not for the vectors (e.g O(1e-5) error in |
Is the error relative or absolute? Can you coming up a simple example where you set up a space, set up a vector on the space, save it to HDF5 and read it back and show that they are different? |
Absolute error : In the ubuntu ci build we have
|
@Sbozzolo The test has been updated now that |
in various configurations Co-authored-by: Gabriele Bozzola <[email protected]>
What's the status of this PR? |
Tests for restart and custom output directory generation. Assumes
output_active
path will be generated usingClimaUtilities.OutputPathGenerator
. Addresses #2604 (not sufficient to close this issue).