From e9ca560f1620c50985fb3163870c39d0a162d4a1 Mon Sep 17 00:00:00 2001 From: Tim Woodall Date: Mon, 8 Aug 2005 21:07:12 +0000 Subject: [PATCH] corrections for probe/iprobe This commit was SVN r6770. --- ompi/mca/pml/ob1/pml_ob1_recvfrag.c | 23 ++++++++++++++++++++--- ompi/mca/pml/ob1/pml_ob1_recvreq.c | 24 ++++++++++++++++++++++-- 2 files changed, 42 insertions(+), 5 deletions(-) diff --git a/ompi/mca/pml/ob1/pml_ob1_recvfrag.c b/ompi/mca/pml/ob1/pml_ob1_recvfrag.c index 46da729609..716d378e1f 100644 --- a/ompi/mca/pml/ob1/pml_ob1_recvfrag.c +++ b/ompi/mca/pml/ob1/pml_ob1_recvfrag.c @@ -421,6 +421,7 @@ int mca_pml_ob1_recv_frag_match( mca_pml_ob1_comm_t *comm; mca_pml_ob1_comm_proc_t *proc; bool additional_match=false; + bool is_probe = false; opal_list_t additional_matches; int rc; @@ -479,12 +480,14 @@ int mca_pml_ob1_recv_frag_match( /* if match found, process data */ if (match) { - /* * update delivered sequence number information, if needed. */ - if( (match->req_recv.req_base.req_type == MCA_PML_REQUEST_PROBE) ) { + if( (match->req_recv.req_base.req_type == MCA_PML_REQUEST_PROBE) || + match->req_recv.req_base.req_type == MCA_PML_REQUEST_IPROBE) { + /* Match a probe, rollback the next expected sequence number */ + is_probe = true; (proc->expected_sequence)--; } } else { @@ -531,7 +534,21 @@ int mca_pml_ob1_recv_frag_match( /* release matching lock before processing fragment */ if(match != NULL) { MCA_PML_OB1_RECV_REQUEST_MATCHED(match, hdr); - mca_pml_ob1_recv_request_progress(match,btl,segments,num_segments); + if (is_probe == false) { + mca_pml_ob1_recv_request_progress(match,btl,segments,num_segments); + } else { + /* mark probe as complete */ + OPAL_THREAD_LOCK(&ompi_request_lock); + match->req_recv.req_base.req_ompi.req_status._count = match->req_recv.req_bytes_packed; + match->req_recv.req_base.req_pml_complete = true; + match->req_recv.req_base.req_ompi.req_complete = true; + if(ompi_request_waiting) { + opal_condition_broadcast(&ompi_request_cond); + } + OPAL_THREAD_UNLOCK(&ompi_request_lock); + /* retry the match */ + mca_pml_ob1_recv_frag_match(btl,hdr,segments,num_segments); + } } if(additional_match) { opal_list_item_t* item; diff --git a/ompi/mca/pml/ob1/pml_ob1_recvreq.c b/ompi/mca/pml/ob1/pml_ob1_recvreq.c index f747f3658a..8a997e2ff8 100644 --- a/ompi/mca/pml/ob1/pml_ob1_recvreq.c +++ b/ompi/mca/pml/ob1/pml_ob1_recvreq.c @@ -507,10 +507,20 @@ void mca_pml_ob1_recv_request_match_specific(mca_pml_ob1_recv_request_t* request (frag = mca_pml_ob1_recv_request_match_specific_proc(request, proc)) != NULL) { OPAL_THREAD_UNLOCK(&comm->matching_lock); - mca_pml_ob1_recv_request_progress(request,frag->btl,frag->segments,frag->num_segments); if( !((MCA_PML_REQUEST_IPROBE == request->req_recv.req_base.req_type) || (MCA_PML_REQUEST_PROBE == request->req_recv.req_base.req_type)) ) { + mca_pml_ob1_recv_request_progress(request,frag->btl,frag->segments,frag->num_segments); MCA_PML_OB1_RECV_FRAG_RETURN(frag); + } else { + /* mark probe as complete */ + OPAL_THREAD_LOCK(&ompi_request_lock); + request->req_recv.req_base.req_ompi.req_status._count = frag->hdr.hdr_match.hdr_msg_length; + request->req_recv.req_base.req_pml_complete = true; + request->req_recv.req_base.req_ompi.req_complete = true; + if(ompi_request_waiting) { + opal_condition_broadcast(&ompi_request_cond); + } + OPAL_THREAD_UNLOCK(&ompi_request_lock); } return; /* match found */ } @@ -561,10 +571,20 @@ void mca_pml_ob1_recv_request_match_wild(mca_pml_ob1_recv_request_t* request) if ((frag = mca_pml_ob1_recv_request_match_specific_proc(request, proc)) != NULL) { OPAL_THREAD_UNLOCK(&comm->matching_lock); - mca_pml_ob1_recv_request_progress(request,frag->btl,frag->segments,frag->num_segments); if( !((MCA_PML_REQUEST_IPROBE == request->req_recv.req_base.req_type) || (MCA_PML_REQUEST_PROBE == request->req_recv.req_base.req_type)) ) { + mca_pml_ob1_recv_request_progress(request,frag->btl,frag->segments,frag->num_segments); MCA_PML_OB1_RECV_FRAG_RETURN(frag); + } else { + /* mark probe as complete */ + OPAL_THREAD_LOCK(&ompi_request_lock); + request->req_recv.req_base.req_ompi.req_status._count = frag->hdr.hdr_match.hdr_msg_length; + request->req_recv.req_base.req_pml_complete = true; + request->req_recv.req_base.req_ompi.req_complete = true; + if(ompi_request_waiting) { + opal_condition_broadcast(&ompi_request_cond); + } + OPAL_THREAD_UNLOCK(&ompi_request_lock); } return; /* match found */ }