1
1

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.
Этот коммит содержится в:
Tim Woodall 2005-12-01 17:17:06 +00:00
родитель 53a33f3bed
Коммит 394bf196bd

Просмотреть файл

@ -127,7 +127,7 @@ void mca_pml_ob1_recv_frag_callback(
* set by the upper level routine. * 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 { \ do { \
/* local parameters */ \ /* local parameters */ \
opal_list_t* wild_receives = &comm->wild_receives; \ opal_list_t* wild_receives = &comm->wild_receives; \
@ -159,11 +159,6 @@ do { \
( (recv_tag == OMPI_ANY_TAG) && (0 <= frag_tag) ) ) \ ( (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. \ * 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 * This routine assumes that the appropriate matching locks are
* set by the upper level routine. * 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 { \ do { \
/* local variables */ \ /* local variables */ \
opal_list_t* specific_receives = &proc->specific_receives; \ opal_list_t* specific_receives = &proc->specific_receives; \
@ -219,11 +214,6 @@ do { \
recv_tag = specific_recv->req_recv.req_base.req_tag; \ recv_tag = specific_recv->req_recv.req_base.req_tag; \
if ( (frag_tag == recv_tag) || \ if ( (frag_tag == recv_tag) || \
( (recv_tag == OMPI_ANY_TAG) && (0 <= frag_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 \ * Match made \
@ -257,7 +247,7 @@ do { \
*/ */
#define MCA_PML_OB1_CHECK_SPECIFIC_AND_WILD_RECEIVES_FOR_MATCH( \ #define MCA_PML_OB1_CHECK_SPECIFIC_AND_WILD_RECEIVES_FOR_MATCH( \
hdr,comm,proc,match_probe,return_match) \ hdr,comm,proc,return_match) \
do { \ do { \
/* local variables */ \ /* local variables */ \
mca_pml_ob1_recv_request_t *specific_recv, *wild_recv; \ 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; \ wild_recv_tag = wild_recv->req_recv.req_base.req_tag; \
if ( (frag_tag == wild_recv_tag) || \ if ( (frag_tag == wild_recv_tag) || \
( (wild_recv_tag == OMPI_ANY_TAG) && (0 <= frag_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 \ * Match made \
*/ \ */ \
@ -320,7 +304,7 @@ do { \
if (wild_recv == (mca_pml_ob1_recv_request_t *) \ if (wild_recv == (mca_pml_ob1_recv_request_t *) \
opal_list_get_end(&comm->wild_receives) ) \ 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; \ break; \
} \ } \
\ \
@ -338,12 +322,6 @@ do { \
if ( (frag_tag == specific_recv_tag) || \ if ( (frag_tag == specific_recv_tag) || \
( (specific_recv_tag == OMPI_ANY_TAG) && (0<=frag_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 \ * Match made \
*/ \ */ \
@ -367,7 +345,7 @@ do { \
if (specific_recv == (mca_pml_ob1_recv_request_t *) \ if (specific_recv == (mca_pml_ob1_recv_request_t *) \
opal_list_get_end(&(proc)->specific_receives)) \ 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; \ break; \
} \ } \
/* \ /* \
@ -433,7 +411,6 @@ int mca_pml_ob1_recv_frag_match(
mca_pml_ob1_comm_t *comm; mca_pml_ob1_comm_t *comm;
mca_pml_ob1_comm_proc_t *proc; mca_pml_ob1_comm_proc_t *proc;
bool additional_match=false; bool additional_match=false;
bool match_probe = true;
opal_list_t additional_matches; opal_list_t additional_matches;
int rc; int rc;
@ -477,18 +454,18 @@ rematch:
/* /*
* There are only wild irecvs, so specialize the algorithm. * 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 ) { } else if (opal_list_get_size(&comm->wild_receives) == 0 ) {
/* /*
* There are only specific irecvs, so specialize the algorithm. * 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 { } else {
/* /*
* There are some of each. * 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 */ /* if match found, process data */
@ -502,9 +479,8 @@ rematch:
/* complete the probe */ /* complete the probe */
mca_pml_ob1_recv_request_matched_probe(match,btl,segments,num_segments); 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 = NULL;
match_probe = false;
goto rematch; goto rematch;
} }
} else { } else {
@ -589,7 +565,6 @@ static bool mca_pml_ob1_check_cantmatch_for_match(
uint16_t next_msg_seq_expected, frag_seq; uint16_t next_msg_seq_expected, frag_seq;
mca_pml_ob1_recv_frag_t *frag; mca_pml_ob1_recv_frag_t *frag;
bool match_made = false; bool match_made = false;
bool match_probe = true;
/* /*
* Loop over all the out of sequence messages. No ordering is assumed * 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_remove_item(&proc->frags_cant_match,
(opal_list_item_t *)frag); (opal_list_item_t *)frag);
rematch:
/* /*
* figure out what sort of matching logic to use, if need to * 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. * 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 ) { } else if (opal_list_get_size(&comm->wild_receives) == 0 ) {
/* /*
* There are only specific irecvs, so specialize the algorithm. * 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 { } else {
/* /*
* There are some of each. * 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 */ /* complete the probe */
mca_pml_ob1_recv_request_matched_probe(match,frag->btl,frag->segments,frag->num_segments); mca_pml_ob1_recv_request_matched_probe(match,frag->btl,frag->segments,frag->num_segments);
/* retry the match */ /* append fragment to unexpected list */
match = NULL; opal_list_append( &proc->unexpected_frags, (opal_list_item_t *)frag);
match_probe = false;
goto rematch;
} else { } else {