Share common Scatterer between Vectors on same FunctionSpace - #4293
Open
chrisrichardson wants to merge 18 commits into
Open
Share common Scatterer between Vectors on same FunctionSpace#4293chrisrichardson wants to merge 18 commits into
chrisrichardson wants to merge 18 commits into
Conversation
Member
|
Can you describe the fix? Issue #3065 presents several options, with pros and cons. |
chrisrichardson
marked this pull request as ready for review
July 21, 2026 13:10
- Function::collapse() built its new Vector via the two-argument (map, bs) constructor, which constructs a fresh Scatterer instead of reusing the one already built by the collapsed FunctionSpace. Use the FunctionSpace-based Vector constructor instead. - Mark the new FunctionSpace-based Vector constructor explicit to match the existing converting-constructor convention and avoid accidental implicit conversions. - Remove a stray blank line before the first FunctionSpace constructor's body. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The point-to-point scatter_fwd_begin/scatter_rev_begin overloads share communicator _comm0 for both directions, but used a fixed send tag (0) paired with MPI_ANY_TAG on the matching receive. That relies on messages being posted in the same relative order on every rank to avoid a forward message being matched against a reverse receive (or vice versa) - an assumption that no longer holds now that a Scatterer can be shared across sibling Vectors on the same FunctionSpace, which allows independent scatters to be interleaved in either order. Give forward and reverse each a fixed, distinct tag instead, so message matching no longer depends on posting order. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
MPI neighbourhood collectives are the only communication mode now used, simplifying the Scatterer interface and removing the unused point-to-point code path and its dedicated MPI tags. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…to chris/vector-share-scatterer
garth-wells
reviewed
Aug 2, 2026
Member
|
I'm not entirely sure that the |
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.
Resolves #3065 by adding a
ScatterertoFunctionSpace. AllFunctions created on aFunctionSpacenow create aVectorwith the same sharedScatterer.Because all
Vectors in the sameFunctionSpacehave the same parallel layout, a sharedScatterershould always work. TheMPI_Requestand the actual data, required during a scatter operation are external to theScattererso should not be affected by sharing theScattereritself.