Repository navigation
Conversation
TYPE: text only KEYWORDS: license, Apache-2.0, contributor license, doc/licenses SOURCE: Yoel Sevi (Google) DESCRIPTION OF CHANGES: Problem: Following the contributor-license mechanism established in PR wrf-model#2242 (doc/licenses/fraunhofer_license.txt), Google-authored code blocks in subsequent performance pull requests need a standalone permissive license file under doc/licenses/ while leaving WRF's root LICENSE.txt unmodified. Solution: Add doc/licenses/google_license.txt containing the Apache License, Version 2.0 (Copyright 2026 Google LLC), referenced by `! THE FOLLOWING LINES OF CODE ARE LICENSED UNDER doc/licenses/google_license.txt` and `! END LICENSE` comment markers around Google-authored code blocks. If maintainers prefer lower inline marker density on PRs with interleaved edits, I am happy to explore a lighter per-routine notice option. License: Notwithstanding anything else to the contrary set out in https://github.com/wrf-model/WRF, the material here is being released under the Apache 2.0 licence at https://www.apache.org/licenses/LICENSE-2.0 (see doc/licenses/google_license.txt). ISSUE: None LIST OF MODIFIED FILES: A doc/licenses/google_license.txt TESTS CONDUCTED: 1. Documentation-only addition under doc/licenses/; zero source, build, or runtime changes. 2. Pending upstream Jenkins CI. RELEASE NOTE: Add doc/licenses/google_license.txt (Apache-2.0) for Google-contributed performance patches.
TYPE: enhancement KEYWORDS: dyn_em, advance_w, tridiagonal solver, acoustic small step, module_small_step_em SOURCE: Yoel Sevi (Google) DESCRIPTION OF CHANGES: Problem: advance_w in dyn_em/module_small_step_em.F runs on every acoustic substep (7 calls per RK3 step with 4 sound steps, 10 with 6). At every vertical level k, it recomputes the lower-interface pressure-flux division c2a(i,k-1,j)*rdnw(k-1)/(c1h(k-1)*MUT+c2h(k-1)) and geopotential difference dphi_km1 already computed at level k-1, and sweeps separate k-loops for t_2ave/rhs/wdwn setup, forward tridiagonal elimination, and backward ph update. Solution: - Fuse the t_2ave/rhs/wdwn setup pass and hoist top_lid outside the k-loop. - Carry 1D q_dp(its:ite) and dphi_km1(its:ite) from level k-1 to k, halving floating-point divisions in the vertical w RHS loop. - Fuse forward tridiagonal elimination into that k-pass, and fuse backward w substitution with the ph update when damp_opt /= 3. License: Notwithstanding anything else to the contrary set out in https://github.com/wrf-model/WRF, the material here is being released under the Apache 2.0 licence at https://www.apache.org/licenses/LICENSE-2.0 (see doc/licenses/google_license.txt). ISSUE: None LIST OF MODIFIED FILES: M dyn_em/module_small_step_em.F TESTS CONDUCTED: 1. On gfortran 15.2.0 (x86-64 Linux, 4-core VMs, MPICH), passed -fcheck=all and sNaN FPE-trap tests (r4 and -r8) across phi_adv_z = 1/2, top_lid T/F, and damp_opt = 0/3 with max_abs_diff = 0.0. An earlier broader small-step patch saved ~2.3% paired solver time on the 600-step 3D TKE LES case; this trimmed patch was not timed in isolation and was verified end-to-end as part of the full series. Built and verified as part of the full optimization series on x86-64 Linux (gfortran 15.2.0, MPICH, 4-core VMs, 5 interleaved repeats across 5 em_real workflows) across Make (serial, dmpar r4 and -r8, dm+sm), CMake (dmpar), and -DWRF_CHEM=1 with 0 new compiler warnings and bit-for-bit identical wrf.exe outputs (diffwrf = 0 with gfortran on x86-64 without fused multiply-add). 2. Pending upstream Jenkins CI (including Intel and non-x86 compilers). RELEASE NOTE: Carry vertical pressure-flux terms across k and fuse tridiagonal sweeps in advance_w (dyn_em/module_small_step_em.F).
Collaborator
|
The regression test results: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Carry vertical pressure-flux terms across k and fuse sweeps in advance_w.
TYPE: enhancement
KEYWORDS: dyn_em, advance_w, tridiagonal solver, acoustic small step, module_small_step_em
SOURCE: Yoel Sevi (Google)
DESCRIPTION OF CHANGES:
Problem:
advance_w in dyn_em/module_small_step_em.F runs on every acoustic substep (7
calls per RK3 step with 4 sound steps, 10 with 6). At every vertical level k,
it recomputes the lower-interface pressure-flux division
c2a(i,k-1,j)*rdnw(k-1)/(c1h(k-1)*MUT+c2h(k-1)) and geopotential difference
dphi_km1 already computed at level k-1, and sweeps separate k-loops for
t_2ave/rhs/wdwn setup, forward tridiagonal elimination, and backward ph update.
Solution:
floating-point divisions in the vertical w RHS loop.
substitution with the ph update when damp_opt /= 3.
License: Notwithstanding anything else to the contrary set out in https://github.com/wrf-model/WRF, the material here is being released under the Apache 2.0 licence at https://www.apache.org/licenses/LICENSE-2.0 (see doc/licenses/google_license.txt).
LIST OF MODIFIED FILES:
A doc/licenses/google_license.txt
M dyn_em/module_small_step_em.F
TESTS CONDUCTED:
sNaN FPE-trap tests (r4 and -r8) across phi_adv_z = 1/2, top_lid T/F, and
damp_opt = 0/3 with max_abs_diff = 0.0. An earlier broader small-step patch
saved ~2.3% paired solver time on the 600-step 3D TKE LES case; this trimmed
patch was not timed in isolation and was verified end-to-end as part of the
full series.
Built and verified as part of the full optimization series on x86-64 Linux
(gfortran 15.2.0, MPICH, 4-core VMs, 5 interleaved repeats across 5 em_real
workflows) across Make (serial, dmpar r4 and -r8, dm+sm), CMake (dmpar),
and -DWRF_CHEM=1 with 0 new compiler warnings and bit-for-bit identical
wrf.exe outputs (diffwrf = 0 with gfortran on x86-64 without fused
multiply-add).
RELEASE NOTE: Carry vertical pressure-flux terms across k and fuse tridiagonal sweeps in advance_w (dyn_em/module_small_step_em.F).
Part of the modular CPU performance series; combined multi-workflow benchmarks, hardware/compiler setup, and per-PR summary table are in the Series Overview comment on PR 01 (#2470).
Prepared with AI assistance (Google Gemini).