@@ -163,18 +163,20 @@ void mca_pml_ob1_recv_frag_callback_match(mca_btl_base_module_t* btl,
163163 */
164164 OB1_MATCHING_LOCK (& comm -> matching_lock );
165165
166- /* get sequence number of next message that can be processed */
167- if (OPAL_UNLIKELY ((((uint16_t ) hdr -> hdr_seq ) != ((uint16_t ) proc -> expected_sequence )) ||
168- (opal_list_get_size (& proc -> frags_cant_match ) > 0 ))) {
169- goto slow_path ;
170- }
166+ if (!OMPI_COMM_CHECK_ASSERT_ALLOW_OVERTAKE (comm_ptr )) {
167+ /* get sequence number of next message that can be processed */
168+ if (OPAL_UNLIKELY ((((uint16_t ) hdr -> hdr_seq ) != ((uint16_t ) proc -> expected_sequence )) ||
169+ (opal_list_get_size (& proc -> frags_cant_match ) > 0 ))) {
170+ goto slow_path ;
171+ }
171172
172- /* This is the sequence number we were expecting, so we can try
173- * matching it to already posted receives.
174- */
173+ /* This is the sequence number we were expecting, so we can try
174+ * matching it to already posted receives.
175+ */
175176
176- /* We're now expecting the next sequence number. */
177- proc -> expected_sequence ++ ;
177+ /* We're now expecting the next sequence number. */
178+ proc -> expected_sequence ++ ;
179+ }
178180
179181 /* We generate the SEARCH_POSTED_QUEUE only when the message is
180182 * received in the correct sequence. Otherwise, we delay the event
@@ -506,6 +508,27 @@ static mca_pml_ob1_recv_request_t *match_incomming(
506508 return NULL ;
507509}
508510
511+ static mca_pml_ob1_recv_request_t * match_incomming_no_any_source (
512+ mca_pml_ob1_match_hdr_t * hdr , mca_pml_ob1_comm_t * comm ,
513+ mca_pml_ob1_comm_proc_t * proc )
514+ {
515+ mca_pml_ob1_recv_request_t * recv_req ;
516+ int tag = hdr -> hdr_tag ;
517+
518+ OPAL_LIST_FOREACH (recv_req , & proc -> specific_receives , mca_pml_ob1_recv_request_t ) {
519+ int req_tag = recv_req -> req_recv .req_base .req_tag ;
520+
521+ if (req_tag == tag || (req_tag == OMPI_ANY_TAG && tag >= 0 )) {
522+ opal_list_remove_item (& proc -> specific_receives , (opal_list_item_t * ) recv_req );
523+ PERUSE_TRACE_COMM_EVENT (PERUSE_COMM_REQ_REMOVE_FROM_POSTED_Q ,
524+ & (recv_req -> req_recv .req_base ), PERUSE_RECV );
525+ return recv_req ;
526+ }
527+ }
528+
529+ return NULL ;
530+ }
531+
509532static mca_pml_ob1_recv_request_t *
510533match_one (mca_btl_base_module_t * btl ,
511534 mca_pml_ob1_match_hdr_t * hdr , mca_btl_base_segment_t * segments ,
@@ -517,7 +540,11 @@ match_one(mca_btl_base_module_t *btl,
517540 mca_pml_ob1_comm_t * comm = (mca_pml_ob1_comm_t * )comm_ptr -> c_pml_comm ;
518541
519542 do {
520- match = match_incomming (hdr , comm , proc );
543+ if (!OMPI_COMM_CHECK_ASSERT_NO_ANY_SOURCE (comm_ptr )) {
544+ match = match_incomming (hdr , comm , proc );
545+ } else {
546+ match = match_incomming_no_any_source (hdr , comm , proc );
547+ }
521548
522549 /* if match found, process data */
523550 if (OPAL_LIKELY (NULL != match )) {
0 commit comments