-
Notifications
You must be signed in to change notification settings - Fork 1
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
Use new ReactantState
architecture in super_simple_simulation.jl
#12
base: main
Are you sure you want to change the base?
Conversation
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.
lgtm modulo seed
|
||
arch = GPU() # CPU() to run on CPU | ||
arch = isempty(find_library(["libcuda.so.1", "libcuda.so"])) ? CPU() : GPU() |
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.
💪
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.
do you also want to set the Reactant default to cpu vs gpu based on this check?
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 Reactant does it automatically already.
I suggest also adding a traced clock to these: FT = Float64
t = ConcreteRNumber(zero(FT))
iter = ConcreteRNumber(0)
stage = ConcreteRNumber(0)
last_Δt = ConcreteRNumber(zero(FT))
last_stage_Δt = ConcreteRNumber(zero(FT))
r_clock = Clock(; time=t, iteration=iter, stage, last_Δt, last_stage_Δt) then pass r_model = HydrostaticFreeSurfaceModel(; grid=r_grid, clock=r_clock, momentum_advection=WENO()) Once we get the next PR through I will make Oceananigans do this automatically. |
I did it, but only for the Reactant model, is that right? |
02f2021
to
260e029
Compare
@glwagner with the clock:
|
We should add an override for that in Reactant, cc @avik-pal . seems easy enough |
@glwagner can we remove the clock for the time being? 😃 |
@glwagner can that be made into an ifelse |
That helps only partially, there are more functions which use more complicated |
I missed a bunch of messages here for some reason. We can remove the "aligned time step" feature. We don't need it. |
What pattern is supportable here? On removing Clock, we cannot remove it completely for a climate case because we need to know the time of day/year for forcing the simulation. But we can use a different pattern for testing the code and bypass any part of |
I wonder if we should be taking a different approach where we do
and then
|
Co-authored-by: Gregory L. Wagner <wagner.greg@gmail.com>
b4bc4ce
to
18f4347
Compare
stage = ConcreteRNumber(0) | ||
last_Δt = ConcreteRNumber(zero(FT)) | ||
last_stage_Δt = ConcreteRNumber(zero(FT)) | ||
r_clock = Clock(; time=t, iteration=iter, stage, last_Δt, last_stage_Δt) |
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.
@glwagner to be clear, with CliMA/Oceananigans.jl#4096 how would I modify this? So that I can test it quickly locally
I don't know if this is how you wanted to use
ReactantState
, but this seems to work for me now.