Skip to content

Conversation

kawashima-fj
Copy link
Member

@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 by MPI_START or
MPI_STARTALL is inactive therefore MPI_WAIT or its friends
must return immediately if such a request is passed.

The current implementation hangs in MPI_WAIT and its friends
in such case because a persistent request is initialized as
req_complete = REQUEST_PENDING. This commit fixes the
initialization.

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

According to the MPI-3.1 p.52 and p.53 (cited below), a request
created by `MPI_*_INIT` but not yet started by `MPI_START` or
`MPI_STARTALL` is inactive therefore `MPI_WAIT` or its friends
must return immediately if such a request is passed.

The current implementation hangs in `MPI_WAIT` and its friends
in such case because a persistent request is initialized as
`req_complete = REQUEST_PENDING`. This commit fixes the
initialization.

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>
@kawashima-fj kawashima-fj added this to the v2.0.2 milestone Dec 8, 2016
@kawashima-fj kawashima-fj self-assigned this Dec 8, 2016
@kawashima-fj kawashima-fj requested a review from bosilca December 8, 2016 12:52
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.

Nice catch ! I wonder how this never really showed up on our tests.

@jjhursey
Copy link
Member

jjhursey commented Dec 8, 2016

bot:ibm:retest

@kawashima-fj kawashima-fj merged commit ae056d9 into open-mpi:master Dec 8, 2016
@kawashima-fj kawashima-fj deleted the pr/inactive-persistent-request branch December 8, 2016 23:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants