Skip to content

Conversation

@ggouaillardet
Copy link
Contributor

@ggouaillardet ggouaillardet commented Nov 11, 2021

if both send and receive buffers are MPI_BOTTOM, this is not
equivalent to MPI_IN_PLACE

Thanks Lisandro Dalcin for reporting this issue.

Refs. #9650

Signed-off-by: Gilles Gouaillardet [email protected]

@awlauria
Copy link
Contributor

java failure

bot:aws:retest

{ \
inplace = 0; \
if(recvbuf == sendbuf) { \
if(recvbuf == sendbuf && MPI_BOTTOM != sendbuf) { \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this test really valid ? The MPI standard prohibits using a recvbuf equal to the sendbuf to indicate an IN_PLACE operation. Why is this macro accepting it ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get your point, but are you 100% sure about this?

Bad things will definitely occurs if sendbuf == recvbuf and for example the same datatype is used.
But if the user pass sendbuf == recvbuf with for example two datatypes that describes non overlapping subarrays, would that violate the standard? if yes, is there an explicit exception for MPI_BOTTOM ?
Also, should we enhance the C bindings and error out with a user friendly error code if the user passes sendbuf == recvbuf (unless MPI_BOTTOM) ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct, the standard prohibit overlapping regions between the typemap of the send and receive buffers. So, while it is legal to use sendbuf == recvbuf it can never represent an IN_PLACE operation. So, that macro seems a little extreme in the detection of IN_PLACE.

@dalcinl
Copy link
Contributor

dalcinl commented Nov 23, 2021

@ggouaillardet What's the status of this PR? Are you going to merge it as is despite the concerns about the macro?

@bosilca
Copy link
Member

bosilca commented Nov 23, 2021

I'll be supportive to merge despite the issue with the macro for 2 reasons. First, it is not a regression, and second I think most collective already have protection against this case in the upper layer MPI_ API.

@dalcinl
Copy link
Contributor

dalcinl commented Nov 23, 2021

@ggouaillardet Could you rebase your branch to latest ompi/master? Alternatively, could you create a scratch branch in your github fork repo with the merge of topic/nbc_mpi_bottom into ompi/master and send me a link to it? I would like to give your fix a try with mpi4py's online CI infrastructure.

if both send and receive buffers are MPI_BOTTOM, this is not
equivalent to MPI_IN_PLACE

Thanks Lisandro Dalcin for reporting this issue.

Refs. open-mpi#9650

Signed-off-by: Gilles Gouaillardet <[email protected]>
@ggouaillardet
Copy link
Contributor Author

@dalcinl I just rebased my branch on top of ompi/master

@dalcinl
Copy link
Contributor

dalcinl commented Nov 25, 2021

@ggouaillardet Your branch passed all mpi4py tests. From my side, this PR is ready for merging.

@ggouaillardet
Copy link
Contributor Author

@bosilca let's merge this PR for now and think about a better fix.
Can you please approve (and merge) it?

@bosilca bosilca merged commit bc9659e into open-mpi:master Nov 28, 2021
@dalcinl
Copy link
Contributor

dalcinl commented Nov 29, 2021

Will you merge this fix to branches v5.0.x and v4.1.x?

@awlauria
Copy link
Contributor

awlauria commented Dec 3, 2021

v5.0.x: #9723

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants