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 for active_cells_map in kernels #3920

Open
wants to merge 74 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
279e4c4
support for MappedFunctions
simone-silvestri Nov 12, 2024
6182e34
remove double kernels everywhere
simone-silvestri Nov 12, 2024
5545605
make sure also GPU works
simone-silvestri Nov 12, 2024
e239dbe
make sure there is no return in the function
simone-silvestri Nov 12, 2024
32e0c52
return nothing
simone-silvestri Nov 12, 2024
0b56304
adapt for GPU usage
simone-silvestri Nov 12, 2024
052f56e
not sure about the GPU
simone-silvestri Nov 12, 2024
d0d56ac
hmmm
simone-silvestri Nov 12, 2024
7e41737
probably like this it will work on the GPU?
simone-silvestri Nov 12, 2024
42d4989
Merge branch 'ss/active-index-macro' of github.com:CliMA/Oceananigans…
simone-silvestri Nov 12, 2024
130a357
some cleanup plus testing a test?
simone-silvestri Nov 12, 2024
3be13dd
works on gpu, to fix the dynamic check
simone-silvestri Nov 12, 2024
64cad18
move lwargs
simone-silvestri Nov 13, 2024
333bfd7
kwarg management
simone-silvestri Nov 13, 2024
e069051
reduce time for tridiagonal solve
simone-silvestri Nov 13, 2024
f0a887a
see if tests pass (especially distributed where we have active_cells)
simone-silvestri Nov 13, 2024
7b33e7a
bugfix
simone-silvestri Nov 13, 2024
26194f3
grid from solver
simone-silvestri Nov 13, 2024
db84ef2
Merge branch 'main' into ss/active-index-macro
simone-silvestri Nov 14, 2024
0b70d31
this should work
simone-silvestri Nov 28, 2024
c620492
typo
simone-silvestri Nov 28, 2024
3d35878
extend surface map in halos
simone-silvestri Dec 10, 2024
4ff3f59
Merge remote-tracking branch 'origin/main' into ss/active-index-macro
simone-silvestri Dec 10, 2024
3609931
this should work?
simone-silvestri Dec 10, 2024
01b71c1
works maybe
simone-silvestri Dec 10, 2024
bfcf449
should speed up a lot
simone-silvestri Dec 10, 2024
e1ad82d
precompiles
simone-silvestri Dec 10, 2024
c8efdb1
fixes
simone-silvestri Dec 10, 2024
a1f09b4
more corrections
simone-silvestri Dec 10, 2024
1c043bc
probably it should work
simone-silvestri Dec 10, 2024
ee98cf2
more corrections
simone-silvestri Dec 10, 2024
1a15fc3
more changes
simone-silvestri Dec 10, 2024
c8469ba
try this for the moment
simone-silvestri Dec 10, 2024
4373ec1
remove all duplication
simone-silvestri Dec 10, 2024
9b3c161
remove all duplication
simone-silvestri Dec 10, 2024
1615c99
Merge remote-tracking branch 'origin/main' into ss/active-index-macro
simone-silvestri Dec 10, 2024
ae6f6e3
add more stuff
simone-silvestri Dec 10, 2024
ff80a8e
better
simone-silvestri Dec 10, 2024
e6c8c8c
Merge branch 'main' into ss/active-index-macro
simone-silvestri Dec 11, 2024
f9ae12e
try new test
simone-silvestri Dec 11, 2024
af143aa
This works, we optimize performance later
simone-silvestri Dec 11, 2024
e0b2b19
some housekeeping
simone-silvestri Dec 11, 2024
c9b19c3
good active cells map test
simone-silvestri Dec 11, 2024
ae0366d
fixed index launching
simone-silvestri Dec 11, 2024
b73ecbc
just test relevant tests
simone-silvestri Dec 11, 2024
d685345
change comment
simone-silvestri Dec 11, 2024
00eac79
better
simone-silvestri Dec 11, 2024
1ebb694
it works. Back to the complete test suite.
simone-silvestri Dec 11, 2024
bda1ad5
try again
simone-silvestri Dec 11, 2024
0fca27c
fix distributed
simone-silvestri Dec 11, 2024
3256f2d
override for GPUs
simone-silvestri Dec 16, 2024
3656122
bugfix
simone-silvestri Dec 16, 2024
54fd31e
another bugfix
simone-silvestri Dec 16, 2024
6f407f7
maybe now it works?
simone-silvestri Dec 16, 2024
d159f9a
comment
simone-silvestri Dec 16, 2024
110bbfd
this should work finally
simone-silvestri Dec 16, 2024
2714946
Merge remote-tracking branch 'origin/main' into ss/active-index-macro
simone-silvestri Dec 16, 2024
6cfa3b4
add linear expand for CPU
simone-silvestri Dec 16, 2024
e8a87ac
bugfix
simone-silvestri Dec 16, 2024
3ddad87
works, restore all testing
simone-silvestri Dec 16, 2024
d6f310c
revert pipeline
simone-silvestri Dec 16, 2024
ed5a479
do this optimization in a later PR
simone-silvestri Dec 16, 2024
20a3f05
better comment
simone-silvestri Dec 16, 2024
e39bfcd
Merge branch 'main' into ss/active-index-macro
simone-silvestri Dec 21, 2024
9f5b6b6
Merge branch 'main' into ss/active-index-macro
simone-silvestri Dec 22, 2024
91e244e
Merge branch 'main' into ss/active-index-macro
simone-silvestri Dec 24, 2024
0f876dd
Merge branch 'main' into ss/active-index-macro
simone-silvestri Dec 24, 2024
13b1789
Merge branch 'main' into ss/active-index-macro
simone-silvestri Jan 18, 2025
62757ca
bugfix
simone-silvestri Jan 19, 2025
52dbf32
bugfix
simone-silvestri Jan 19, 2025
c665e21
Merge branch 'main' into ss/active-index-macro
simone-silvestri Jan 23, 2025
13399af
correction
simone-silvestri Jan 23, 2025
62b1000
Merge branch 'main' into ss/active-index-macro
simone-silvestri Jan 24, 2025
41c05df
Merge branch 'main' into ss/active-index-macro
simone-silvestri Jan 25, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'main' into ss/active-index-macro
simone-silvestri authored Jan 24, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 62b1000d04aab304f3caca1f2d0d37609ef5ae8f
29 changes: 17 additions & 12 deletions src/Advection/topologically_conditional_interpolation.jl
Original file line number Diff line number Diff line change
@@ -10,21 +10,26 @@
##### close to the boundary, or a second-order interpolation if i is close to a boundary.
#####

