Commit 9a9ffb76 authored by Wesley Bland's avatar Wesley Bland
Browse files

Moves errflag in request from device to top level



The errflag in the request object is used in common code and should not
have been put in device specific code. This moves it up to the
MPI_Request object.
Signed-off-by: default avatarSameh Sharkawi <sssharka@us.ibm.com>
parent 4d676d9b
......@@ -1509,6 +1509,9 @@ typedef struct MPID_Request {
struct MPIR_Sendq *dbg_next;
/* Errflag for NBC requests. Not used by other requests. */
mpir_errflag_t errflag;
/* Other, device-specific information */
#ifdef MPID_DEV_REQUEST_DECL
MPID_DEV_REQUEST_DECL
......
......@@ -446,9 +446,6 @@ typedef struct MPIDI_Request {
struct MPIDI_RMA_Lock_entry *lock_queue_entry;
MPI_Request resp_request_handle; /* Handle for get_accumulate response */
/* Errflag for NBC requests. Not used by other requests. */
mpir_errflag_t errflag;
MPIDI_REQUEST_SEQNUM
/* Occasionally, when a message cannot be sent, we need to cache the
......
......@@ -73,6 +73,7 @@ MPID_Request * MPID_Request_create(void)
MPIR_STATUS_SET_CANCEL_BIT(req->status, FALSE);
req->comm = NULL;
req->greq_fns = NULL;
req->errflag = MPIR_ERR_NONE;
req->dev.datatype_ptr = NULL;
req->dev.segment_ptr = NULL;
/* Masks and flags for channel device state in an MPID_Request */
......@@ -94,7 +95,6 @@ MPID_Request * MPID_Request_create(void)
req->dev.user_buf = NULL;
req->dev.final_user_buf = NULL;
req->dev.drop_data = FALSE;
req->dev.errflag = MPIR_ERR_NONE;
#ifdef MPIDI_CH3_REQUEST_INIT
MPIDI_CH3_REQUEST_INIT(req);
#endif
......
......@@ -140,29 +140,29 @@ static int MPIDU_Sched_start_entry(struct MPIDU_Sched *s, size_t idx, struct MPI
* &send.count, but this requires patching up the pointers
* during realloc of entries, so this is easier */
ret_errno = MPIC_Isend(e->u.send.buf, *e->u.send.count_p, e->u.send.datatype,
e->u.send.dest, s->tag, comm, &e->u.send.sreq, &r->dev.errflag);
e->u.send.dest, s->tag, comm, &e->u.send.sreq, &r->errflag);
}
else {
if (e->u.send.is_sync) {
ret_errno = MPIC_Issend(e->u.send.buf, e->u.send.count, e->u.send.datatype,
e->u.send.dest, s->tag, comm, &e->u.send.sreq, &r->dev.errflag);
e->u.send.dest, s->tag, comm, &e->u.send.sreq, &r->errflag);
}
else {
ret_errno = MPIC_Isend(e->u.send.buf, e->u.send.count, e->u.send.datatype,
e->u.send.dest, s->tag, comm, &e->u.send.sreq, &r->dev.errflag);
e->u.send.dest, s->tag, comm, &e->u.send.sreq, &r->errflag);
}
}
/* Check if the error is actually fatal to the NBC or we can continue. */
if (unlikely(ret_errno)) {
if (MPIR_ERR_NONE == r->dev.errflag) {
if (MPIR_ERR_NONE == r->errflag) {
if (MPIX_ERR_PROC_FAILED == MPIR_ERR_GET_CLASS(ret_errno)) {
r->dev.errflag = MPIR_ERR_PROC_FAILED;
r->errflag = MPIR_ERR_PROC_FAILED;
} else {
r->dev.errflag = MPIR_ERR_OTHER;
r->errflag = MPIR_ERR_OTHER;
}
}
e->status = MPIDU_SCHED_ENTRY_STATUS_FAILED;
MPIU_DBG_MSG_D(COMM, VERBOSE, "Sched SEND failed. Errflag: %d\n", (int) r->dev.errflag);
MPIU_DBG_MSG_D(COMM, VERBOSE, "Sched SEND failed. Errflag: %d\n", (int) r->errflag);
} else {
e->status = MPIDU_SCHED_ENTRY_STATUS_STARTED;
}
......@@ -174,15 +174,15 @@ static int MPIDU_Sched_start_entry(struct MPIDU_Sched *s, size_t idx, struct MPI
e->u.recv.src, s->tag, comm, &e->u.recv.rreq);
/* Check if the error is actually fatal to the NBC or we can continue. */
if (unlikely(ret_errno)) {
if (MPIR_ERR_NONE == r->dev.errflag) {
if (MPIR_ERR_NONE == r->errflag) {
if (MPIX_ERR_PROC_FAILED == MPIR_ERR_GET_CLASS(ret_errno)) {
r->dev.errflag = MPIR_ERR_PROC_FAILED;
r->errflag = MPIR_ERR_PROC_FAILED;
} else {
r->dev.errflag = MPIR_ERR_OTHER;
r->errflag = MPIR_ERR_OTHER;
}
}
e->status = MPIDU_SCHED_ENTRY_STATUS_FAILED;
MPIU_DBG_MSG_D(COMM, VERBOSE, "Sched SEND failed. Errflag: %d\n", (int) r->dev.errflag);
MPIU_DBG_MSG_D(COMM, VERBOSE, "Sched SEND failed. Errflag: %d\n", (int) r->errflag);
} else {
e->status = MPIDU_SCHED_ENTRY_STATUS_STARTED;
}
......@@ -218,11 +218,11 @@ static int MPIDU_Sched_start_entry(struct MPIDU_Sched *s, size_t idx, struct MPI
if (e->u.cb.cb_type == MPIDU_SCHED_CB_TYPE_1) {
ret_errno = e->u.cb.u.cb_p(r->comm, s->tag, e->u.cb.cb_state);
if (unlikely(ret_errno)) {
if (MPIR_ERR_NONE == r->dev.errflag) {
if (MPIR_ERR_NONE == r->errflag) {
if (MPIX_ERR_PROC_FAILED == MPIR_ERR_GET_CLASS(ret_errno)) {
r->dev.errflag = MPIR_ERR_PROC_FAILED;
r->errflag = MPIR_ERR_PROC_FAILED;
} else {
r->dev.errflag = MPIR_ERR_OTHER;
r->errflag = MPIR_ERR_OTHER;
}
}
e->status = MPIDU_SCHED_ENTRY_STATUS_FAILED;
......@@ -233,11 +233,11 @@ static int MPIDU_Sched_start_entry(struct MPIDU_Sched *s, size_t idx, struct MPI
else if (e->u.cb.cb_type == MPIDU_SCHED_CB_TYPE_2) {
ret_errno = e->u.cb.u.cb2_p(r->comm, s->tag, e->u.cb.cb_state, e->u.cb.cb_state2);
if (unlikely(ret_errno)) {
if (MPIR_ERR_NONE == r->dev.errflag) {
if (MPIR_ERR_NONE == r->errflag) {
if (MPIX_ERR_PROC_FAILED == MPIR_ERR_GET_CLASS(ret_errno)) {
r->dev.errflag = MPIR_ERR_PROC_FAILED;
r->errflag = MPIR_ERR_PROC_FAILED;
} else {
r->dev.errflag = MPIR_ERR_OTHER;
r->errflag = MPIR_ERR_OTHER;
}
}
e->status = MPIDU_SCHED_ENTRY_STATUS_FAILED;
......@@ -841,7 +841,7 @@ static int MPIDU_Sched_progress_state(struct MPIDU_Sched_state *state, int *made
case MPIDU_SCHED_ENTRY_SEND:
if (e->u.send.sreq != NULL && MPID_Request_is_complete(e->u.send.sreq)) {
MPIU_DBG_MSG_FMT(COMM, VERBOSE, (MPIU_DBG_FDEST, "completed SEND entry %d, sreq=%p\n", (int) i, e->u.send.sreq));
if (s->req->dev.errflag != MPIR_ERR_NONE)
if (s->req->errflag != MPIR_ERR_NONE)
e->status = MPIDU_SCHED_ENTRY_STATUS_FAILED;
else
e->status = MPIDU_SCHED_ENTRY_STATUS_COMPLETE;
......@@ -854,9 +854,9 @@ static int MPIDU_Sched_progress_state(struct MPIDU_Sched_state *state, int *made
case MPIDU_SCHED_ENTRY_RECV:
if (e->u.recv.rreq != NULL && MPID_Request_is_complete(e->u.recv.rreq)) {
MPIU_DBG_MSG_FMT(COMM, VERBOSE, (MPIU_DBG_FDEST, "completed RECV entry %d, rreq=%p\n", (int) i, e->u.recv.rreq));
MPIR_Process_status(&e->u.recv.rreq->status, &s->req->dev.errflag);
MPIR_Process_status(&e->u.recv.rreq->status, &s->req->errflag);
MPIR_Request_extract_status(e->u.recv.rreq, e->u.recv.status);
if (s->req->dev.errflag != MPIR_ERR_NONE)
if (s->req->errflag != MPIR_ERR_NONE)
e->status = MPIDU_SCHED_ENTRY_STATUS_FAILED;
else
e->status = MPIDU_SCHED_ENTRY_STATUS_COMPLETE;
......@@ -894,7 +894,7 @@ static int MPIDU_Sched_progress_state(struct MPIDU_Sched_state *state, int *made
MPL_DL_DELETE(state->head, s);
/* TODO refactor into a sched_complete routine? */
switch (s->req->dev.errflag) {
switch (s->req->errflag) {
case MPIR_ERR_PROC_FAILED:
MPIU_ERR_SET(s->req->status.MPI_ERROR, MPIX_ERR_PROC_FAILED, "**comm");
break;
......
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