Add mesh-files-only internal spherical shell generation - #592
Conversation
Extract the atomic Gmsh-to-PETSc-HDF5 conversion from _from_gmsh so SphericalShellInternalBoundary can write reusable mesh files without loading and initializing an Underworld Mesh. Add write_mesh_files_only=True to return the .msh.h5 path after conversion while preserving the existing full-Mesh behavior by default. This avoids the serial Inner/Outer classification over millions of cells when callers only need reusable mesh files. Add a level-2 regression that verifies Mesh construction is bypassed and the HDF5 reloads with Lower, Internal, and Upper labels.
Adversarial review — spherical-shell cluster (#591, #592, #593, #594)Reviewed as a group because they overlap: #594 contains #591, and all four land ClusterC1. #594 is stacked on #591 — merging #594 merges #591. C2. C3. Not a defect, recorded because the diff view says otherwise. GitHub #594 — Zhong 20081. #593 — boundary-flux recovery2. The memory bound moves, it does not fall. Replacing 3. Every rank must reach the gather. The recovery is collective by #592 — internal spherical shell4. It edits 5. What we did not doNone of the four was run. The findings above come from reading the diffs and Underworld development team with AI support from Claude Code |
Summary
_gmsh_to_h5();SphericalShellInternalBoundary(write_mesh_files_only=True);.msh.h5path without constructing an in-memory UW3Mesh;Meshbehavior by default;Meshconstruction and reloading the generated HDF5 withLower,Internal, andUpperlabels.Motivation
SphericalShellInternalBoundary()currently writes the reusable.msh.h5file during Gmsh import, then reloads that file into a full UW3 mesh and materializesInnerandOutercell-region labels. The region creation loops over every cell in Python.That work is required when the caller needs the returned in-memory mesh, but it is unnecessary for workflows that only generate reusable mesh files for later MPI jobs. The custom region labels are created after the HDF5 write and therefore do not alter the already-written reusable file.
This became significant for the Zhong et al. spherical-shell benchmark on Gadi. Each
cellSize=1/64mesh contains about 4.2 million cells. The approximately 710 MB HDF5 files appeared several minutes before the serial jobs exited; one measured job completed in 15:14 using 8.35 GB while remaining CPU-bound in post-conversion mesh setup.API
With
write_mesh_files_only=True, the generator:.mshfile;.msh.h5;The default remains
write_mesh_files_only=False, so existing callers continue to receive a fully initialized UW3Meshwith no behavior change.Validation
Validated on a fresh branch from
upstream/developmentat59982834:./uw buildcompleted successfully;2 passed;The same feature diff also passed the complete level-1 suite before being squashed for this PR:
1493 passed, 33 skipped, 2 xfailed.