-
Notifications
You must be signed in to change notification settings - Fork 17
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
Automatically detect restart files and add tests for restarts #3307
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sbozzolo
force-pushed
the
gb/automatic_restart
branch
10 times, most recently
from
September 17, 2024 17:44
933d5b2
to
dfd67b7
Compare
Sbozzolo
changed the title
Automatically detect restart files
Automatically detect restart files and add tests for restarts
Sep 19, 2024
Sbozzolo
force-pushed
the
gb/automatic_restart
branch
6 times, most recently
from
September 19, 2024 17:10
8a324d8
to
85b525b
Compare
Sbozzolo
requested review from
charleskawczynski,
dennisYatunin,
szy21 and
akshaysridhar
September 19, 2024 17:13
Sbozzolo
force-pushed
the
gb/automatic_restart
branch
3 times, most recently
from
September 19, 2024 17:48
a63e048
to
f11c3b6
Compare
Sbozzolo
force-pushed
the
gb/automatic_restart
branch
from
September 19, 2024 18:11
f11c3b6
to
cde3ec3
Compare
Sbozzolo
force-pushed
the
gb/automatic_restart
branch
from
September 23, 2024 23:01
cf70fba
to
0a7ccd7
Compare
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.
In terms of the source code, I'm fine with most of the changes. But I think we can improve a few things:
get_restart_file
compare
- format of
test/restart.jl
I'll comment locally to go into details.
Sbozzolo
force-pushed
the
gb/automatic_restart
branch
from
September 24, 2024 15:14
0a7ccd7
to
8533bfa
Compare
Sbozzolo
force-pushed
the
gb/automatic_restart
branch
3 times, most recently
from
September 25, 2024 15:00
563b580
to
c5211f2
Compare
This is how the output looks like in case of failure:
|
Sbozzolo
force-pushed
the
gb/automatic_restart
branch
4 times, most recently
from
September 25, 2024 16:44
ffd0b54
to
1ad8f95
Compare
Sbozzolo
force-pushed
the
gb/automatic_restart
branch
from
September 26, 2024 17:15
1ad8f95
to
ba797c2
Compare
…stics `face_sw_direct_flux_dn` is used only in `AllSkyRadiationWithClearSkyDiagnostics` in this block: ``` NVTX.@Annotate function update_sw_fluxes!( ::AllSkyRadiationWithClearSkyDiagnostics, model, ) RRTMGP.RTESolver.solve_sw!( model.sw_solver, model.as, model.lookups.lookup_sw, nothing, model.lookups.lookup_sw_aero, ) parent(model.face_clear_sw_flux_up) .= parent(model.face_sw_flux_up) parent(model.face_clear_sw_flux_dn) .= parent(model.face_sw_flux_dn) parent(model.face_clear_sw_direct_flux_dn) .= parent(model.face_sw_direct_flux_dn) parent(model.face_clear_sw_flux) .= parent(model.face_sw_flux) RRTMGP.RTESolver.solve_sw!( model.sw_solver, model.as, model.lookups.lookup_sw, model.lookups.lookup_sw_cld, model.lookups.lookup_sw_aero, ) end ``` It is not used by other modes, so I don't add it
This commit adds a new option, `detect_restart_file`. When `detect_restart_file` is true, ClimaAtmos looks at the previous `output_XXXX` output folder and tries to see if there's a restart file in it. If yes, use it. This behavior is overridden when a restart file is explicitely passed. This commit uses and re-implments the same logic implemented in ClimaUtilities.OutputPathGenerator. We might want to move that logic to ClimaUtilities at some point.
This commit adds the hash of the AtmosModel instance used to prepare a simulation in the checkpoint HDF5 files. This is then used to check that the AtmosModel is the "same" (up to a hash) across restarts. A test is added to check that this mechanism works. In the test, I produced a checkpoint and read it with the same configuration with one value changed (insolation).
This commit adds a test to ensure that restarted simulations are identical to non-restarted ones. This is accomplished by running a simulation for three steps and comparing it to two other cases: 1. A simulation restarted from the checkpoint produced at step 3 2. A simulation restarted from the checkpoint produced at step 2 and solved
Sbozzolo
force-pushed
the
gb/automatic_restart
branch
from
September 27, 2024 02:31
6280df5
to
452f45a
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit adds a new option,
detect_restart_file
. Whendetect_restart_file
is true, ClimaAtmos looks at the previousoutput_XXXX
output folder and tries to see if there's a restart file in it. If yes, it uses it. This behavior is overridden when a restart file is explicitely passed. This commit uses and re-implments the same logic implemented in ClimaUtilities.OutputPathGenerator. (We might want to move that logic to ClimaUtilities at some point.)This PR also adds a test to ensure that restarted simulations are identical to non-restarted ones.
This is accomplished by running a simulation for three steps and comparing it to two other cases:
This is a variation of #3031
Closes #3031
This is the first step in improving compatibility with restarts, and more work is needed. There is a little bit of commented out code to loop over different configurations. I am working on it now, but I would like to start getting this test merged in, as I add more complexity and fix things.
GPU tests are commented out because of ClimaCore bug,
MPI tests are commented out because of process hanging.
I will work on this next