add "specific" matching logic for fragment matching. Add a return
value for lam_list_remove_item(). This commit was SVN r342.
Этот коммит содержится в:
родитель
0aab57e043
Коммит
fcd7ffb54f
@ -111,12 +111,20 @@ static inline lam_list_item_t* lam_list_get_end(lam_list_t* list)
|
||||
}
|
||||
|
||||
/*
|
||||
* Removes the specified item from the list
|
||||
* Removes the specified item from the list. It retuns the element
|
||||
* pointing to item, so that a loop traversing the list from the
|
||||
* top of the list down can proceed.
|
||||
*/
|
||||
static inline void lam_list_remove_item(lam_list_t *list, lam_list_item_t *item){
|
||||
static inline lam_list_item_t *lam_list_remove_item
|
||||
(lam_list_t *list, lam_list_item_t *item)
|
||||
{
|
||||
#ifdef LAM_ENABLE_DEBUG
|
||||
lam_list_item_t *item_ptr;
|
||||
int found=0;
|
||||
int found;
|
||||
#endif
|
||||
|
||||
#ifdef LAM_ENABLE_DEBUG
|
||||
found=0;
|
||||
#endif
|
||||
|
||||
#ifdef LAM_ENABLE_DEBUG
|
||||
@ -142,7 +150,7 @@ static inline void lam_list_remove_item(lam_list_t *list, lam_list_item_t *item)
|
||||
/* reset previous pointer of next element */
|
||||
item->lam_list_next->lam_list_prev=item->lam_list_prev;
|
||||
|
||||
return;
|
||||
return item->lam_list_prev;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -227,7 +227,7 @@ mca_pml_base_recv_request_t *mca_ptl_base_check_recieves_for_match
|
||||
|
||||
/**
|
||||
* Try and match the incoming message fragment to the list of
|
||||
* "wild" receies
|
||||
* "wild" receives
|
||||
*
|
||||
* @param frag_header Matching data from recived fragment (IN)
|
||||
*
|
||||
@ -291,3 +291,65 @@ mca_pml_base_recv_request_t *check_wild_receives_for_match(
|
||||
|
||||
return return_match;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Try and match the incoming message fragment to the list of
|
||||
* "specific" receives
|
||||
*
|
||||
* @param frag_header Matching data from recived fragment (IN)
|
||||
*
|
||||
* @param pml_comm Pointer to the communicator structure used for
|
||||
* matching purposes. (IN)
|
||||
*
|
||||
* @return Matched receive
|
||||
*
|
||||
* This routine assumes that the appropriate matching locks are
|
||||
* set by the upper level routine.
|
||||
*/
|
||||
mca_pml_base_recv_request_t *check_specific_receives_for_match(
|
||||
mca_pml_base_reliable_hdr_t *frag_header,
|
||||
mca_pml_comm_t *pml_comm)
|
||||
{
|
||||
/* local variables */
|
||||
mca_pml_base_recv_request_t *specific_recv;
|
||||
mca_pml_base_recv_request_t *return_match;
|
||||
int frag_src,recv_user_tag,frag_user_tag;
|
||||
|
||||
frag_user_tag=frag_header->hdr_base.hdr_user_tag;
|
||||
|
||||
/* initialization */
|
||||
return_match=(mca_pml_base_recv_request_t *)NULL;
|
||||
frag_src = frag_header->hdr_frag_seq_num;
|
||||
|
||||
/*
|
||||
* Loop over the specific irecvs.
|
||||
*/
|
||||
for(specific_recv = (mca_pml_base_recv_request_t *)
|
||||
lam_list_get_first((pml_comm->specific_receives)+frag_src);
|
||||
specific_recv != (mca_pml_base_recv_request_t *)
|
||||
lam_list_get_end((pml_comm->specific_receives)+frag_src);
|
||||
specific_recv = (mca_pml_base_recv_request_t *)
|
||||
((lam_list_item_t *)specific_recv)->lam_list_next) {
|
||||
/*
|
||||
* Check for a match
|
||||
*/
|
||||
recv_user_tag = specific_recv->super.req_tag;
|
||||
if ( (frag_user_tag == recv_user_tag) ||
|
||||
( (recv_user_tag == LAM_ANY_TAG) && (0 <= frag_user_tag) ) ) {
|
||||
|
||||
/*
|
||||
* Match made
|
||||
*/
|
||||
return_match = specific_recv;
|
||||
|
||||
/* remove descriptor from posted specific ireceive list */
|
||||
lam_list_remove_item((pml_comm->specific_receives)+frag_src,
|
||||
(lam_list_item_t *)specific_recv);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return return_match;
|
||||
}
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user