Commit 9443bde4 authored by Igor Ivanov's avatar Igor Ivanov Committed by Pavan Balaji
Browse files

mpid: Add cancel_recv and cancel_send netmod calls



- Added cancel_recv and cancel_send netmod calls under ENABLE_COMM_OVERRIDES
- Extended MPIDI_CH3I_comm structure with netmode_comm field (this field can
store netmod context information related communicator as an example: mxm stores
mxm_mq_h value)

Change-Id: If89860d44840313bce6f7403190faec302c1bafc
Signed-off-by: default avatarIgor Ivanov <Igor.Ivanov@itseez.com>
parent 35d4cb8d
......@@ -176,6 +176,7 @@ typedef struct MPIDI_CH3I_comm
struct MPID_nem_barrier_vars *barrier_vars; /* shared memory variables used in barrier */
struct MPID_Comm *next; /* next pointer for list of communicators */
struct MPID_Comm *prev; /* prev pointer for list of communicators */
void *netmod_comm; /* netmod communicator context */
}
MPIDI_CH3I_comm_t;
......
......@@ -12,6 +12,8 @@
#define FCNAME MPIDI_QUOTE(FUNCNAME)
int MPID_Cancel_recv(MPID_Request * rreq)
{
int mpi_errno = MPI_SUCCESS;
MPIDI_STATE_DECL(MPID_STATE_MPID_CANCEL_RECV);
MPIDI_FUNC_ENTER(MPID_STATE_MPID_CANCEL_RECV);
......@@ -20,7 +22,23 @@ int MPID_Cancel_recv(MPID_Request * rreq)
if (MPIDI_CH3U_Recvq_DP(rreq))
{
MPIU_DBG_MSG_P(CH3_OTHER,VERBOSE,
/* code in cancel_recv */
/* FIXME: The vc is only needed to find which function to call*/
/* This is otherwise any_source ready */
#ifdef ENABLE_COMM_OVERRIDES
{
MPIDI_VC_t *vc;
MPIU_Assert(rreq->dev.match.parts.rank != MPI_ANY_SOURCE);
MPIDI_Comm_get_vc_set_active(rreq->comm, rreq->dev.match.parts.rank, &vc);
if (vc->comm_ops && vc->comm_ops->cancel_recv)
{
mpi_errno = vc->comm_ops->cancel_recv(NULL, rreq);
if (mpi_errno)
goto fn_exit;
}
}
#endif
MPIU_DBG_MSG_P(CH3_OTHER,VERBOSE,
"request 0x%08x cancelled", rreq->handle);
MPIR_STATUS_SET_CANCEL_BIT(rreq->status, TRUE);
MPIR_STATUS_SET_COUNT(rreq->status, 0);
......@@ -33,6 +51,8 @@ int MPID_Cancel_recv(MPID_Request * rreq)
"request 0x%08x already matched, unable to cancel", rreq->handle);
}
MPIDI_FUNC_EXIT(MPID_STATE_MPID_CANCEL_RECV);
return MPI_SUCCESS;
fn_fail:
fn_exit:
MPIDI_FUNC_EXIT(MPID_STATE_MPID_CANCEL_RECV);
return mpi_errno;
}
......@@ -140,6 +140,16 @@ int MPID_Cancel_send(MPID_Request * sreq)
else
{
cancelled = FALSE;
/* code in mpid_cancel_send */
#ifdef ENABLE_COMM_OVERRIDES
if (vc->comm_ops && vc->comm_ops->cancel_send)
{
mpi_errno = vc->comm_ops->cancel_send(vc, sreq);
if (mpi_errno)
goto fn_exit;
}
cancelled = MPIR_STATUS_GET_CANCEL_BIT(sreq->status);
#endif
if (cancelled)
{
MPIR_STATUS_SET_CANCEL_BIT(sreq->status, TRUE);
......
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