Commit 2f97f429 authored by Kenneth Raffenetti's avatar Kenneth Raffenetti
Browse files

portals4: revert [722d85a4] and [d459c025]

The 2 commits being reverted introduced a "safe" PtlMEAppend function
that would call MPID_nem_ptl_poll to process some events in case there
was no space to append the match list entry. However the poll function
is not reentrant safe, which could lead to ordering problems.

The increased list entry limit from [c6c0d6f6

] should prevent PTL_NO_SPACE
errors from happening, except in the extreme case. If we still find we are
hitting this error, a proper fix can be done in the Rportals layer.
Signed-off-by: default avatarAntonio J. Pena <apenya@mcs.anl.gov>
parent 79e23981
......@@ -208,26 +208,6 @@ int MPID_nem_ptl_lmt_handle_cookie(MPIDI_VC_t *vc, MPID_Request *req, MPID_IOV s
int MPID_nem_ptl_lmt_done_send(MPIDI_VC_t *vc, MPID_Request *req);
int MPID_nem_ptl_lmt_done_recv(MPIDI_VC_t *vc, MPID_Request *req);
/* a safe PtlMEAppend for when there is no space available */
static inline int MPID_nem_ptl_me_append(ptl_handle_ni_t ni_handle,
ptl_pt_index_t pt_index,
const ptl_me_t *me,
ptl_list_t ptl_list,
void *user_ptr,
ptl_handle_me_t *me_handle)
{
int ret;
while (1) {
ret = PtlMEAppend(ni_handle, pt_index, me, ptl_list, user_ptr, me_handle);
if (ret != PTL_NO_SPACE)
break;
MPID_nem_ptl_poll(1);
}
return ret;
}
/* packet handlers */
int MPID_nem_ptl_pkt_cancel_send_req_handler(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
......
......@@ -51,8 +51,8 @@ int MPID_nem_ptl_nm_init(void)
for (i = 0; i < NUM_RECV_BUFS; ++i) {
overflow_me.start = recvbufs + (i * BUFSIZE);
ret = MPID_nem_ptl_me_append(MPIDI_nem_ptl_ni, MPIDI_nem_ptl_control_pt, &overflow_me,
PTL_OVERFLOW_LIST, (void *)(size_t)i, &me_handles[i]);
ret = PtlMEAppend(MPIDI_nem_ptl_ni, MPIDI_nem_ptl_control_pt, &overflow_me,
PTL_OVERFLOW_LIST, (void *)(size_t)i, &me_handles[i]);
MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlmeappend", "**ptlmeappend %s",
MPID_nem_ptl_strerror(ret));
}
......@@ -122,8 +122,8 @@ static inline int meappend_large(ptl_process_t id, MPID_Request *req, ptl_match_
++REQ_PTL(req)->num_gets;
ret = MPID_nem_ptl_me_append(MPIDI_nem_ptl_ni, MPIDI_nem_ptl_control_pt, &me, PTL_PRIORITY_LIST, req,
&foo_me_handle);
ret = PtlMEAppend(MPIDI_nem_ptl_ni, MPIDI_nem_ptl_control_pt, &me, PTL_PRIORITY_LIST, req,
&foo_me_handle);
MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlmeappend", "**ptlmeappend %s",
MPID_nem_ptl_strerror(ret));
MPIU_DBG_MSG_FMT(CH3_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "PtlMEAppend(req=%p tag=%#lx)", req, NPTL_MATCH_GET_TAG(match_bits)));
......@@ -494,8 +494,8 @@ int MPID_nem_ptl_nm_ctl_event_handler(const ptl_event_t *e)
overflow_me.start = recvbufs + (buf_idx * BUFSIZE);
ret = MPID_nem_ptl_me_append(MPIDI_nem_ptl_ni, MPIDI_nem_ptl_control_pt, &overflow_me,
PTL_OVERFLOW_LIST, e->user_ptr, &me_handles[buf_idx]);
ret = PtlMEAppend(MPIDI_nem_ptl_ni, MPIDI_nem_ptl_control_pt, &overflow_me,
PTL_OVERFLOW_LIST, e->user_ptr, &me_handles[buf_idx]);
MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlmeappend", "**ptlmeappend %s",
MPID_nem_ptl_strerror(ret));
}
......
......@@ -106,8 +106,8 @@ static int append_overflow(int i)
me.min_free = PTL_MAX_EAGER;
/* if there is no space to append the entry, process outstanding events and try again */
ret = MPID_nem_ptl_me_append(MPIDI_nem_ptl_ni, MPIDI_nem_ptl_pt, &me, PTL_OVERFLOW_LIST, (void *)(size_t)i,
&overflow_me_handle[i]);
ret = PtlMEAppend(MPIDI_nem_ptl_ni, MPIDI_nem_ptl_pt, &me, PTL_OVERFLOW_LIST, (void *)(size_t)i,
&overflow_me_handle[i]);
MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlmeappend", "**ptlmeappend %s", MPID_nem_ptl_strerror(ret));
fn_exit:
......
......@@ -543,7 +543,7 @@ int MPID_nem_ptl_recv_posted(MPIDI_VC_t *vc, MPID_Request *rreq)
}
ret = MPID_nem_ptl_me_append(MPIDI_nem_ptl_ni, MPIDI_nem_ptl_pt, &me, PTL_PRIORITY_LIST, rreq, &REQ_PTL(rreq)->put_me);
ret = PtlMEAppend(MPIDI_nem_ptl_ni, MPIDI_nem_ptl_pt, &me, PTL_PRIORITY_LIST, rreq, &REQ_PTL(rreq)->put_me);
MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlmeappend", "**ptlmeappend %s", MPID_nem_ptl_strerror(ret));
DBG_MSG_MEAPPEND("REG", vc ? vc->pg_rank : MPI_ANY_SOURCE, me, rreq);
MPIU_DBG_MSG_P(CH3_CHANNEL, VERBOSE, " buf=%p", me.start);
......
......@@ -41,8 +41,8 @@ static void big_meappend(void *buf, ptl_size_t left_to_send, MPIDI_VC_t *vc, ptl
else
me.length = left_to_send;
ret = MPID_nem_ptl_me_append(MPIDI_nem_ptl_ni, MPIDI_nem_ptl_get_pt, &me, PTL_PRIORITY_LIST, sreq,
&REQ_PTL(sreq)->get_me_p[i]);
ret = PtlMEAppend(MPIDI_nem_ptl_ni, MPIDI_nem_ptl_get_pt, &me, PTL_PRIORITY_LIST, sreq,
&REQ_PTL(sreq)->get_me_p[i]);
DBG_MSG_MEAPPEND("CTL", vc->pg_rank, me, sreq);
MPIU_Assert(ret == 0);
/* increment the cc for each get operation */
......@@ -276,8 +276,8 @@ static int send_msg(ptl_hdr_data_t ssend_flag, struct MPIDI_VC *vc, const void *
MPIU_CHKPMEM_MALLOC(REQ_PTL(sreq)->get_me_p, ptl_handle_me_t *, sizeof(ptl_handle_me_t), mpi_errno, "get_me_p");
ret = MPID_nem_ptl_me_append(MPIDI_nem_ptl_ni, MPIDI_nem_ptl_get_pt, &me, PTL_PRIORITY_LIST, sreq,
&REQ_PTL(sreq)->get_me_p[0]);
ret = PtlMEAppend(MPIDI_nem_ptl_ni, MPIDI_nem_ptl_get_pt, &me, PTL_PRIORITY_LIST, sreq,
&REQ_PTL(sreq)->get_me_p[0]);
MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlmeappend", "**ptlmeappend %s", MPID_nem_ptl_strerror(ret));
DBG_MSG_MEAPPEND("CTL", vc->pg_rank, me, sreq);
/* increment the cc for the get operation */
......
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