Commit d71154aa authored by Wesley Bland's avatar Wesley Bland
Browse files

Add MPID_Request_is_pending_failure



This function will check to see if a request can be completed if it
involves MPI_ANY_SOURCE. An any source request cannot be completed if
the communicator is not collectively active.
Signed-off-by: default avatarHuiwei Lu <huiweilu@mcs.anl.gov>
parent 42ebe240
...@@ -3621,6 +3621,23 @@ void MPID_Request_set_completed(MPID_Request *); ...@@ -3621,6 +3621,23 @@ void MPID_Request_set_completed(MPID_Request *);
@*/ @*/
void MPID_Request_release(MPID_Request *); void MPID_Request_release(MPID_Request *);
/*@
MPID_Request_is_pending_failure - Check if a request is pending because of a process failures
Input Parameter:
request - request to check
Return value:
0 - The request is not pending because of a failure
Non-zero - The request is pending because of a failure
Notes:
This routine checks to see if the communicator used in the request can
participate in MPI_ANY_SOURCE operations and if this request is already
pending due to a process failure.
@*/
int MPID_Request_is_pending_failure(MPID_Request *);
typedef struct MPID_Grequest_class { typedef struct MPID_Grequest_class {
MPIU_OBJECT_HEADER; /* adds handle and ref_count fields */ MPIU_OBJECT_HEADER; /* adds handle and ref_count fields */
MPI_Grequest_query_function *query_fn; MPI_Grequest_query_function *query_fn;
......
...@@ -28,6 +28,9 @@ int MPID_Comm_failure_ack(MPID_Comm *comm_ptr) ...@@ -28,6 +28,9 @@ int MPID_Comm_failure_ack(MPID_Comm *comm_ptr)
* communciator. */ * communciator. */
comm_ptr->dev.last_ack_rank = MPIDI_last_known_failed; comm_ptr->dev.last_ack_rank = MPIDI_last_known_failed;
/* Mark the communicator as any source active */
comm_ptr->dev.anysource_enabled = 1;
fn_exit: fn_exit:
MPIDI_FUNC_EXIT(MPID_STATE_MPID_COMM_FAILURE_ACK); MPIDI_FUNC_EXIT(MPID_STATE_MPID_COMM_FAILURE_ACK);
return mpi_errno; return mpi_errno;
...@@ -144,3 +147,34 @@ int MPID_Comm_failed_bitarray(MPID_Comm *comm_ptr, uint32_t **bitarray, int acke ...@@ -144,3 +147,34 @@ int MPID_Comm_failed_bitarray(MPID_Comm *comm_ptr, uint32_t **bitarray, int acke
fn_fail: fn_fail:
goto fn_exit; goto fn_exit;
} }
#undef FUNCNAME
#define FUNCNAME MPID_Request_is_pending_failure
#undef FCNAME
#define FCNAME MPIU_QUOTE(FUNCNAME)
int MPID_Request_is_pending_failure(MPID_Request *request_ptr)
{
int ret = 0;
MPIDI_STATE_DECL(MPID_STATE_REQUEST_IS_PENDING_FAILURE);
MPIDI_FUNC_ENTER(MPID_STATE_REQUEST_IS_PENDING_FAILURE);
if (request_ptr->dev.match.parts.rank != MPI_ANY_SOURCE) {
goto fn_exit;
}
/* If the request is pending and the communicator has MPI_ANY_SOURCE
* enabled, then we can mark the request as not pending and let the
* request continue. */
if (MPIDI_CH3I_Comm_AS_enabled(request_ptr->comm)) {
request_ptr->status.MPI_ERROR = MPI_SUCCESS;
goto fn_exit;
}
/* Otherwise, the request shouldn't go into the progress engine. */
ret = 1;
fn_exit:
MPIU_DBG_MSG_S(CH3_OTHER, VERBOSE, "Request is%spending failure", ret ? " " : " not ");
MPIDI_FUNC_EXIT(MPID_STATE_REQUEST_IS_PENDING_FAILURE);
return ret;
}
...@@ -101,3 +101,9 @@ int MPID_Comm_revoke(MPID_Comm *comm_ptr, int is_remote) ...@@ -101,3 +101,9 @@ int MPID_Comm_revoke(MPID_Comm *comm_ptr, int is_remote)
MPID_abort(); MPID_abort();
return 0; return 0;
} }
int MPID_Request_is_pending_failure(MPID_Request *request_ptr)
{
MPID_abort();
return 0;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment