ompi/request: Fix a persistent request creation bug #2545
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@bosilca Could you review? It's a simple corner case bug.
I'll create PRs for v2.0.2 and v2.1.0.
According to the MPI-3.1 p.52 and p.53 (cited below), a request
created by
MPI_*_INIT
but not yet started byMPI_START
orMPI_STARTALL
is inactive thereforeMPI_WAIT
or its friendsmust return immediately if such a request is passed.
The current implementation hangs in
MPI_WAIT
and its friendsin such case because a persistent request is initialized as
req_complete = REQUEST_PENDING
. This commit fixes theinitialization.
Also, this commit fixes internal requests used in
MPI_PROBE
and
MPI_IPROBE
which was marked wrongly as persistent.MPI-3.1 p.52:
We shall use the following terminology: A null handle is a handle
with value MPI_REQUEST_NULL. A persistent request and the handle
to it are inactive if the request is not associated with any ongoing
communication (see Section 3.9). A handle is active if it is neither
null nor inactive. An empty status is a status which is set to return
tag = MPI_ANY_TAG, source = MPI_ANY_SOURCE, error = MPI_SUCCESS, and
is also internally configured so that calls to MPI_GET_COUNT,
MPI_GET_ELEMENTS, and MPI_GET_ELEMENTS_X return count = 0 and
MPI_TEST_CANCELLED returns false. We set a status variable to empty
when the value returned by it is not significant. Status is set in
this way so as to prevent errors due to accesses of stale information.
MPI-3.1 p.53:
One is allowed to call MPI_WAIT with a null or inactive request
argument. In this case the operation returns immediately with empty
status.
Signed-off-by: KAWASHIMA Takahiro t-kawashima@jp.fujitsu.com