using Oceananigans.Grids: AbstractUnderlyingGrid, Bounded, RightConnected, LeftConnected, BoundedTopology
using Oceananigans.Grids: AbstractUnderlyingGrid,
Bounded,
RightConnected,
LeftConnected,
topology,
architecture

const AUG = AbstractUnderlyingGrid

# topologies bounded at least on one side
const BT = Union{Bounded, RightConnected, LeftConnected}

# Bounded underlying Grids
const AUGX = AUG{<:Any, <:BoundedTopology}
const AUGY = AUG{<:Any, <:Any, <:BoundedTopology}
const AUGZ = AUG{<:Any, <:Any, <:Any, <:BoundedTopology}
const AUGXY = AUG{<:Any, <:BoundedTopology, <:BoundedTopology}
const AUGXZ = AUG{<:Any, <:BoundedTopology, <:Any, <:BoundedTopology}
const AUGYZ = AUG{<:Any, <:Any, <:BoundedTopology, <:BoundedTopology}
const AUGXYZ = AUG{<:Any, <:BoundedTopology, <:BoundedTopology, <:BoundedTopology}
const AUGX = AUG{<:Any, <:BT}
const AUGY = AUG{<:Any, <:Any, <:BT}
const AUGZ = AUG{<:Any, <:Any, <:Any, <:BT}
const AUGXY = AUG{<:Any, <:BT, <:BT}
const AUGXZ = AUG{<:Any, <:BT, <:Any, <:BT}
const AUGYZ = AUG{<:Any, <:Any, <:BT, <:BT}
const AUGXYZ = AUG{<:Any, <:BT, <:BT, <:BT}

# Left-biased buffers are smaller by one grid point on the right side; vice versa for right-biased buffers
# Center interpolation stencil look at i + 1 (i.e., require one less point on the left)
@@ -98,10 +103,10 @@ for bias in (:symmetric, :biased)
# Conditional high-order interpolation in Bounded directions
if ξ == :x
@eval begin
@inline $alt1_interp(i, j, k, grid::AUGX, scheme::HOADV, args...) =
ifelse($outside_buffer(i, topology(grid, 1), grid.Nx, scheme),
$interp(i, j, k, grid, scheme, args...),
$alt2_interp(i, j, k, grid, scheme.buffer_scheme, args...))
@inline $alt1_interp(i, j, k, grid::AUGX, scheme::HOADV, args...) =
ifelse($outside_buffer(i, topology(grid, 1), grid.Nx, scheme),
$interp(i, j, k, grid, scheme, args...),
$alt2_interp(i, j, k, grid, scheme.buffer_scheme, args...))
end
elseif ξ == :y
@eval begin
Original file line number Diff line number Diff line change
@@ -135,7 +135,7 @@ function map_interior_active_cells(ibg::ImmersedBoundaryGrid{<:Any, <:Any, <:Any
east_halo_dependent_cells = interior_active_indices(ibg; parameters = KernelParameters(east_boundary...))
south_halo_dependent_cells = interior_active_indices(ibg; parameters = KernelParameters(south_boundary...))
north_halo_dependent_cells = interior_active_indices(ibg; parameters = KernelParameters(north_boundary...))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can also add a constructor for tuples

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for KernelParameters


west_halo_dependent_cells = ifelse(include_west, west_halo_dependent_cells, nothing)
east_halo_dependent_cells = ifelse(include_east, east_halo_dependent_cells, nothing)
south_halo_dependent_cells = ifelse(include_south, south_halo_dependent_cells, nothing)
Original file line number Diff line number Diff line change
@@ -39,9 +39,9 @@ function compute_buffer_tendency_contributions!(grid::DistributedActiveCellsIBG,
:east_halo_dependent_cells,
:south_halo_dependent_cells,
:north_halo_dependent_cells)

active_cells_map = @inbounds maps[name]

# If the map == nothing, we don't need to compute the buffer because
# the buffer is not adjacent to a processor boundary
!isnothing(map) && compute_hydrostatic_free_surface_tendency_contributions!(model, :xyz; active_cells_map)
You are viewing a condensed version of this merge commit. You can view the full changes here.