Skip to content

add support for request_get_status_any/all/some #13279

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

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

edgargabriel
Copy link
Member

Add support for the new MPI_Request_get_status_any/all/some functions introduced with MPI 4.1

This PR contains the C implementation for the functions as well as the man-pages.
There are however also some things missing:

  • in the C code generation python scripts, we need to introduce the ability to create const MPI_Request[], (I have currently removed the const from the function definitions in mpi.h.in in order to make the code compile).
  • Fortran interfaces

@edgargabriel edgargabriel force-pushed the topic/request-status-mult branch from d233c73 to 723b84e Compare May 26, 2025 20:46
@jsquyres jsquyres moved this to In Progress in MPI 4.1 compliance May 26, 2025
@jsquyres jsquyres marked this pull request as draft May 26, 2025 20:47
@hppritcha
Copy link
Member

Let me know if you want help with the python binding infrastructure.

@edgargabriel
Copy link
Member Author

Let me know if you want help with the python binding infrastructure.

@hppritcha yes, I would appreciate some help on that front (and the same applies for the fortran bindings, even if its just a conversation that I understand what needs to be done).

@jsquyres jsquyres added this to the v6.0.0 milestone May 27, 2025
@edgargabriel edgargabriel force-pushed the topic/request-status-mult branch 2 times, most recently from efd9cf5 to f21dff7 Compare May 27, 2025 13:32
@hppritcha
Copy link
Member

@edgargabriel added new data type to the bindings code to add this new use of const MPI_Request reqs[] in the standard.

@hppritcha
Copy link
Member

I'll work on the fortran but that will have to wait till later in the week.

@hppritcha
Copy link
Member

note that mpi4py is probably not testing this since it keys off our MPI_Get_version return values for major/minor.
@edgargabriel have you tested mpi4py with VERSION faked to return 4.1?

@edgargabriel
Copy link
Member Author

@hppritcha thank you very much, I will test it later this week. I have not done the mpi4py test that you mentioned, will look into this as well.

@edgargabriel edgargabriel force-pushed the topic/request-status-mult branch from a2aa8f9 to 81e3492 Compare June 11, 2025 21:30
@edgargabriel
Copy link
Member Author

note that mpi4py is probably not testing this since it keys off our MPI_Get_version return values for major/minor. @edgargabriel have you tested mpi4py with VERSION faked to return 4.1?

faking MPI 4.1. for mpi4py doesn't work unfortunately, we fail the compilation of mpi4py due to other missing function (MPI_Buffer_flush etc.). I will write some tests for the new functions.

@hppritcha
Copy link
Member

@edgargabriel i pushed the remainder of the fortran related files to the PR - hopefully.

@edgargabriel
Copy link
Member Author

@edgargabriel i pushed the remainder of the fortran related files to the PR - hopefully.

@hppritcha thank you! I hope to finish up adding tests to the ibm testsuite for the new function this weekend, and hopefully next week we could merge the PR if all tests pass.

@edgargabriel
Copy link
Member Author

edgargabriel commented Jun 21, 2025

I added some tests for request_get_status_any/all/some to the ompi-tests private testsuite, and they pass. This is however only testing the C-interfaces of the function. The tests are also probably not entirely bullet-proof in terms of that they might miss some corner cases, but the base function is shown to be working.

@edgargabriel edgargabriel marked this pull request as ready for review June 22, 2025 18:48
@edgargabriel edgargabriel force-pushed the topic/request-status-mult branch from 360c797 to 47fbc39 Compare July 17, 2025 14:54
edgargabriel and others added 3 commits July 28, 2025 17:38
add the man pages for the newly implemented MPI_Request_get_status_all/any/some functions.

Signed-off-by: Edgar Gabriel <[email protected]>
Three new functions were added to the MPI API as part of the 4.1 standard.
These used an array of const MPI_Request s which the bindings code
didn't support.

This commit also fixes back the mpi.h prototypes to include the constants
and required changes to the new template files.

Signed-off-by: Howard Pritchard <[email protected]>
hppritcha and others added 6 commits July 28, 2025 17:38
also switch MPI_Request_get_status to use new method for generating
f08 bindings.

Update fortran bindings interfaces generation code.

f90/f77 interfaces will be added as another commit.

Signed-off-by: Howard Pritchard <[email protected]>
for new fortran methods

starting with MPI_Request_get_status_(any/all/some) plus
switch MPI_Request_get_status to use the binding
infrastructure as well.

Signed-off-by: Howard Pritchard <[email protected]>
Signed-off-by: Howard Pritchard <[email protected]>
Incorporate the comments received during the review of the PR.

Signed-off-by: Edgar Gabriel <[email protected]>
@edgargabriel edgargabriel force-pushed the topic/request-status-mult branch from 2963f48 to f326157 Compare July 28, 2025 17:38
@hppritcha
Copy link
Member

did we add the tests for this to ompi-tests? i'm triaging compile failures for the tests in my mtt runs:


