-
Notifications
You must be signed in to change notification settings - Fork 26
Improve tracer performance in jacobian update #4070
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
base: main
Are you sure you want to change the base?
Conversation
| @. p.scratch.ᶠtemp_scalar = ClimaAtmos.ᶠinterp(ᶜρ * ᶜJ) / ᶠJ | ||
| @. p.scratch.ᶜtemp_scalar_5 = -(ᶜwₚ) / ᶜρ | ||
| @. ∂ᶜρχₚ_err_∂ᶜρχₚ = | ||
| dtγ * -(ᶜprecipdivᵥ_matrix()) ⋅ | ||
| DiagonalMatrixRow(ᶠinterp(ᶜρ * ᶜJ) / ᶠJ) ⋅ | ||
| DiagonalMatrixRow(p.scratch.ᶠtemp_scalar) ⋅ | ||
| ᶠright_bias_matrix() ⋅ | ||
| DiagonalMatrixRow(-Geometry.WVector(ᶜwₚ) / ᶜρ) - (I,) | ||
| DiagonalMatrixRow(Geometry.WVector(p.scratch.ᶜtemp_scalar_5)) - (I,) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| @. p.scratch.ᶠtemp_scalar = ClimaAtmos.ᶠinterp(ᶜρ * ᶜJ) / ᶠJ | |
| @. p.scratch.ᶜtemp_scalar_5 = -(ᶜwₚ) / ᶜρ | |
| @. ∂ᶜρχₚ_err_∂ᶜρχₚ = | |
| dtγ * -(ᶜprecipdivᵥ_matrix()) ⋅ | |
| DiagonalMatrixRow(ᶠinterp(ᶜρ * ᶜJ) / ᶠJ) ⋅ | |
| DiagonalMatrixRow(p.scratch.ᶠtemp_scalar) ⋅ | |
| ᶠright_bias_matrix() ⋅ | |
| DiagonalMatrixRow(-Geometry.WVector(ᶜwₚ) / ᶜρ) - (I,) | |
| DiagonalMatrixRow(Geometry.WVector(p.scratch.ᶜtemp_scalar_5)) - (I,) | |
| ᶠρ = @. p.scratch.ᶠtemp_scalar = ᶠinterp(ᶜρ * ᶜJ) / ᶠJ | |
| ᶜminus_wₚ_div_ρ = @. p.scratch.ᶜtemp_scalar_5 = -(ᶜwₚ) / ᶜρ | |
| @. ∂ᶜρχₚ_err_∂ᶜρχₚ = | |
| dtγ * -(ᶜprecipdivᵥ_matrix()) ⋅ | |
| DiagonalMatrixRow(ᶠρ) ⋅ | |
| ᶠright_bias_matrix() ⋅ | |
| DiagonalMatrixRow(Geometry.WVector(ᶜminus_wₚ_div_ρ)) - (I,) |
I think giving the temp fields reasonable names improves readability.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated the intermediate computations to this:
@. p.scratch.ᶜbidiagonal_adjoint_matrix_c3 = -(ClimaAtmos.ᶜprecipdivᵥ_matrix()) ⋅ DiagonalMatrixRow(ClimaAtmos.ᶠinterp(ᶜρ * ᶜJ) / ᶠJ)
@. p.scratch.ᶠband_matrix_wvec = ClimaAtmos.ᶠright_bias_matrix() ⋅ DiagonalMatrixRow(ClimaCore.Geometry.WVector(-(ᶜwₚ) / ᶜρ))Do you have a suggestion for names that make sense here?
Split up a high register pressure broadcast. It appears that just the broadcast is nearly seven times as fast after the change. SYPD for 1m with 30 he improves by ~11%
106ef3d to
43410b9
Compare
szy21
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think there would be a good name for these temporary fields...
Purpose
Split up a high register pressure broadcast.
closes #4064
To-do
Content
It appears that just the broadcast is nearly seven times as fast after the change.
Sypd of numerics_sphere_he30ze63.yml and longrun_aquaplanet_allsky_1M.yml:
before: 0.429
after: 0.476
~11% speedup
BEFORE:

AFTER:
