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, vertical_diffusion_2, vertical_diffusion_s, LES, stack memory SOURCE: Yoel Sevi (Google) DESCRIPTION OF CHANGES: Problem: vertical_diffusion_2 in dyn_em/module_diffusion_em.F allocates a patch-sized 3D automatic array var_mix(ims:ime, kms:kme, jms:jme) and copies 3D thp and every active moisture species moist(:,:,:,im) into var_mix before calling vertical_diffusion_s. Inside vertical_diffusion_s, four full-tile 3D automatic arrays (H3, xkxavg, unused rravg, and tmptendf) are allocated and swept across separate 3D DO j passes even though vertical flux divergence has no j dependencies. Solution: - Eliminate 3D var_mix in vertical_diffusion_2 by passing thp and moist(ims,kms,jms,im) directly to vertical_diffusion_s with an optional 1D var_base (t_base or qv_base when .not. mix_full_fields). - Drop unused rravg and replace H3, xkxavg, and tmptendf in vertical_diffusion_s with a 2D H3(its:ite, kts:kte) j-slab and scalar xkxavg_s/tmptendf_s under one fused DO j = j_start, j_end loop with identical floating-point evaluation order (net -36 code lines). 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_diffusion_em.F TESTS CONDUCTED: 1. Net cleanup removing a patch-sized 3D copy per scalar and four 3D tile scratch arrays (runtime impact together with PR 13 is +0.1 percentage points paired on the 3D TKE LES case). vertical_diffusion_2 is not covered by the standalone harness; verification is full-model: diffwrf = 0 on the 100-m 3D TKE LES case (dmpar, plus a smaller dm+sm case), and on em_quarter_ss (mix_full_fields = .true.) and a -r8 LES run on an earlier revision of the 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: Eliminate 3D var_mix copies in vertical_diffusion_2 and replace 3D scratch arrays in vertical_diffusion_s with a 2D H3(its:ite, kts:kte) j-slab (dyn_em/module_diffusion_em.F).
This was referenced Nov 17, 2026
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.
Remove 3D var_mix copy and use 2D j-slab H3 in vertical_diffusion_2/s.
TYPE: enhancement
KEYWORDS: dyn_em, vertical_diffusion_2, vertical_diffusion_s, LES, stack memory
SOURCE: Yoel Sevi (Google)
DESCRIPTION OF CHANGES:
Problem:
vertical_diffusion_2 in dyn_em/module_diffusion_em.F allocates a patch-sized 3D
automatic array var_mix(ims:ime, kms:kme, jms:jme) and copies 3D thp and every
active moisture species moist(:,:,:,im) into var_mix before calling
vertical_diffusion_s. Inside vertical_diffusion_s, four full-tile 3D automatic
arrays (H3, xkxavg, unused rravg, and tmptendf) are allocated and swept across
separate 3D DO j passes even though vertical flux divergence has no j
dependencies.
Solution:
moist(ims,kms,jms,im) directly to vertical_diffusion_s with an optional 1D
var_base (t_base or qv_base when .not. mix_full_fields).
vertical_diffusion_s with a 2D H3(its:ite, kts:kte) j-slab and scalar
xkxavg_s/tmptendf_s under one fused DO j = j_start, j_end loop with identical
floating-point evaluation order (net -36 code lines).
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_diffusion_em.F
TESTS CONDUCTED:
scratch arrays (runtime impact together with PR 13 (Remove nine 3D scratch arrays and dead loops in tke_dissip and tke_shear #2482) is +0.1 percentage points
paired on the 3D TKE LES case). vertical_diffusion_2 is not covered by the
standalone harness; verification is full-model: diffwrf = 0 on the 100-m
3D TKE LES case (dmpar, plus a smaller dm+sm case), and on em_quarter_ss
(mix_full_fields = .true.) and a -r8 LES run on an earlier revision of the
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: Eliminate 3D var_mix copies in vertical_diffusion_2 and replace 3D scratch arrays in vertical_diffusion_s with a 2D H3(its:ite, kts:kte) j-slab (dyn_em/module_diffusion_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).