-
Notifications
You must be signed in to change notification settings - Fork 908
coll/base: do not drop const qualifier #8207
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
coll/base: do not drop const qualifier #8207
Conversation
Refs #8023 |
I wonder if this is necessary. Section 5.12 of the 3.1 standard says:
That means I am not allowed to free any of the |
The IBM CI (GNU/Scale) build failed! Please review the log, linked below. Gist: https://gist.github.com/a5c4721b6bd9b002524e1dccd0e32d7e |
The IBM CI (XL) build failed! Please review the log, linked below. Gist: https://gist.github.com/5817c5136e27c85dd74b4ec9e215f303 |
The IBM CI (PGI) build failed! Please review the log, linked below. Gist: https://gist.github.com/91511d778be878707a27ac11f1fbbf6b |
Thanks for the pointer! so in the case of |
MPI_Ialltoallw() and friends take a const MPI_Datatype types[] argument. In order to be able to call OBJ_RELEASE(types[0]), we used to simply drop the const modifier. This change make it right by introducing the OBJ_RELEASE_NO_NULLIFY(object) macro that no more set object = NULL if the object is freed. Signed-off-by: Gilles Gouaillardet <[email protected]>
5b01618
to
c49e5e5
Compare
My reading of the standard is that between calling |
Well, in that case do not need to retain anything at all in the case of |
FWIW, I remember we had to retain datatype(s) because some test cases from other test suite did not pass. |
My interpretation is that this only applies to buffers, not single datatypes. So it does apply to the |
Likely to be replaced with #8208 if the interpretation of the standard is confirmed. |
I think the meaning of the paragraph in the MPI standard is to simply allow the implementation to use the user pointer to track the different objects, instead of being required to allocate their own storage. However, this does not mean the user is not allowed to free some the datatypes. This can be done for as long as the arrays passed as arguments are not modified. In this regard the advice to implementors in 5.1.9 in MPI 4.0 is quite clear:
Thus, I think we need to change the refcount of the datatypes (and all other MPI objects), but we should not change the array, which means the use of the newly added macro OBJ_RELEASE_NO_NULLIFY is the correct path forward (based on my understanding of the MPI standard). |
I agree with @bosilca. Let's merge. |
MPI_Ialltoallw() and friends take a const MPI_Datatype types[] argument.
In order to be able to call OBJ_RELEASE(types[0]), we used to simply
drop the const modifier. This change make it right by introducing the
OBJ_RELEASE_NO_NULLIFY(object) macro that no more set object = NULL
if the object is freed.
Signed-off-by: Gilles Gouaillardet [email protected]