Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Duplication | -8 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
5 tasks
gouarin
force-pushed
the
mpi-comm-reduction
branch
4 times, most recently
from
July 22, 2026 18:29
14877b2 to
c8be3ff
Compare
gouarin
force-pushed
the
mpi-comm-reduction
branch
from
September 1, 2026 11:51
c8be3ff to
e984990
Compare
Every mesh construction serialized and sent the full mesh state to each neighbour three times - the subdomain, the cells, then the whole mesh with every derived mesh id - even when the receivers already held identical data from the previous construction. Replace these exchanges by a token protocol: a one-int header announces whether the serialized payload follows; when it does not, the receiver keeps its cached copy of the neighbour's data. A sender only skips the payload when the receivers provably hold identical data: - cells geometrically identical to the reference mesh (the CellArray equality already used for the adaptation fixed point); - the same neighbour set; and - for the whole-mesh exchange, whose derived ids depend on the neighbours' cells, a token received from every neighbour in the cells exchange. find_neighbourhood now carries the previously exchanged neighbour meshes over to the rebuilt neighbourhood, which is the receive-side cache. The empty-neighbourhood fast path moves into the shared helper, so it still covers all three exchanges. Outputs are unchanged by construction: a token replaces the payload only when the receiver already holds an identical copy. The graduation half of the original change is dropped on rebase: hpc-maths#482 replaced the graduation fixed point by the single-pass algorithm, which exchanges one level array per level and has no repeated identical send to elide.
gouarin
force-pushed
the
mpi-comm-reduction
branch
from
September 2, 2026 08:09
e984990 to
82bc411
Compare
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.
Available tags: 'build', 'chore', 'ci', 'docs', 'feat', 'fix', 'perf', 'refactor', 'revert', 'style', 'test'
Description
Every mesh construction serialized and sent the full mesh state to each neighbour three times (subdomain, cells, then the whole mesh with every derived mesh id) - even when the receivers already held identical data from the previous construction.
This PR replaces those exchanges by a token protocol: a one-int header announces whether the serialized payload follows; when it does not, the receiver keeps its cached copy of the neighbour's data. A sender only skips the payload when the receivers provably hold identical data:
update_neighbour_subdomain,update_meshid_neighbour,update_mesh_neighbour): cells geometrically identical to the reference mesh (same_cells, from perf(mesh): detect the adaptation fixed point before constructing the new mesh #476), same neighbour set and - for the whole-mesh exchange, whose derived ids depend on the neighbours' cells - a token received from every neighbour in the cells exchange.find_neighbourhoodnow carries the previously exchanged neighbour meshes over to the rebuilt neighbourhood; they are the receive-side cache.The exchanges stay collective over the (symmetric) neighbourhood, so the communication pattern remains matched.
Measurements on
advection_2d(Tf 0.1, Apple M, MPICH + libfabric, interleaved A/B vs #476), taken before the rebase, i.e. on the pre-#482 graduation and with both halves of the original change in place. They are kept for reference; the mesh-exchange half alone on today's main has not been re-measured:socketsproviderFI_PROVIDER=tcpTokens cut the payload volume, which pays hugely on expensive transports and grows with rank count and mesh size. On a sane transport at low rank counts, the remaining MPI cost of the adaptation loop is the number of synchronous exchange rounds - addressed in #478.
Related issue
None.
How has this been tested?
Outputs are unchanged by construction: a token replaces the payload only when the receiver already holds an identical copy.
Before the rebase (on the pre-#482 base):
demos/FiniteVolume/advection_2d.cpp, Tf 0.5);tests/: 350/350 serial;tests/mpi/: 24/24 at 2/3/4 ranks, including the load-balancing migration tests which exercise the carried-over neighbour caches;After the rebase, the rebased branch is verified by CI.
Code of Conduct
By submitting this PR, you agree to follow our Code of Conduct