Skip to content

WW3 speed-up in coupled E3SM - #15

Merged
sbrus89 merged 1 commit into
E3SM-Project:e3smfrom
OlawaleClimate:ww3-perf-speedup
Nov 20, 2026
Merged

sbrus89 merged 1 commit into
E3SM-Project:e3smfrom
OlawaleClimate:ww3-perf-speedup

Conversation

@OlawaleClimate

@OlawaleClimate OlawaleClimate commented Oct 29, 2026 •

Copy link
Copy Markdown

Pull Request Summary

This PR provides MPI updates to w3wavemd.F90 that speed up WW3 in coupled E3SM by nearly a factor of 4.

Description

This PR makes two changes to model/src/w3wavemd.F90. Both are bit-for-bit.

The active-sea-point count in W3NMIN is rewritten as a single pass. The routine looked up the owner of every sea point once per rank, every coupling step (NAPROC x NSEA lookups, 44 million per step on 447 ranks). It now makes one pass with a per-rank tally and produces the same counts.

The per-bin spectral gather/scatter is replaced with an all-to-all exchange. The existing persistent-request exchange between the spatial and spectral decompositions hung three of three 47-node coupled runs, with one WAV rank stuck in MPI_WAITALL. The new routine W3XYA2A moves the same values with two MPI_ALLTOALLV calls. Ten 47-node runs since, including a full simulated year, have completed without a hang. Setting the environment variable WW3_XY_ALLTOALL=0 restores the old exchange.

Together with a rebalanced 47-node processor layout on the E3SM side (CPL/ATM/ICE 1920, LND/ROF 256, OCN 384, WAV 448), coupled throughput on Chrysalis went from 4.18 to 8.61 simulated years per day. The layout is an E3SM configuration setting and is not part of this PR.

WW3_explainer_slides.pdf

1. Single-pass sea-point count (W3NMIN, w3wavemd.F90). The routine counted
   active sea points once per rank over all points, 44 million lookups per
   step at 447 ranks. One pass with a tally per rank gives the same counts.
   WW3 on the production layout: 51.5 -> 14.2 s per model day.

2. All-to-all spectral exchange (new routine W3XYA2A, w3wavemd.F90). The
   per-bin persistent-request gather/scatter, whose MPI_WAITALL hung three of
   three 47-node runs, is replaced by two MPI_ALLTOALLV calls moving the same
   values. Ten 47-node runs since, including a full year, with no hang.
   WW3_XY_ALLTOALL=0 restores the old path.

3. Suggested processor layout for 47 nodes, once 1 and 2 are in: CPL/ATM/ICE
   1920@0, LND/ROF 256@1920, OCN 384@2176, WAV 448@2560. With WW3 off the
   critical path this gives 4.18 -> 8.61 simulated years per day (one year
   in 2 h 52 min). Optional; the code changes stand on their own.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016qnzCGE6PQFZXSrrFR8wEz
@erinethomas

erinethomas commented Oct 29, 2026 •

Copy link
Copy Markdown

this PR has now been thoroughly tested.
I have run two 1-month simulation with and without this modification using fully coupled E3SM+WW3 simulations, The results are BFB.
I have also tested this in a fully coupled (LRW) 5 year simulation, where this PR :

  1. not only provides drastic speed up in the WW3 component (getting up to 9.5 SYPD from 3.5),
    but it also 2) fixes the existing 'MPI' hang issue that has been plaguing WW3 on chrysalis for months.

@erinethomas erinethomas reopened this Oct 29, 2026

@sbrus89 sbrus89 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Passes:

SMS_D_Ln3.TL319_EC30to60E2r2_wQU225EC30to60E2r2.GMPAS-JRA1p5-WW3.chrysalis_intel.ww3-jra_1958
SMS_D_Ln3.ne30pg2_IcoswISC30E3r5_wQU225Icos30E3r5.WCYCL2010-WW3.chrysalis_intel
SMS_D_Ln3.ne30pg2_IcoswISC30E3r5_wQU225Icos30E3r5.WCYCL1850-WW3.chrysalis_intel
PET_Ld1.ne30pg2_IcoswISC30E3r5_wQU225Icos30E3r5.WCYCL1850-WW3.chrysalis_intel
ERS_Ld3.ne30pg2_IcoswISC30E3r5_wQU225Icos30E3r5.WCYCL1850-WW3.chrysalis_intel

@sbrus89
sbrus89 merged commit aebdc1b into E3SM-Project:e3sm Nov 20, 2026
4 of 8 checks passed
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.

3 participants