Cleanup:
1. remove all useless macros from the proc header file 2. merge 2 of the match macros (they share the same logic except one list) This commit was SVN r8946.
Этот коммит содержится в:
родитель
83f83e5730
Коммит
269fc0c13a
@ -38,59 +38,7 @@ struct mca_pml_ob1_proc_t {
|
||||
mca_pml_proc_t base;
|
||||
};
|
||||
typedef struct mca_pml_ob1_proc_t mca_pml_ob1_proc_t;
|
||||
OMPI_COMP_EXPORT extern opal_class_t mca_pml_ob1_proc_t_class;
|
||||
|
||||
/**
|
||||
* Return the mca_pml_proc_t instance cached in the communicators local group.
|
||||
*
|
||||
* @param comm Communicator
|
||||
* @param rank Peer rank
|
||||
* @return mca_pml_proc_t instance
|
||||
*/
|
||||
|
||||
/* static inline mca_pml_ob1_proc_t* mca_pml_ob1_proc_lookup_local(ompi_communicator_t* comm, int rank) */
|
||||
/* { */
|
||||
/* return (mca_pml_ob1_proc_t*) comm->c_local_group->grp_proc_pointers[rank]->proc_pml; */
|
||||
/* } */
|
||||
|
||||
/* /\** */
|
||||
/* * Return the mca_pml_proc_t instance cached on the communicators remote group. */
|
||||
/* * */
|
||||
/* * @param comm Communicator */
|
||||
/* * @param rank Peer rank */
|
||||
/* * @return mca_pml_proc_t instance */
|
||||
/* *\/ */
|
||||
|
||||
/* static inline mca_pml_ob1_proc_t* mca_pml_ob1_proc_lookup_remote(ompi_communicator_t* comm, int rank) */
|
||||
/* { */
|
||||
/* return (mca_pml_ob1_proc_t*) comm->c_pml_procs[rank]; */
|
||||
/* } */
|
||||
|
||||
/* /\** */
|
||||
/* * Return the mca_btl_peer_t instance corresponding to the process/btl combination. */
|
||||
/* * */
|
||||
/* * @param comm Communicator */
|
||||
/* * @param rank Peer rank */
|
||||
/* * @return mca_pml_proc_t instance */
|
||||
/* *\/ */
|
||||
|
||||
/* static inline struct mca_btl_base_endpoint_t* mca_pml_ob1_proc_lookup_remote_endpoint( */
|
||||
/* ompi_communicator_t* comm, */
|
||||
/* int rank, */
|
||||
/* struct mca_btl_base_module_t* btl) */
|
||||
/* { */
|
||||
/* mca_pml_ob1_proc_t* proc = (mca_pml_ob1_proc_t*) comm->c_pml_procs[rank]; */
|
||||
/* size_t i, size = mca_pml_ob1_ep_array_get_size(&proc->btl_eager); */
|
||||
/* mca_pml_ob1_endpoint_t* endpoint = proc->btl_eager.arr_endpoints; */
|
||||
/* for(i = 0; i < size; i++) { */
|
||||
/* if(endpoint->btl == btl) { */
|
||||
/* return endpoint->btl_endpoint; */
|
||||
/* } */
|
||||
/* endpoint++; */
|
||||
/* } */
|
||||
/* return NULL; */
|
||||
/* } */
|
||||
|
||||
OMPI_COMP_EXPORT extern opal_class_t mca_pml_ob1_proc_t_class;
|
||||
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
}
|
||||
|
@ -110,7 +110,50 @@ void mca_pml_ob1_recv_frag_callback(
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Try and match the incoming message fragment to a generic
|
||||
* list of receives
|
||||
*
|
||||
* @param hdr Matching data from received fragment (IN)
|
||||
*
|
||||
* @param generic_receives Pointer to the receive list used for
|
||||
* matching purposes. (IN)
|
||||
*
|
||||
* @return Matched receive
|
||||
*
|
||||
* This routine assumes that the appropriate matching locks are
|
||||
* set by the upper level routine.
|
||||
*/
|
||||
#define MCA_PML_OB1_MATCH_GENERIC_RECEIVES(hdr,generic_receives,return_match) \
|
||||
do { \
|
||||
/* local variables */ \
|
||||
mca_pml_ob1_recv_request_t *generic_recv; \
|
||||
int recv_tag, frag_tag = hdr->hdr_tag; \
|
||||
\
|
||||
/* Loop over the receives. */ \
|
||||
for( generic_recv = (mca_pml_ob1_recv_request_t *) \
|
||||
opal_list_get_first(generic_receives); \
|
||||
generic_recv != (mca_pml_ob1_recv_request_t *) \
|
||||
opal_list_get_end(generic_receives); \
|
||||
generic_recv = (mca_pml_ob1_recv_request_t *) \
|
||||
((opal_list_item_t *)generic_recv)->opal_list_next) { \
|
||||
/* Check for a match */ \
|
||||
recv_tag = generic_recv->req_recv.req_base.req_tag; \
|
||||
if ( (frag_tag == recv_tag) || \
|
||||
( (recv_tag == OMPI_ANY_TAG) && (0 <= frag_tag) ) ) { \
|
||||
\
|
||||
/* Match made */ \
|
||||
return_match = generic_recv; \
|
||||
\
|
||||
/* remove descriptor from posted specific ireceive list */ \
|
||||
opal_list_remove_item(generic_receives, \
|
||||
(opal_list_item_t *)generic_recv); \
|
||||
\
|
||||
break; \
|
||||
} \
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
/**
|
||||
* Try and match the incoming message fragment to the list of
|
||||
@ -131,47 +174,7 @@ void mca_pml_ob1_recv_frag_callback(
|
||||
do { \
|
||||
/* local parameters */ \
|
||||
opal_list_t* wild_receives = &comm->wild_receives; \
|
||||
mca_pml_ob1_recv_request_t *wild_recv; \
|
||||
int frag_tag,recv_tag; \
|
||||
\
|
||||
/* initialization */ \
|
||||
frag_tag=hdr->hdr_tag; \
|
||||
\
|
||||
/* \
|
||||
* Loop over the wild irecvs - no need to lock, the upper level \
|
||||
* locking is protecting from having other threads trying to \
|
||||
* change this list. \
|
||||
*/ \
|
||||
for(wild_recv = (mca_pml_ob1_recv_request_t *) \
|
||||
opal_list_get_first(wild_receives); \
|
||||
wild_recv != (mca_pml_ob1_recv_request_t *) \
|
||||
opal_list_get_end(wild_receives); \
|
||||
wild_recv = (mca_pml_ob1_recv_request_t *) \
|
||||
((opal_list_item_t *)wild_recv)->opal_list_next) { \
|
||||
\
|
||||
recv_tag = wild_recv->req_recv.req_base.req_tag; \
|
||||
if ( \
|
||||
/* exact tag match */ \
|
||||
(frag_tag == recv_tag) || \
|
||||
/* wild tag match - negative tags (except for \
|
||||
* OMPI_ANY_TAG) are reserved for internal use, and will \
|
||||
* not be matched with OMPI_ANY_TAG */ \
|
||||
( (recv_tag == OMPI_ANY_TAG) && (0 <= frag_tag) ) ) \
|
||||
\
|
||||
{ \
|
||||
/* \
|
||||
* Mark that this is the matching irecv, and go to process it. \
|
||||
*/ \
|
||||
return_match = wild_recv; \
|
||||
\
|
||||
/* remove this irecv from the postd wild ireceive list */ \
|
||||
opal_list_remove_item(wild_receives, \
|
||||
(opal_list_item_t *)wild_recv); \
|
||||
\
|
||||
/* found match - no need to continue */ \
|
||||
break; \
|
||||
} \
|
||||
} \
|
||||
MCA_PML_OB1_MATCH_GENERIC_RECEIVES(hdr,wild_receives,return_match); \
|
||||
} while(0)
|
||||
|
||||
|
||||
@ -193,40 +196,7 @@ do { \
|
||||
do { \
|
||||
/* local variables */ \
|
||||
opal_list_t* specific_receives = &proc->specific_receives; \
|
||||
mca_pml_ob1_recv_request_t *specific_recv; \
|
||||
int recv_tag,frag_tag; \
|
||||
\
|
||||
/* initialization */ \
|
||||
frag_tag=hdr->hdr_tag; \
|
||||
\
|
||||
/* \
|
||||
* Loop over the specific irecvs. \
|
||||
*/ \
|
||||
for(specific_recv = (mca_pml_ob1_recv_request_t *) \
|
||||
opal_list_get_first(specific_receives); \
|
||||
specific_recv != (mca_pml_ob1_recv_request_t *) \
|
||||
opal_list_get_end(specific_receives); \
|
||||
specific_recv = (mca_pml_ob1_recv_request_t *) \
|
||||
((opal_list_item_t *)specific_recv)->opal_list_next) { \
|
||||
/* \
|
||||
* Check for a match \
|
||||
*/ \
|
||||
recv_tag = specific_recv->req_recv.req_base.req_tag; \
|
||||
if ( (frag_tag == recv_tag) || \
|
||||
( (recv_tag == OMPI_ANY_TAG) && (0 <= frag_tag) ) ) { \
|
||||
\
|
||||
/* \
|
||||
* Match made \
|
||||
*/ \
|
||||
return_match = specific_recv; \
|
||||
\
|
||||
/* remove descriptor from posted specific ireceive list */ \
|
||||
opal_list_remove_item(specific_receives, \
|
||||
(opal_list_item_t *)specific_recv); \
|
||||
\
|
||||
break; \
|
||||
} \
|
||||
} \
|
||||
MCA_PML_OB1_MATCH_GENERIC_RECEIVES(hdr,specific_receives,return_match); \
|
||||
} while(0)
|
||||
|
||||
/**
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user