-
Notifications
You must be signed in to change notification settings - Fork 842
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
4.1.x ERROR field of MPI_Status uninitialized after MPI_Recv call #12049
Comments
This is intended behavior. Section 3.2.5 states:
I agree that this is not ideal since it leads to spurious warnings like this. Feel free to open an issue against the standard: https://github.com/mpi-forum/mpi-issues |
…us::ERROR According to MPI standard the ERROR field of MPI_Status might not be initialized unless for operations that return multiple statuses, see Section 3.7.5 of the standard. In older OpenMPI versions (<=4.0.x) we were lucky that ERROR was initialized to 0 always. This is not the case for 4.1.y at least. See open-mpi/ompi#12049. Therefore we use the retun code to determine whether there was an error. Note that the default error handler usually is to abort the application if errors occur. In that case the error code will always return success.
Thanks a lot. I had a hard time figuring out the issue. I only read the man page. From that this was not clear. |
Closing this as it is answered. |
Fair enough. Got any suggestions for text to add to the man page about this? (we'll likely need to include that same text on a bunch of receive-flavored man pages) |
I guess a comment would fit after this paragraph about status in the Notes section
maybe something along these lines:
|
…us::ERROR According to MPI standard the ERROR field of MPI_Status might not be initialized unless for operations that return multiple statuses, see Section 3.7.5 of the standard. In older OpenMPI versions (<=4.0.x) we were lucky that ERROR was initialized to 0 always. This is not the case for 4.1.y at least. See open-mpi/ompi#12049. Therefore we use the retun code to determine whether there was an error. Note that the default error handler usually is to abort the application if errors occur. In that case the error code will always return success.
@blattms Well this certainly caused me to go down a rabbit hole. 🐇 (hey, who knew that Github had a Rabbit emoji?) I took your suggestion and tweaked it, and noticed that we actually had related text about this issue in some other man pages. So I ended up stealing that text and using it. Check out #12058 (which rendered to a temporary RTD location here: https://ompi--12058.org.readthedocs.build/en/12058/) |
Thanks a lot for. That text is really perfect. 👍 |
Not that long ago we had a very similar discussion that ended up in us making the change. Check #9128 for more info. |
@blattms FYI: the docs updates have been merged on the |
Background information
What version of Open MPI are you using?
The issue is there in versions 4.1.6 (Debian sid) and 4.1.4 (Debian bookworm), but not on 4.1.0 (Debian oldstable/bullseye).
Describe how Open MPI was installed (e.g., from a source/distribution tarball, from a git clone, from an operating system distribution package, etc.)
openmpi is installed from packages either on Debian sid or Debian 12.2
Please describe the system on which you are running
Details of the problem
If I compile the following test file with debugging
using
and run under valgrind using:
Then valgrind shows that the ERROR field is not initialized during the
if(status.MPI_ERROR)
:Shouldn't MPI_Recv initialize the MPI_Status field completely? We have asserts like
assert(!status.MPI_ERROR);
that are failing because of this. The workaround is to always default initialize the status fieldIs this intended or are we doing something wrong?
The text was updated successfully, but these errors were encountered: