Skip to content
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

Support reproducible restarts #544

Closed
Sbozzolo opened this issue Sep 27, 2024 · 4 comments
Closed

Support reproducible restarts #544

Sbozzolo opened this issue Sep 27, 2024 · 4 comments
Assignees

Comments

@Sbozzolo
Copy link
Member

RRTMGP uses a random number generator. If we want to restart a run and debug it in a deterministic way, we need to control how random numbers are generated.

The simplest way I can think of is to force the seed to something deterministic before writing the restart file. The seed could be anything (even time) and could be stored to the restart file, so that we can reproduce the same stream of random numbers.

@sriharshakandala
Copy link
Member

One simple workaround, for now, could be to set the seed just before the solve_lw and solve_sw calls in ClimaAtmos.jl. This could be a bit restrictive in terms of random number quality, but should work! cc: @szy21 , @akshaysridhar

@Sbozzolo
Copy link
Member Author

Sbozzolo commented Sep 27, 2024

One simple workaround, for now, could be to set the seed just before the solve_lw and solve_sw calls in ClimaAtmos.jl. This could be a bit restrictive in terms of random number quality, but should work! cc: @szy21 , @akshaysridhar

Right, that's what I suggested, but only for when we save a checkpoint, so that it doesn't impact much the generation of random numbers. We can still make the seed "random" by taking it to be the current time. What's important is that it is saved.

@sriharshakandala
Copy link
Member

One simple workaround, for now, could be to set the seed just before the solve_lw and solve_sw calls in ClimaAtmos.jl. This could be a bit restrictive in terms of random number quality, but should work! cc: @szy21 , @akshaysridhar

Right, that's what I suggested, but only for when we save a checkpoint, so that it doesn't impact much the generation of random numbers. We can still make the seed "random" by taking it to be the current time. What's important is that it is saved.

Yes. Seeding to current "simulation" time (converted to UInt32) in ClimaAtmos.jl just before the longwave and shortwave calls would be a good option.

@sriharshakandala
Copy link
Member

I believe this issue needs to be moved to ClimaAtmos.jl!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants