Skip to content

Conversation

@haakon-e
Copy link
Member

@haakon-e haakon-e commented Dec 6, 2025

In #4095, we observed that the addition of a new term vtt_bc in advection.jl, as follows:

if !(p.atmos.moisture_model isa DryModel) && energy_q_tot_upwinding != Val(:none)
    ᶜq_tot = @. lazy(specific(Y.c.ρq_tot, Y.c.ρ))
    vtt = vertical_transport(ᶜρ, ᶠu³, ᶜq_tot, FT(dt), energy_q_tot_upwinding)
    vtt_central = vertical_transport(ᶜρ, ᶠu³, ᶜq_tot, FT(dt), Val(:none))
    vtt_bc = ᶜρq_tot_vertical_transport_bc(prescribed_flow, thermo_params, t, ᶠu³)
    @. Yₜ.c.ρq_tot += vtt - vtt_central + vtt_bc
end

where vtt_bc = ᶜρq_tot_vertical_transport_bc(prescribed_flow, thermo_params, t, ᶠu³) returns either a @. lazy field or NullBroadcasted().

In the buildkite test :fire: Flame graph: perf target (Callbacks), where vtt_bc should evaluate to NullBroadcasted(), we observed ~10% more allocations, which exceeded the flame_callbacks threshold.

We hypothesize that the expression was not correctly inferred, which led to the (potential) simulation slowdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants