Uh oh!
There was an error while loading. Please reload this page.
Add spherical-shell topography and geoid postprocessing - #586
Closed
gthyagi wants to merge 2 commits into
Closed
Conversation
Introduce reusable spherical-shell topography, geoid, and Zhong-style self-gravity response helpers. Select constrained-multiplier, rotated-reaction, or CBF residual topography internally and expose the common workflow through Stokes.geoid(). Add level-2 postprocessing coverage and document the response API, conventions, and intended boundary-condition dispatch.
Gather coordinate-keyed 3D reactions and trace elements on rank zero, assemble and solve the global P1/P2 boundary-mass system once, and scatter only each rank's requested recovered values. Preserve existing recovery semantics while preallocating sparse COO arrays and propagating root-side failures collectively. This reduces the Zhong 1/64 geoid postprocessing peak from more than 576 GB to 301.77 GB on 192 ranks without changing the 1/32 coefficients.
gthyagi
commented
Aug 16, 2026
ContributorAuthor
Superseded by #591 after renaming the fork branch from |
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 freeto 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.
Summary
This PR proposes a reusable UW3 workflow for spherical-shell dynamic topography, geoid, and Zhong-style self-gravity response calculations. It also fixes the MPI memory scaling of the consistent P2 boundary-flux recovery used by rotated free-slip topography.
The implementation is intentionally split into two commits:
Add spherical-shell topography and geoid postprocessingAvoid replicated 3D boundary-flux recoveryProposed workflow
uw.postprocessing.spherical_shell_dynamic_response(...)computes the surface and CMB response in three stages:P_l^0harmonic, with the outer/CMB sign conventions handled internally.2 x 2self-gravity correction.Stokes.geoid(...)is a convenience facade. It validates spherical geometry, radii, harmonic degree, and solve convergence, then delegates all mathematics touw.postprocessing.The intended user code is therefore:
Users do not need to select separate constrained, rotated, or CBF topography routines.
Parallel memory fix
The previous 3D consistent-P2 boundary recovery used
MPI.allgather, after which every rank retained the global Python boundary mesh, assembled the same sparse surface-mass matrix, and calledspsolveindependently.The new path:
The recovery mathematics, mean-removal gauge, and local return values are unchanged.
Zhong benchmark evidence
The production benchmark is
bench_010_zhong2008_isoviscous_response.py.For
cellsize=1/64,l=5, depth0.5, 192 MPI ranks:Every coefficient improves from
1/32to1/64. The fixed1/64run completed in 7:29 with 301.77 GB peak memory; the old path was killed duringstokes.geoid()after exhausting 576 GB. Detailed measurements are in the high-resolution memory report.Validation
tests/test_1070_postprocessing_geoid.py: 5 passed.tests/test_1019_boundary_flux.py -k 3d: 3 passed.tests/parallel/test_1065_boundary_flux_parallel.py -k 3d: 2 passed on every rank.1/32results match the pre-change coefficients to floating-point roundoff.1/64, 192-rank production run completed with finite metrics and complete HDF5 output.Review request
@lmoresi, could you please double-check the geoid computation workflow, especially:
uw.postprocessingwith aStokes.geoid()facade;If UW3 already has, or should use, a better implementation or abstraction, please recommend that path. I am happy to discard or replace this implementation rather than merge duplicate or incorrectly placed machinery.
Scope
This PR intentionally excludes the unrelated mesh-files-only work already under review in #581 and the parallel non-finite interpolation fallback. It is limited to spherical topography/geoid postprocessing and the boundary-flux memory correction required by that workflow.