Skip to content

Default to the WRF output and rank settings measured in #89 - #91

Closed
aethr wants to merge 3 commits into
wrf-namelist-overridesfrom
wrf-performance-defaults
Closed

aethr wants to merge 3 commits into
wrf-namelist-overridesfrom
wrf-performance-defaults

Conversation

@aethr

@aethr aethr commented Oct 8, 2026 •

Copy link
Copy Markdown

Makes the #89 findings the defaults. Stacked on #90, so it can adjust the rank-count call #90 added for quilting. Measured results are in #89 (comment).

Changes

Setting Where Measured effect (aust10km, c8id.16xlarge) Output
history_begin_h = num_hours_spin_up setup_for_wrf.py −16%: 144 fewer frames written byte-identical
use_netcdf_classic = .true. setup_for_wrf.py −33%: 8.7 s → 2.5 s per frame byte-identical
debug_level = 0 (was 100) setup_for_wrf.py, and removed from every domains/*/namelist.wrf −7% of compute byte-identical
Ranks = physical cores safe_mpi_tasks(), new physical_cpu_count() −13% on top of the above rounding-level differences (see #89)

Together: wrf-run 8,125 s → 4,163 s.

Notes

  • Where the settings live: the three output settings are set in setup_for_wrf.py when the namelist is generated, not in the domain namelists, because they describe how we run wrf.exe rather than the domain. history_begin_h follows the config's spin-up length. debug_level = 100 comes out of the domain namelists for the same reason. A run can still override any of these through WRF_NAMELIST_OVERRIDES (Set wrf.exe namelist values and mpirun arguments from the environment #90), which is applied afterwards.
  • Physical cores: physical_cpu_count() counts distinct (physical id, core id) pairs in /proc/cpuinfo, the same way the [om-metrics] entrypoint does. It falls back to os.cpu_count() where those fields are missing, as on aarch64, which has no SMT anyway. NCPUS still overrides the default.
  • Rank count by host: on the current 64-vCPU WrfStorageSpot hosts the default drops from 64 to 32 ranks. A 96-vCPU host would get 48.
  • Classic output: this only affects the history frames wrf.exe writes. average_fields() still compresses the hourly WRFOUT files, and nccopy_compress_output.sh converts any classic files left over at cleanup.

Testing

  • make test: 45 passed, including new tests for physical_cpu_count() (hyperthreaded, two-socket, no core information).
  • A domain namelist with the three settings applied writes them into &time_control as expected.
  • Each setting was run end to end in sandbox through WRF_NAMELIST_OVERRIDES / NCPUS in wrf.exe spends over half its run writing history output; cut that before sizing ranks #89, against an in-batch control. This branch's defaults themselves haven't been run end to end.

🤖 Generated with Claude Code

aethr and others added 3 commits October 9, 2026 10:57
Measured on aust10km, together these take wrf-run from 2 h 15 min to
1 h 9 min:

- history_begin_h is set from the spin-up length, so wrf.exe no longer
  writes the spin-up output that cleanup deletes unread.
- use_netcdf_classic in every domain, so the 5-minute frames are not
  compressed on rank 0 before being averaged and deleted.
- debug_level = 0 in every domain, which drops the trace lines written
  on every halo exchange.
- The default rank count is the number of physical cores, rather than
  every hardware thread.

The first three leave the hourly output byte-identical. The rank count
changes the decomposition, which changes the output at the level of
rounding, as moving between hosts already does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
use_netcdf_classic and debug_level describe how we run wrf.exe rather
than anything about a domain, so they're set alongside history_begin_h
when the namelist is generated. debug_level = 100 comes out of the domain
namelists for the same reason.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@aethr

aethr commented Oct 9, 2026

Copy link
Copy Markdown
Author

Closing in favour of #92, which includes the same perf changes but not the complexity of parameterising all the settings.

@aethr aethr closed this Oct 9, 2026
@aethr
aethr deleted the wrf-performance-defaults branch October 9, 2026 01:31
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.

1 participant