Skip to content

wipe the generalized request upon demand#13654

Open
bosilca wants to merge 1 commit intoopen-mpi:mainfrom
bosilca:topic/fix_grequest_free
Open

wipe the generalized request upon demand#13654
bosilca wants to merge 1 commit intoopen-mpi:mainfrom
bosilca:topic/fix_grequest_free

Conversation

@bosilca
Copy link
Member

@bosilca bosilca commented Jan 14, 2026

If the user calls MPI_Request_free on a generalized request, make sure the request, both user side and MPI side, is properly released. However, make sure the generalized request free_fn callback function will be called either in the MPI call MPI_REQUEST_FREE(request), or in the MPI call MPI_GREQUEST_COMPLETE(request), whichever happens last.

This is a sane replacement for #12392
Fixes #11681.

If the user calls MPI_Request_free on a generalized request, make sure
the request, both user side and MPI side, is properly released. However,
make sure the generalized request free_fn callback function will be
called either in the MPI call MPI_REQUEST_FREE(request), or in the
MPI call MPI_GREQUEST_COMPLETE(request), whichever happens last.

Signed-off-by: George Bosilca <gbosilca@nvidia.com>
@dalcinl
Copy link
Contributor

dalcinl commented Jan 15, 2026

I' may be doing something wrong, but this PR does not fix at all the error swallowing I reported in #11681. I tried again the very first reproducer in the issue description, and the behavior remains: the error returned from the free callback is not propagated out of the MPI_Wait call.

Please note that the related mpi4py tests are currently skipped in mpi4py@master.
The following mpi4py branch contains enhanced tests that should not skip with ompi@main
https://github.com/mpi4py/mpi4py/tree/testing/openmpi-greq
You just run python test/test_grequest.py. BTW, all these test pass with a recent MPICH.

PS: Rather than closing my PR, it should have been used as a starting point for further simplification, if that is ever possible.

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.

Error propagation in free_fn callback for generalized requests

2 participants