-
Notifications
You must be signed in to change notification settings - Fork 578
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tpetra: use created subviews of communication buffers #6598
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
j
isn't necessarily the correct offset. We should actually usejj
(see above) here, in case*this*
views a noncontiguous set of columns of another MultiVector.Actually, if Y views a contiguous proper subset of columns of X, and Z views a noncontiguous proper subset of columns of Y, then
jj
is not even the right entry ofimports_
. We can fix that in the "view contiguous subset of columns" constructors and methods by adjusting the offset ofimports_
andexports_
accordingly.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I should switch j to jj? Note that previously, the subviews took the first newSize entries of the buffer always. If the buffers are strictly used for communication, that might be fine, but I thought indexing into them would be better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kddevin wrote:
That's correct. They are used for nothing other than communication of packed data.
Yes. I actually studied the example in my above comments, and I think this is a complete fix, given how
MultiVector::subView*
work.If we switch
j
tojj
, that will fix the case where different single Vectors view distinct columns of one MultiVector. In this case, your change will mean that different Vectors will view different parts of the buffer. Thus, you'll be able to do concurrent asynchronous doExport or doImport correctly with the Vectors.Consider the following, more complicated example:
Y views columns 1, 2, 3, 4, and 5 of X. Z views columns 0, 2, and 4 of X. W views columns 0, 2, and 4 of Y -- thus, columns 1, 3, and 5 of X. Users would expect it to be safe to do concurrent communication with Z and W.
In this case, they are right, because neither overload of
subViewNonConst
reuses their parent MultiVector's buffers. Thus, Z and W each would start with zero-lengthimports_
andexports_
buffers, and would each reallocate them on demand.Thus, this case is already correct, and your change doesn't break it. If we decide to make
subView*
reuse communication buffers in the future, we only need to use the correct offset. That will make the above example continue to be correct.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only way we could write a reliable test for this use case, though, would be if we had asynchronous doExport / doImport. We don't have that right now.