Skip to content
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
6 changes: 3 additions & 3 deletions .buildkite/longruns/pipeline.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
agents:
queue: central
slurm_mem: 8G
modules: climacommon/2025_03_18
modules: climacommon/2025_03_18 # climacommon/2026_02_18

env:
OPENBLAS_NUM_THREADS: 1
Expand All @@ -26,7 +26,7 @@ steps:
key: "cpu_unittests"
command:
- "julia --project=test --color=yes test/aerosol_activation_emulators.jl"

- wait: ~
continue_on_failure: true

Expand All @@ -36,4 +36,4 @@ steps:
slack-message -c "#microphysics-dev" -x "CloudMicrophysics buildkite-longruns success"
else
slack-message -c "#microphysics-dev" -x "CloudMicrophysics buildkite-longruns failure"
fi
fi
5 changes: 3 additions & 2 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
agents:
queue: central
slurm_mem: 8G
modules: climacommon/2025_03_18
slurm_time: 00:15:00
modules: climacommon/2025_03_18 # climacommon/2026_02_18

env:
OPENBLAS_NUM_THREADS: 1
Expand Down Expand Up @@ -43,6 +42,7 @@ steps:
CLIMACOMMS_DEVICE: "CUDA"
agents:
slurm_gpus: 1
slurm_time: 00:15:00

- label: ":cyclone: ClimaCore + GPU unit tests"
key: "clima_core_gpu_unittests"
Expand All @@ -52,3 +52,4 @@ steps:
CLIMACOMMS_DEVICE: "CUDA"
agents:
slurm_gpus: 1
slurm_time: 00:15:00
2 changes: 1 addition & 1 deletion .github/workflows/JuliaFormatter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ jobs:
steps:
- uses: julia-actions/julia-format@v4
with:
version: '1' # Set `version` to '1.0.54' if you need to use JuliaFormatter.jl v1.0.54 (default: '1')
version: '2'
suggestion-label: 'format-suggest' # leave this unset or empty to show suggestions for all PRs
8 changes: 1 addition & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,8 @@ jobs:
strategy:
fail-fast: false
matrix:
version: ['1.10', '1.11']
version: ['1.10', '1.12']
os: [ubuntu-latest, macOS-latest, windows-latest]
exclude:
- os: windows-latest
version: '1.11'
include:
- os: windows-2022
version: '1.11'
steps:
- uses: actions/checkout@v6
- uses: julia-actions/cache@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- uses: actions/checkout@v6
- uses: julia-actions/setup-julia@latest
with:
version: '1.11'
version: '1.12'
- name: Install dependencies
run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
- name: Build and deploy
Expand Down
1 change: 1 addition & 0 deletions test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ MLJ = "add582a8-e3ab-11e8-2d5e-e98b27df1bc7"
MLJFlux = "094fc8d1-fd35-5302-93ea-dabda2abf845"
MLJModels = "d491faf4-2d78-11e9-2867-c94bc002c0b7"
OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
Profile = "9abbd945-dff8-562f-b5e8-e1ebf5ef1b79"
QuadGK = "1fd47b50-473d-5c70-9696-f719f8f3bcdc"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
RootSolvers = "7181ea78-2dcb-4de3-ab41-2b8ab5a31e74"
Expand Down
31 changes: 23 additions & 8 deletions test/performance_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import CloudMicrophysics.Nucleation as HN
import CloudMicrophysics.P3Scheme as P3
import CloudMicrophysics.Parameters as CMP
import CloudMicrophysics.CloudDiagnostics as CMD
import Profile

function bench_press(
type,
Expand All @@ -42,7 +43,25 @@ function bench_press(

TT.@test BT.minimum(trail).time < min_run_time
TT.@test trail.memory <= min_memory
TT.@test trail.allocs <= min_allocs

if !(trail.allocs <= min_allocs)
# If allocations are above the threshold, print the allocations
Profile.clear()
Profile.Allocs.@profile sample_rate=1 foo(args...)
results = Profile.Allocs.fetch()
sorted = sort(results.allocs, by = x->x.size)
if isempty(sorted)
@info "No allocations detected using Profile.Allocs.@profile"
else
sorted_str = join(sorted, "\n\n")
@error sorted_str
# largest allocation
trace = sorted[end].stacktrace
@error join(trace, "\n")
end
Profile.clear()
TT.@test trail.allocs <= min_allocs
end

# Test that foo is free from optimization failures
# and unresolved method dispatches
Expand Down Expand Up @@ -155,7 +174,7 @@ function benchmark_test(FT)
bench_press(FT, P3.get_distribution_logλ, (params_P3, L_ice, N_ice, F_rim, ρ_rim), 30_000)
bench_press(FT, P3.ice_terminal_velocity_number_weighted, (ch2022, ρ_air, state, logλ), 120_000)
bench_press(FT, P3.ice_terminal_velocity_mass_weighted, (ch2022, ρ_air, state, logλ), 135_000)
bench_press(FT, P3.integrate, (x -> x^4, FT(0), FT(1)), 3_000)
bench_press(FT, P3.integrate, (x -> x^4, FT(0), FT(1)), 3_300)
bench_press(FT, P3.D_m, (state, logλ), 3_000)

@info "P3 Ice Nucleation"
Expand Down Expand Up @@ -203,12 +222,8 @@ function benchmark_test(FT)
@info "Non-equilibrium Microphysics"
bench_press(FT, CMN.τ_relax, (liquid,), 15)
bench_press(FT, CMN.conv_q_vap_to_q_lcl_icl, (ice, FT(2e-3), FT(1e-3)), 15)
bench_press(
FT,
CMN.conv_q_vap_to_q_lcl_icl_MM2015,
(liquid, tps, FT(0.00145), FT(0), FT(0), FT(0), FT(0), FT(0.8), FT(263)),
70,
)
bench_press(FT, CMN.conv_q_vap_to_q_lcl_icl_MM2015,
(liquid, tps, FT(0.00145), FT(0), FT(0), FT(0), FT(0), FT(0.8), FT(263)), 75)

@info "0-Moment Scheme"
bench_press(FT, CM0.remove_precipitation, (p0m, q_liq, q_ice), 12)
Expand Down
Loading