-
Notifications
You must be signed in to change notification settings - Fork 9
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 distributed_remapping.jl #1475
Conversation
41736a4
to
922ffa1
Compare
806e680
to
e6d9b3a
Compare
bors try |
tryBuild failed: |
e6d9b3a
to
42b111c
Compare
bors try |
tryBuild succeeded! The publicly hosted instance of bors-ng is deprecated and will go away soon. If you want to self-host your own instance, instructions are here. If you want to switch to GitHub's built-in merge queue, visit their help page. |
5177405
to
694e3eb
Compare
c464007
to
adb5fbb
Compare
bors try |
tryBuild failed: |
bors try |
796e659
to
089f1e4
Compare
tryBuild failed: |
3a9d76e
to
6b40a07
Compare
|
||
coords = Fields.coordinate_field(hv_center_space) | ||
|
||
xpts = range(-500.0, 500.0, length = 21) |
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 you should be able to just do
xpts = range(-500.0, 500.0, length = 21) | |
xpts = range(-Geometry.XPoint(500.0), Geometry.XPoint(500.0), length = 21) |
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 can do this only in the case of a plane.
I need to build hcoords
with the correct type, and I cannot easily assemble, e.g., XYPoint
s from XPoint
s and YPoint
s (see #1476).
c329941
to
13ba6be
Compare
bors try |
tryBuild failed: |
13ba6be
to
3904a2a
Compare
bors try |
tryBuild succeeded! The publicly hosted instance of bors-ng is deprecated and will go away soon. If you want to self-host your own instance, instructions are here. If you want to switch to GitHub's built-in merge queue, visit their help page. |
@charleskawczynski if you want to have another look, I think that this is ready to be merged |
bors r+ |
1464: Check if "ClimaCore version" is already attribute r=simonbyrne a=Sbozzolo HDF5.jl complains if you try writing an attribute that already exists, so that appending to `ClimaCore`-generated files can be a problem 1475: Add distributed_remapping.jl r=simonbyrne a=Sbozzolo This pull request introduces a new way to interpolate a field onto a given set of points that works for distributed simulations. This change introduces a new object, a `Remapper`. `Remapper`s are process-local and are defined starting from the target points where we want to interpolate and the `Space`. `Remapper`s contain all the information necessary to perform interpolations of all the fields that are defined on the same `Space`. Once a `Remapper` is defined, it can be used as many times as needed. To use a `Remapper`, just call the new `interpolate` function with the field you want to remap: ```julia remapper = Remapper(hcoords, zcoords, space) interpolate(remapper, field) # => Array of values interpolated on hcoords × zcoords ``` Internally, `interpolate` computes the process-local points and then calls a `MPI.reduce` to return the final value in the root process. Co-authored-by: Gabriele Bozzola <[email protected]>
This PR was included in a batch that timed out, it will be automatically retried |
end | ||
|
||
function interpolation_weights( | ||
horz_mesh::Meshes.AbstractMesh1D, |
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.
At some point I’d like to rename this variable, maybe just use hmesh
?
Build succeeded! The publicly hosted instance of bors-ng is deprecated and will go away soon. If you want to self-host your own instance, instructions are here. If you want to switch to GitHub's built-in merge queue, visit their help page. |
This pull request introduces a new way to interpolate a field onto a given set of points that works for distributed simulations.
This change introduces a new object, a
Remapper
.Remapper
s are process-local and are defined starting from the target points where we want to interpolate and theSpace
.Remapper
s contain all the information necessary to perform interpolations of all the fields that are defined on the sameSpace
.Once a
Remapper
is defined, it can be used as many times as needed. To use aRemapper
, just call the newinterpolate
function with the field you want to remap:Internally,
interpolate
computes the process-local points and then calls aMPI.reduce
to return the final value in the root process.