-
Notifications
You must be signed in to change notification settings - Fork 193
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
Simplify kernel launching and add exclude_periphery
option
#3814
base: main
Are you sure you want to change the base?
Conversation
…into glw/launch
@jagoosw can you review this? |
Distributed tests actually fail with errors :( |
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.
Okay yeah that all makes sense. I agree the renaming makes sense it was just hard to see in the file changes which was new code vs renamed things. LGTM!
|
||
if !isnothing(active_cells_map) # everything else is irrelevant | ||
workgroup = min(length(active_cells_map), 256) | ||
worksize = length(active_cells_map) |
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 probably need to keep this here for non-active domains
worksize = length(active_cells_map) | |
worksize = length(active_cells_map) | |
if worksize == 0 | |
return nothing | |
end |
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.
ok nothing, I see it has moved in the launch!
I am not sure about the purpose of this PR. What is the reason we do not want to calculate the periphery in the nonhydrostatic model tendencies? |
Also I am not sure about renaming to |
Because some open boundary conditions integrate an alternative PDE on the boundaries (eg for radiation conditions). In other words the algorithm we are using is only valid for simple open boundary conditions (we designed it for impenetrable condition). More generally, the algorithm is wrong. There are two other benefits. First, we do not use the tendencies on the periphery. So this increases the clarity of the code. Previously, it might not be obvious that even though we compute tendencies on the boundary, we overwrite the field values in It saves a little bit of computation as well... |
This PR defines the "buffer" as the halo dependent region of the domain. Before this PR there was no definition of this region at all, so this PR simply introduces one possible name. I am ok with a different name, but I think we should do it in another PR. |
Ok, can we leave the refactoring to another PR than to clean up this one? |
This should be done already (I'm not sure why the tests keep failing, its annoying). I made the change because I seriously could not understand the code. I kept getting confused between "compute boundary tendencies" (which adds fluxes to the tendencies, coming in from the boundaries), and "compute tendencies_boundaries", which did something completely different (compute the halo dependent tendencies). So I started by changing the names so I could reason about the code without my head spinning. |
…into glw/launch
cc @jagoosw