Skip to content

Commit

Permalink
More comprehensive precompilation, test driver
Browse files Browse the repository at this point in the history
  • Loading branch information
nefrathenrici committed Feb 1, 2025
1 parent 528bc6c commit b6f9bae
Show file tree
Hide file tree
Showing 7 changed files with 81 additions and 231 deletions.
216 changes: 24 additions & 192 deletions .buildkite/Manifest-v1.11.toml

Large diffs are not rendered by default.

30 changes: 0 additions & 30 deletions .buildkite/PrecompileCI/src/Precompile.jl

This file was deleted.

46 changes: 46 additions & 0 deletions .buildkite/PrecompileCI/src/PrecompileCI.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
module PrecompileCI

using PrecompileTools
import ClimaAtmos as CA
import ClimaComms
import ClimaCore: InputOutput, Meshes, Spaces, Quadratures
import ClimaParams

@compile_workload begin
FT = Float32 # Float64?
h_elem = 6 # 16, 30?
z_elem = 10 # 30, 31, 63?
x_elem = y_elem = 2
x_max = y_max = 1e8
z_max = FT(30000.0)
dz_bottom = FT(500) # other values?
z_stretch = Meshes.HyperbolicTangentStretching(dz_bottom) # Meshes.Uniform()
bubble = true # false
parsed_args =
Dict{String, Any}("topography" => "NoWarp", "topo_smoothing" => false)
comms_ctx = ClimaComms.context()
deep = false

# constants
quad = Quadratures.GLL{4}()
params = CA.ClimaAtmosParameters(FT)
radius = CA.Parameters.planet_radius(params)

# Sphere
horz_mesh = CA.cubed_sphere_mesh(; radius, h_elem)
h_space = CA.make_horizontal_space(horz_mesh, quad, comms_ctx, bubble)
CA.make_hybrid_spaces(h_space, z_max, z_elem, z_stretch; parsed_args)

# box
horizontal_mesh = CA.periodic_rectangle_mesh(; x_max, y_max, x_elem, y_elem)
h_space = CA.make_horizontal_space(horizontal_mesh, quad, comms_ctx, bubble)
# This is broken
# CA.make_hybrid_spaces(h_space, z_max, z_elem, z_stretch; parsed_args)

# plane
horizontal_mesh = CA.periodic_line_mesh(; x_max, x_elem)
h_space = CA.make_horizontal_space(horizontal_mesh, quad, comms_ctx, bubble)
end


end # module Precompile
1 change: 1 addition & 0 deletions .buildkite/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ MPI = "da04e1cc-30fd-572f-bb4f-1f8673147195"
NCDatasets = "85f8d34a-cbdd-5861-8df4-14fed0d494ab"
OrderedCollections = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
Poppler_jll = "9c32591e-4766-534b-9725-b71a8799265b"
PrecompileCI = "76d61242-8ec2-4c91-8455-3234246697a2"
PrettyTables = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d"
Profile = "9abbd945-dff8-562f-b5e8-e1ebf5ef1b79"
ProfileCanvas = "efd6af41-a80b-495e-886c-e51b0c7d77a3"
Expand Down
1 change: 1 addition & 0 deletions examples/hybrid/driver.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
redirect_stderr(IOContext(stderr, :stacktrace_types_limited => Ref(false)))
import ClimaComms
ClimaComms.@import_required_backends
import PrecompileCI
import ClimaAtmos as CA
import Random
Random.seed!(1234)
Expand Down
12 changes: 8 additions & 4 deletions examples/hybrid/test_precompile.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using PrecompileTools
PrecompileTools.verbose[] = true
import ClimaAtmos as CA
import ClimaComms
import ClimaCore: InputOutput, Meshes, Spaces, Quadratures
Expand Down Expand Up @@ -27,5 +25,11 @@ import ClimaParams
# This should more closely match `get_spaces...`
h_space = CA.make_horizontal_space(horz_mesh, quad, comms_ctx, bubble)

CA.make_hybrid_spaces(h_space, z_max, z_elem, z_stretch; parsed_args = Dict("topography" => topography))
end
CA.make_hybrid_spaces(
h_space,
z_max,
z_elem,
z_stretch;
parsed_args = Dict("topography" => topography),
)
end
6 changes: 1 addition & 5 deletions src/utils/common_spaces.jl
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,7 @@ function make_horizontal_space(
mesh,
Topologies.spacefillingcurve(mesh),
)
Spaces.SpectralElementSpace2D(
topology,
quad;
enable_bubble = bubble,
)
Spaces.SpectralElementSpace2D(topology, quad; enable_bubble = bubble)
end
return space
end
Expand Down

0 comments on commit b6f9bae

Please sign in to comment.