Repository navigation
Mesh generators: rank-0 conversion no longer hangs at np 2; coarse internal-boundary shell builds; a missing import (#953, #949) - #1131
Merged
Conversation
- Generators that convert their gmsh file inside a rank-0 block (SegmentedSphericalShell, SegmentedSphericalBall, AnnulusWithSpokes) must build at two ranks with the cells they have on one. On development the constructors hang; the file carries a timeout so that is a failure. - SphericalShellInternalBoundary with radii 1/2, 3/4, 1 and cell size 1/2 must build. On development it raises. - meshVariable_mask_from_label must return a mask. On development it raises NameError. Underworld development team with AI support from Claude Code
…lumes told apart by radius; a missing import (#953; #949 items 2 and 5) - _gmsh_to_h5 ended with a barrier on the world communicator. Generators that convert on rank 0 alone, on COMM_SELF, reached it on one rank only and never returned at two ranks. The barrier is now skipped for a COMM_SELF caller. - SphericalShellInternalBoundary told its volumes and surfaces apart to within half a cell, which on a coarse shell is the whole gap between two radii. The tolerance is now a quarter of the smallest gap between the radii. - Mesh.meshVariable_mask_from_label imports MeshVariable. Underworld development team with AI support from Claude Code
…#1131) The segmented generators and AnnulusWithSpokes write their edited DM to HDF5 on rank 0 through a one-rank viewer and every rank then reads the file collectively. The viewer was never destroyed and nothing ordered the write before the read; the barrier removed earlier in this branch was meant to, and never ran in parallel. Each generator now destroys its viewer inside the rank-0 block and all ranks meet in a barrier after it. _gmsh_to_h5 decides on the communicator's size, not its identity, so any one-rank communicator skips the world barrier. The parallel test loses a timeout marker that cannot interrupt a blocked barrier, and says which cases guard the fix under MPICH. Underworld development team with AI support from Claude Code
This was referenced Nov 13, 2026
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 free
to 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.
Three small mesh-generator defects from a probe of old issues against
development01dec8d. No solver file is touched.What changes
SegmentedSphericalShell,SegmentedSphericalBallandAnnulusWithSpokesread their gmsh file inside a rank-0 block, onCOMM_SELF, because they edit the DM before it is distributed. The conversion (_gmsh_to_h5) ended with a barrier on the world communicator, which only rank 0 reached. The barrier is now skipped for a caller on a one-rank communicator; every collective caller keeps it. After review: each of these generators now destroys its HDF5 viewer inside the rank-0 block and all ranks meet in a barrier after it, so the file is written and closed before the collective read that follows. That ordering is what the removed barrier was meant to give and, reached by one rank only, never did.SphericalShellInternalBoundarytold its volumes and surfaces apart to within half a cell. With radii 1/2, 3/4, 1 and cell size 1/2 that is the whole gap between two spheres, and the constructor raised "Could not identify the spherical-shell volume". The OCC radii are exact, so the tolerance is now a quarter of the smallest gap between the radii.Mesh.meshVariable_mask_from_labelraisedNameError: MeshVariable; it now imports it.Tests (written first)
developmenttests/parallel/test_1176_rank0_generators_parallel.py: the three generators at np 2 hold the cells they have on one rank (the one-rank count comes from a single-rank child run in the same environment)tests/test_1177_spherical_generator_fixes.py: the coarse shell builds, with Inner and Outer cells and its three registered radiiRuntimeErrorNameErrorA regression here is a rank blocked in an MPI barrier, which a pytest timeout does not interrupt; the supervisor that
scripts/test.shruns every parallel job under is what turns the hang into a failure. Under MPICH the shell case completes on the unfixed code, so the ball and the spoked annulus are the cases that guard the fix (both found in review).Verification
On a 96-thread Linux workstation (single system image, Intel Xeon Gold 6240R, MPICH 5.0.1, PETSc int32), head 17eaebb:
extract_region(181 tests, at e95fe4e)test_0858's np 3 and np 5 cases, which could not start from our copied test directory (they launch a helper script by path). Run in the repository, the np 3 case passes; the np 5 case was not rerunparallel/test_1176,test_1175_shell_region_labels,test_0770_submesh_extract_mpiat np 2 and np 3, each with an empty mesh cache so the conversion runstest_1071_spherical_shell_geoid_parallelat np 2 and np 4 (at e95fe4e, before the review fixes)test_1177serial, empty cachescripts/check_test_coverage.pyNot run: above np 4; the full suite (left to CI).
Not in this PR
From #949: item 1 (a
CubedSpherecrease), and items 3 and 4, which snap refined vertices onto the sphere and so move recorded accuracy anchors. Item 3 (the internal surface is not on its sphere after refinement) is being handled with the design question it belongs to. A side finding:SegmentedSphericalSurface2Ddoes not build in serial either (PETSc error 75); not addressed here.Issues
Checklist (UW3 Style Charter — docs/developer/UW3_STYLE_CHARTER.md)
level_*andtier_*markers (S8)maybe_/try_/do_) and no commented-out code (S3, S4).array/mesh.X.coords— nowith ....access(...), nomesh.data(S7)pixi.toml/pixi.lockor other dependency changes riding in an unrelated PRUnderworld development team with AI support from Claude Code