From c138de10903901d6dd88e09fc95b57605789ed90 Mon Sep 17 00:00:00 2001 From: Anna Jaruga Date: Mon, 16 Mar 2026 11:34:10 -0700 Subject: [PATCH 1/2] Add Julia v1.12 to GHA CI --- .buildkite/longruns/pipeline.yml | 6 +++--- .buildkite/pipeline.yml | 5 +++-- .github/workflows/ci.yml | 8 +------- .github/workflows/docs.yml | 2 +- 4 files changed, 8 insertions(+), 13 deletions(-) diff --git a/.buildkite/longruns/pipeline.yml b/.buildkite/longruns/pipeline.yml index 17967cca0..c1c263b4b 100644 --- a/.buildkite/longruns/pipeline.yml +++ b/.buildkite/longruns/pipeline.yml @@ -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 @@ -26,7 +26,7 @@ steps: key: "cpu_unittests" command: - "julia --project=test --color=yes test/aerosol_activation_emulators.jl" - + - wait: ~ continue_on_failure: true @@ -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 \ No newline at end of file + fi diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 1e3646795..11025fa04 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -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 @@ -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" @@ -52,3 +52,4 @@ steps: CLIMACOMMS_DEVICE: "CUDA" agents: slurm_gpus: 1 + slurm_time: 00:15:00 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4dd5a36cd..0ac93ff36 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index ccdaf3469..59720b4b3 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -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 From aa3a29112c1ed4fb70d94500790ae8322531a7c1 Mon Sep 17 00:00:00 2001 From: Haakon Ludvig Langeland Ervik <45243236+haakon-e@users.noreply.github.com> Date: Thu, 12 Mar 2026 15:31:01 -0700 Subject: [PATCH 2/2] ci: update tests, JuliaFormatter v2 - in performance_tests, print allocations if they exceed the threshold (usually 0) - update to JuliaFormatter v2 --- .github/workflows/JuliaFormatter.yml | 2 +- test/Project.toml | 1 + test/performance_tests.jl | 31 +++++++++++++++++++++------- 3 files changed, 25 insertions(+), 9 deletions(-) diff --git a/.github/workflows/JuliaFormatter.yml b/.github/workflows/JuliaFormatter.yml index ad8945408..674986f25 100644 --- a/.github/workflows/JuliaFormatter.yml +++ b/.github/workflows/JuliaFormatter.yml @@ -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 diff --git a/test/Project.toml b/test/Project.toml index 76c7122d7..89a47ab9f 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -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" diff --git a/test/performance_tests.jl b/test/performance_tests.jl index 25e4a001b..be00b89f4 100644 --- a/test/performance_tests.jl +++ b/test/performance_tests.jl @@ -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, @@ -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 @@ -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" @@ -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)