From 394bf196bd28d274767d73902b7dddec5621471f Mon Sep 17 00:00:00 2001 From: Tim Woodall Date: Thu, 1 Dec 2005 17:17:06 +0000 Subject: [PATCH] back out changes to match only one probe - consensus was we should allow this if multiple threads post multiple probes This commit was SVN r8353. --- ompi/mca/pml/ob1/pml_ob1_recvfrag.c | 56 ++++++++--------------------- 1 file changed, 14 insertions(+), 42 deletions(-) diff --git a/ompi/mca/pml/ob1/pml_ob1_recvfrag.c b/ompi/mca/pml/ob1/pml_ob1_recvfrag.c index 2b706127ee..3bc3409ea4 100644 --- a/ompi/mca/pml/ob1/pml_ob1_recvfrag.c +++ b/ompi/mca/pml/ob1/pml_ob1_recvfrag.c @@ -127,7 +127,7 @@ void mca_pml_ob1_recv_frag_callback( * set by the upper level routine. */ -#define MCA_PML_OB1_CHECK_WILD_RECEIVES_FOR_MATCH(hdr,comm,proc,match_probe,return_match) \ +#define MCA_PML_OB1_CHECK_WILD_RECEIVES_FOR_MATCH(hdr,comm,proc,return_match) \ do { \ /* local parameters */ \ opal_list_t* wild_receives = &comm->wild_receives; \ @@ -159,11 +159,6 @@ do { \ ( (recv_tag == OMPI_ANY_TAG) && (0 <= frag_tag) ) ) \ \ { \ - if (match_probe == false && wild_recv->req_recv.req_base.req_type == MCA_PML_REQUEST_PROBE) { \ - /* already matched a probe - cannot match another with same fragment */ \ - break; \ - } \ - \ /* \ * Mark that this is the matching irecv, and go to process it. \ */ \ @@ -194,7 +189,7 @@ do { \ * This routine assumes that the appropriate matching locks are * set by the upper level routine. */ -#define MCA_PML_OB1_CHECK_SPECIFIC_RECEIVES_FOR_MATCH(hdr,comm,proc,match_probe,return_match) \ +#define MCA_PML_OB1_CHECK_SPECIFIC_RECEIVES_FOR_MATCH(hdr,comm,proc,return_match) \ do { \ /* local variables */ \ opal_list_t* specific_receives = &proc->specific_receives; \ @@ -219,11 +214,6 @@ do { \ recv_tag = specific_recv->req_recv.req_base.req_tag; \ if ( (frag_tag == recv_tag) || \ ( (recv_tag == OMPI_ANY_TAG) && (0 <= frag_tag) ) ) { \ - \ - if (match_probe == false && specific_recv->req_recv.req_base.req_type == MCA_PML_REQUEST_PROBE) { \ - /* already matched a probe - cannot match another with same fragment */ \ - break; \ - } \ \ /* \ * Match made \ @@ -257,7 +247,7 @@ do { \ */ #define MCA_PML_OB1_CHECK_SPECIFIC_AND_WILD_RECEIVES_FOR_MATCH( \ - hdr,comm,proc,match_probe,return_match) \ + hdr,comm,proc,return_match) \ do { \ /* local variables */ \ mca_pml_ob1_recv_request_t *specific_recv, *wild_recv; \ @@ -290,12 +280,6 @@ do { \ wild_recv_tag = wild_recv->req_recv.req_base.req_tag; \ if ( (frag_tag == wild_recv_tag) || \ ( (wild_recv_tag == OMPI_ANY_TAG) && (0 <= frag_tag) ) ) { \ - \ - if (match_probe == false && wild_recv->req_recv.req_base.req_type == MCA_PML_REQUEST_PROBE) { \ - /* already matched a probe - cannot match another with same fragment */ \ - break; \ - } \ - \ /* \ * Match made \ */ \ @@ -320,7 +304,7 @@ do { \ if (wild_recv == (mca_pml_ob1_recv_request_t *) \ opal_list_get_end(&comm->wild_receives) ) \ { \ - MCA_PML_OB1_CHECK_SPECIFIC_RECEIVES_FOR_MATCH(hdr, comm, proc, match_probe, return_match); \ + MCA_PML_OB1_CHECK_SPECIFIC_RECEIVES_FOR_MATCH(hdr, comm, proc, return_match); \ break; \ } \ \ @@ -338,12 +322,6 @@ do { \ if ( (frag_tag == specific_recv_tag) || \ ( (specific_recv_tag == OMPI_ANY_TAG) && (0<=frag_tag)) ) \ { \ - \ - if (match_probe == false && specific_recv->req_recv.req_base.req_type == MCA_PML_REQUEST_PROBE) { \ - /* already matched a probe - cannot match another with same fragment */ \ - break; \ - } \ - \ /* \ * Match made \ */ \ @@ -367,7 +345,7 @@ do { \ if (specific_recv == (mca_pml_ob1_recv_request_t *) \ opal_list_get_end(&(proc)->specific_receives)) \ { \ - MCA_PML_OB1_CHECK_WILD_RECEIVES_FOR_MATCH(hdr, comm, proc, match_probe, return_match); \ + MCA_PML_OB1_CHECK_WILD_RECEIVES_FOR_MATCH(hdr, comm, proc, return_match); \ break; \ } \ /* \ @@ -433,7 +411,6 @@ 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 match_probe = true; opal_list_t additional_matches; int rc; @@ -477,18 +454,18 @@ rematch: /* * There are only wild irecvs, so specialize the algorithm. */ - MCA_PML_OB1_CHECK_WILD_RECEIVES_FOR_MATCH(hdr, comm, proc, match_probe, match); + MCA_PML_OB1_CHECK_WILD_RECEIVES_FOR_MATCH(hdr, comm, proc, match); } else if (opal_list_get_size(&comm->wild_receives) == 0 ) { /* * There are only specific irecvs, so specialize the algorithm. */ - MCA_PML_OB1_CHECK_SPECIFIC_RECEIVES_FOR_MATCH(hdr, comm, proc, match_probe, match); + MCA_PML_OB1_CHECK_SPECIFIC_RECEIVES_FOR_MATCH(hdr, comm, proc, match); } else { /* * There are some of each. */ - MCA_PML_OB1_CHECK_SPECIFIC_AND_WILD_RECEIVES_FOR_MATCH(hdr, comm, proc, match_probe, match); + MCA_PML_OB1_CHECK_SPECIFIC_AND_WILD_RECEIVES_FOR_MATCH(hdr, comm, proc, match); } /* if match found, process data */ @@ -502,9 +479,8 @@ rematch: /* complete the probe */ mca_pml_ob1_recv_request_matched_probe(match,btl,segments,num_segments); - /* attempt to match against posted receive */ + /* attempt to match actual request */ match = NULL; - match_probe = false; goto rematch; } } else { @@ -589,7 +565,6 @@ static bool mca_pml_ob1_check_cantmatch_for_match( uint16_t next_msg_seq_expected, frag_seq; mca_pml_ob1_recv_frag_t *frag; bool match_made = false; - bool match_probe = true; /* * Loop over all the out of sequence messages. No ordering is assumed @@ -634,7 +609,6 @@ static bool mca_pml_ob1_check_cantmatch_for_match( */ opal_list_remove_item(&proc->frags_cant_match, (opal_list_item_t *)frag); -rematch: /* * figure out what sort of matching logic to use, if need to @@ -646,17 +620,17 @@ rematch: /* * There are only wild irecvs, so specialize the algorithm. */ - MCA_PML_OB1_CHECK_WILD_RECEIVES_FOR_MATCH(hdr, comm, proc, match_probe, match); + MCA_PML_OB1_CHECK_WILD_RECEIVES_FOR_MATCH(hdr, comm, proc, match); } else if (opal_list_get_size(&comm->wild_receives) == 0 ) { /* * There are only specific irecvs, so specialize the algorithm. */ - MCA_PML_OB1_CHECK_SPECIFIC_RECEIVES_FOR_MATCH(hdr, comm, proc, match_probe, match); + MCA_PML_OB1_CHECK_SPECIFIC_RECEIVES_FOR_MATCH(hdr, comm, proc, match); } else { /* * There are some of each. */ - MCA_PML_OB1_CHECK_SPECIFIC_AND_WILD_RECEIVES_FOR_MATCH(hdr, comm, proc, match_probe, match); + MCA_PML_OB1_CHECK_SPECIFIC_AND_WILD_RECEIVES_FOR_MATCH(hdr, comm, proc, match); } @@ -671,10 +645,8 @@ rematch: /* complete the probe */ mca_pml_ob1_recv_request_matched_probe(match,frag->btl,frag->segments,frag->num_segments); - /* retry the match */ - match = NULL; - match_probe = false; - goto rematch; + /* append fragment to unexpected list */ + opal_list_append( &proc->unexpected_frags, (opal_list_item_t *)frag); } else {