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

Add gpu box limiters job #1568

Merged
merged 1 commit into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 9 additions & 0 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -987,6 +987,15 @@ steps:
artifact_paths:
- "examples/hybrid/box/output/box_advection_limiter_gaussian_bells_D0/*"

- label: ":computer: 3D Box limiters advection Gaussian bells GPU"
key: "gpu_box_advection_limiter_gaussian_bells"
command:
- "julia --color=yes --project=examples examples/hybrid/box/limiters_advection.jl gaussian_bells"
artifact_paths:
- "examples/hybrid/box/output/box_advection_limiter_gaussian_bells_D0/*"
agents:
slurm_gpus: 1

- label: ":computer: 3D Box limiters advection slotted spheres"
key: "cpu_box_advection_limiter_slotted_spheres"
command:
Expand Down
12 changes: 9 additions & 3 deletions examples/hybrid/box/limiters_advection.jl
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ convergence_rate(err, Δh) =
# Function space setup
function hvspace_3D(
::Type{FT};
device = ClimaComms.device(),
device,
context = ClimaComms.SingletonCommsContext(device),
xlim = (-2π, 2π),
ylim = (-2π, 2π),
Expand Down Expand Up @@ -149,8 +149,11 @@ function init_state(cspace, fspace, test_case, params)
# Initialize state
ρ_init = ρ₀ .* ones(cspace)
q_init = map(Fields.coordinate_field(cspace)) do coord
rd = (
Geometry.euclidean_distance(coord, bell_centers[1]),
Geometry.euclidean_distance(coord, bell_centers[2]),
)
(; x, y, z) = coord
rd = Geometry.euclidean_distance.((coord,), bell_centers)
if test_case isa SlottedSpheres
if rd[1] <= r0 && abs(x - bell_centers[1].x) >= r0 / 6
return 1.0
Expand Down Expand Up @@ -187,7 +190,9 @@ end
ENV["GKSwstype"] = "nul"
using ClimaCorePlots, Plots
Plots.GRBackend()
dirname = "box_advection_limiter_$(name(test_case))"
device = ClimaComms.device()
dev_suffix = device isa ClimaComms.CUDADevice ? "_gpu" : ""
dirname = "box_advection_limiter_$(name(test_case))$dev_suffix"

FT = Float64;
params = LimAdvectionParams{FT}();
Expand Down Expand Up @@ -282,6 +287,7 @@ for (k, horz_ne) in enumerate(horz_ne_seq)
# Set up 3D spatial domain - doubly periodic box
cspace, fspace = hvspace_3D(
FT;
device,
Nij = Nij,
xelems = horz_ne,
yelems = horz_ne,
Expand Down
Loading