bugfix: Avoid PETSc IS size query during boundary rebuild#287
Open
gthyagi wants to merge 1 commit into
Open
Conversation
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.
Summary
Fixes #285.
This changes the
UW_Boundariesrebuild in_dm_unstack_bcs()to test the returned PETScISobject by truthiness instead of callinggetSize()before setting the stratum.Root cause
Imported DMPlex meshes can include non-boundary labels such as an
Elements/ cell-region label. During boundary label reconstruction,label.getStratumIS()may return an empty or otherwise problematic PETScISfor those labels. Callinglabel_is.getSize()on that object can trigger a PETSc-level abort before the Stokes system is assembled, which is what issue #285 reports fortests/test_1012_stokesImportedDMPlex.py::test_stokes_essential_bc_imported_dmplex.The new check follows the existing safer PETSc-object truthiness pattern and avoids dereferencing the
ISonly to determine whether it is usable.Validation
./uw buildPYTHONFAULTHANDLER=1 ./uw python -X faulthandler -m pytest tests/test_1012_stokesImportedDMPlex.py::test_stokes_essential_bc_imported_dmplex -ra -vv -spassed./uw python -m pytest tests/test_1012_stokesImportedDMPlex.py tests/test_0502_boundary_integrals.py -ra -qpassed: 23 passed./uw python -m pytest tests/test_0001_meshes.py tests/test_0830_mesh_adapt_variable_transfer.py -ra -qpassed: 16 passed, 5 skipped./uw python -m pytest tests/test_1001_poisson_constants.py -ra -qpassed: 6 passed./uw testcompleted with unrelated existing failures in memprobe/kdtree and AMR swarm migration tests: 6 failed, 618 passed, 14 skipped, 753 deselected, 7 xfailed, 1 xpassedNotes
The patch is intentionally minimal: it preserves
_dm_unstack_bcs()label reconstruction behavior while avoiding the PETScIS.getSize()call that reproduces the segfault path.