request_get_status_all.c:32:9: error: call to undeclared function 'MPI_Request_get_status_all'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]    32 \|         MPI_Request_get_status_all(1, req, &flag, statuses);       \|         ^ request_get_status_all.c:32:9: note: did you mean 'MPI_Request_get_status'? /home/howardp/mtt/master_scratch/MiddlewareBuild_OMPIMaster/include/mpi.h:2234:20: note: 'MPI_Request_get_status' declared here  2234 \| OMPI_DECLSPEC  int MPI_Request_get_status(MPI_Request request, int *flag,       \|                    ^ 1 error generated. make[1]: Leaving directory '/home/howardp/mtt/master_scratch/TestGet_IBM/ompi-tests/ibm/pt2pt' make[1]: *** [Makefile:1582: request_get_status_all.o] Error 1 make: *** [Makefile:430: all-recursive] Error 1
--
Environment |  

@edgargabriel
Copy link
Member Author

did we add the tests for this to ompi-tests? i'm triaging compile failures for the tests in my mtt runs:


request_get_status_all.c:32:9: error: call to undeclared function 'MPI_Request_get_status_all'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]    32 \|         MPI_Request_get_status_all(1, req, &flag, statuses);       \|         ^ request_get_status_all.c:32:9: note: did you mean 'MPI_Request_get_status'? /home/howardp/mtt/master_scratch/MiddlewareBuild_OMPIMaster/include/mpi.h:2234:20: note: 'MPI_Request_get_status' declared here  2234 \| OMPI_DECLSPEC  int MPI_Request_get_status(MPI_Request request, int *flag,       \|                    ^ 1 error generated. make[1]: Leaving directory '/home/howardp/mtt/master_scratch/TestGet_IBM/ompi-tests/ibm/pt2pt' make[1]: *** [Makefile:1582: request_get_status_all.o] Error 1 make: *** [Makefile:430: all-recursive] Error 1
--
Environment |  

@hppritcha I added these tests to the ibm testsuite https://github.com/open-mpi/ompi-tests/pull/189

@edgargabriel
Copy link
Member Author

It was probably too early to merge it, should have waited until we merge the actual code. Sorry, I didn't think it through :-(

@hppritcha
Copy link
Member

related to #13279

hppritcha added a commit to hppritcha/ompi that referenced this pull request Aug 14, 2025
We only support named types with this first pass.

related to open-mpi#12076

Fortran interfaces will be added once Fortran infrastructure
additions in PR open-mpi#13279 are merged in to main.

Signed-off-by: Howard Pritchard <[email protected]>
Signed-off-by: Howard Pritchard <[email protected]>
jsquyres
jsquyres previously approved these changes Aug 15, 2025
Copy link
Member

@jsquyres jsquyres left a comment

Choose a reason for hiding this comment

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

Great! Can we squash these down (don't have to squash to 1 commit -- just get rid of the "fixup" commits)? Then let's merge.

Copy link
Member

@bosilca bosilca left a comment

Choose a reason for hiding this comment

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

I think there are some major issues with this PR. Please check my comments.

@@ -2227,6 +2227,15 @@ OMPI_DECLSPEC MPI_Request MPI_Request_f2c(MPI_Fint request);
OMPI_DECLSPEC int MPI_Request_free(MPI_Request *request);
OMPI_DECLSPEC int MPI_Request_get_status(MPI_Request request, int *flag,
MPI_Status *status);
/* should be 'const MPI_Request array_of_requests[]' */
Copy link
Member

Choose a reason for hiding this comment

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

ok ? It actually is marked as const !

#include "ompi/request/grequest.h"
#include "ompi/memchecker.h"

/* Non blocking test for the request status. Upon completion, the request will
Copy link
Member

Choose a reason for hiding this comment

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

This is not technically a test but a non blocking status retrieval.

** MPI functions invoking this functionality does not have the const
** argument
*/
if(!ompi_request_check_same_instance((MPI_Request *)requests, count) ) {
Copy link
Member

Choose a reason for hiding this comment

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

Changing ompi_request_check_same_instance to use const make sense as part of this PR because it is the first time it is useful to have const in the API instead of casting everywhere.

(requests[i]->req_complete) ) {
continue;
}
all_done = false;
Copy link
Member

Choose a reason for hiding this comment

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

there are plenty if incorrect indentations (mix between tab and spaces). Please fix before merge.

OMPI_COPY_STATUS(&statuses[i], ompi_status_empty, false);
}
}
if (requests[i]->req_complete ) {
Copy link
Member

Choose a reason for hiding this comment

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

Why is this test necessary ? The requirement to get to this code is that all requests are completed, which means that if they are not NULL or inactive they must be completed.

}

if (all_inactive) {
*flag = true;
Copy link
Member

Choose a reason for hiding this comment

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

indentation.

Signed-off-by: Howard Pritchard <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

4 participants