DomainDecomposition.coarsen, refine fix, ghost-sync fixes in axpy and essential BCs - #91
Merged
Merged
Conversation
coarsen(factors) builds an aligned coarse decomposition sharing the process topology of self (needed for geometric multigrid). refine() now shares the topology too instead of re-running compute_dims/Create_cart on the old ncells without mpi_dims_mask, and computes local_ncells from the new starts/ends. Bump version to 0.3.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Zeroing boundary coefficients left ghost copies on neighbouring processes stale while ghost_regions_in_sync stayed True, so a following StencilMatrix or derivative dot used outdated values. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
y += a*x left y marked in sync when x was not (stale ghost data in y) and wrongly changed the flag of the input x. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
Paired struphy PR: struphy-hub/struphy#91 (the struphy CI runs against this branch via the submodule pointer). |
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.
Needed for geometric multigrid in struphy (paired struphy PR: struphy-hub/struphy#91), plus two ghost-region bug fixes found while testing it under MPI.
Changes
DomainDecomposition.coarsen(factors)(new). Builds the decomposition of a coarsened grid that is aligned withself: every process owns exactly the coarse cells covering its fine cells. It shares the process topology and communicators, so it is not collective. RaisesValueErrorif starts/ends are not divisible by the factor.DomainDecomposition.refinefixed.compute_dims/Create_carton the oldncellswithoutmpi_dims_mask, so it could pick a different process grid. It also calledCreate_cartagain, which every rank has to join.local_ncellsfrom the old starts/ends.Both methods now use one helper,
_with_element_partition, which validates the partition.apply_essential_bc_stencilnow setsghost_regions_in_sync = Falseon vectors. Boundary coefficients may be ghost entries of neighbouring processes. Those kept stale values while still being marked in sync, so the next matrix-vector product used outdated data.StencilVectorSpace.axpy(behindmul_iadd) updated the sync flag of the inputxinstead of the outputy.y += a*xtherefore stayed marked in sync whenxwas not.Version bumped to 0.3.0.
Tests
ddm/tests/test_coarsen.py(serial +mpi),api/tests/test_essential_bc_ghosts.py(serial +mpi),linalg/tests/test_axpy_ghost_sync.py.linalgserial tests: 7544 passed.femMPI tests on 4 ranks: 144 passed.test_cart_3d.py,test_block.pyandtest_toarray.pyfail to collect locally because theparallelmarker is not registered. That was already the case ondevel-tiny.🤖 Generated with Claude Code