wrf-rust0.4.1

WRF post-processing diagnostics, reimplemented in Rust, with a wrf-python-compatible Python API.

Performance

The 0.3.0 release makes the severe-weather diagnostic pipeline about 3.3× faster on large grids. The numbers below come from a measured audit on one real high-resolution WRF file — methodology first, then the baseline that was measured, then what changed. This is a single-file pipeline benchmark on stated hardware, not a general benchmark suite.

1 Methodology

ItemValue
Input file Real wrfout_d03, 2,388,958,814 bytes, one time step
Grid 800 × 800 × 79 (nx × ny × nz), dx = dy = 250 m
Hardware Intel Core Ultra 7 (24 threads), 123 GB RAM, Linux
File placement tmpfs (RAM) — "cold" timings exclude disk I/O and isolate decode + compute
Build cargo build --release, one WrfFile handle shared across all products
Workload 79-product severe/diagnostic set (all registered 2-D diagnostics except the ECAPE-heavy group), in a real consumer's processing order; per-product wall timing plus /usr/bin/time -v totals

2 Measured baseline (pre-0.3.0)

The audited baseline for the full 79-product pass at 24 threads: 185.3 s wall, 2740 s user (1484% CPU), peak RSS 7.47 GB. Two structural costs dominated:

ProductWall (s)Dominant cost
stp_effective18.32Two uncached EIL scans
scp18.25Two uncached EIL scans
vtp_mod17.52Two uncached EIL scans
ncape9.77Full entraining-parcel grid solve
effective_srh8.97EIL scan
ebwd8.80EIL scan
effective_inflow8.78EIL scan
effective_cape8.53EIL scan
slp7.26First-touch 3-D reads and decode
sb6capemu3cape (6 products)6.05–7.01 eachSequential depth-limited CAPE
el5.89Sequential column loop
dcape + dcp10.59DCP did not reuse DCAPE
sbcape0.85Grid-parallel ascent (shared with sbcin via stack cache)
cached companions (sbcin, lcl, lfc, …)≈0.001–0.003Cache hits

Thread scaling (baseline, same 79-product set)

ThreadsWall (s)CPUPeak RSS
24185.31484%7.47 GB
12276.0907%7.47 GB
6456.3513%7.47 GB

4× the threads bought 2.46× at baseline because roughly 45 s of the pass was single-threaded product code (the six depth-limited CAPEs plus el); the parallel remainder scaled at about 2.9× for 4× threads, limited by memory bandwidth and serial read sections. Peak memory is thread-independent (it is the per-timestep intermediate cache).

Cold vs warm (baseline, fresh file handle per product)

With a fresh WrfFile per product, first-call cost is dominated by dependency loading — reading and deriving the 3-D thermodynamic stack costs 6–8 s once, after which most products are sub-second. Selected pairs (cold / warm, seconds): slp 7.10 / 0.016, sbcape 7.79 / 0.001, srh1 7.83 / 0.76, maxdbz 7.42 / 2.56, stp_effective 27.25 / 17.83, ncape 19.20 / 0.002.

3 What changed in 0.3.0

4 Result and honest scope

On the pipeline class above, the audit's identified savings and the release verification put the same 79-product pass in the ≈57 s class at 24 threads, against the measured 185.3 s baseline — the ≈3.3× figure in the 0.3.0 release notes. No science changes were mixed into the optimization work; results remain gated by the parity harness.

Scope statements, so the numbers are not over-read: