1
1
fix misc warnings 
cleanup posting of receive descriptors 
comment why we retain before deregister in rcache_rb_mru.c 

This commit was SVN r7595.
Этот коммит содержится в:
Galen Shipman 2005-10-03 16:35:12 +00:00
родитель 4df7d936bf
Коммит eefe0fd04a
5 изменённых файлов: 64 добавлений и 52 удалений

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

@ -155,10 +155,10 @@ int mca_btl_openib_register(
mca_btl_openib_module_t* openib_btl = (mca_btl_openib_module_t*) btl; mca_btl_openib_module_t* openib_btl = (mca_btl_openib_module_t*) btl;
OPAL_THREAD_LOCK(&openib->ib_lock); OPAL_THREAD_LOCK(&openib_btl->ib_lock);
openib_btl->ib_reg[tag].cbfunc = cbfunc; openib_btl->ib_reg[tag].cbfunc = cbfunc;
openib_btl->ib_reg[tag].cbdata = cbdata; openib_btl->ib_reg[tag].cbdata = cbdata;
OPAL_THREAD_UNLOCK(&openib->ib_lock); OPAL_THREAD_UNLOCK(&openib_btl->ib_lock);
return OMPI_SUCCESS; return OMPI_SUCCESS;
} }

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

@ -401,6 +401,7 @@ int mca_btl_openib_module_init(mca_btl_openib_module_t* openib_btl);
#define MCA_BTL_OPENIB_POST_SRR_HIGH(openib_btl, additional) \ #define MCA_BTL_OPENIB_POST_SRR_HIGH(openib_btl, additional) \
{ \ { \
do{ \
OPAL_THREAD_LOCK(&openib_btl->ib_lock); \ OPAL_THREAD_LOCK(&openib_btl->ib_lock); \
if(openib_btl->srr_posted_high <= mca_btl_openib_component.ib_rr_buf_min+additional && \ if(openib_btl->srr_posted_high <= mca_btl_openib_component.ib_rr_buf_min+additional && \
openib_btl->srr_posted_high < mca_btl_openib_component.ib_rr_buf_max){ \ openib_btl->srr_posted_high < mca_btl_openib_component.ib_rr_buf_max){ \
@ -412,10 +413,12 @@ int mca_btl_openib_module_init(mca_btl_openib_module_t* openib_btl);
openib_btl->srq_high); \ openib_btl->srq_high); \
} \ } \
OPAL_THREAD_UNLOCK(&openib_btl->ib_lock); \ OPAL_THREAD_UNLOCK(&openib_btl->ib_lock); \
} while(0); \
} }
#define MCA_BTL_OPENIB_POST_SRR_LOW(openib_btl, additional) \ #define MCA_BTL_OPENIB_POST_SRR_LOW(openib_btl, additional) \
{ \ { \
do { \
OPAL_THREAD_LOCK(&openib_btl->ib_lock); \ OPAL_THREAD_LOCK(&openib_btl->ib_lock); \
if(openib_btl->srr_posted_low <= mca_btl_openib_component.ib_rr_buf_min+additional && \ if(openib_btl->srr_posted_low <= mca_btl_openib_component.ib_rr_buf_min+additional && \
openib_btl->srr_posted_low < mca_btl_openib_component.ib_rr_buf_max){ \ openib_btl->srr_posted_low < mca_btl_openib_component.ib_rr_buf_max){ \
@ -427,6 +430,7 @@ int mca_btl_openib_module_init(mca_btl_openib_module_t* openib_btl);
openib_btl->srq_low); \ openib_btl->srq_low); \
} \ } \
OPAL_THREAD_UNLOCK(&openib_btl->ib_lock); \ OPAL_THREAD_UNLOCK(&openib_btl->ib_lock); \
} while(0); \
} }
@ -454,7 +458,7 @@ int mca_btl_openib_module_init(mca_btl_openib_module_t* openib_btl);
return OMPI_ERROR; \ return OMPI_ERROR; \
}\ }\
}\ }\
OPAL_THREAD_ADD32(srr_posted, cnt); \ OPAL_THREAD_ADD32((int32_t*) srr_posted, cnt); \
} while(0);\ } while(0);\
} }

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

@ -593,11 +593,11 @@ int mca_btl_openib_component_progress()
#ifdef OMPI_MCA_BTL_OPENIB_HAVE_SRQ #ifdef OMPI_MCA_BTL_OPENIB_HAVE_SRQ
if(mca_btl_openib_component.use_srq) { if(mca_btl_openib_component.use_srq) {
OPAL_THREAD_ADD32(&openib_btl->srr_posted_high, -1); OPAL_THREAD_ADD32((int32_t*) &openib_btl->srr_posted_high, -1);
MCA_BTL_OPENIB_POST_SRR_HIGH(openib_btl, 0); MCA_BTL_OPENIB_POST_SRR_HIGH(openib_btl, 0);
} else { } else {
#endif #endif
OPAL_THREAD_ADD32(&endpoint->rr_posted_high, -1); OPAL_THREAD_ADD32((int32_t*) &endpoint->rr_posted_high, -1);
MCA_BTL_OPENIB_ENDPOINT_POST_RR_HIGH(((mca_btl_openib_frag_t*) (void*) (unsigned long) wc.wr_id)->endpoint, 0); MCA_BTL_OPENIB_ENDPOINT_POST_RR_HIGH(((mca_btl_openib_frag_t*) (void*) (unsigned long) wc.wr_id)->endpoint, 0);
#ifdef OMPI_MCA_BTL_OPENIB_HAVE_SRQ #ifdef OMPI_MCA_BTL_OPENIB_HAVE_SRQ
} }
@ -661,11 +661,11 @@ int mca_btl_openib_component_progress()
#ifdef OMPI_MCA_BTL_OPENIB_HAVE_SRQ #ifdef OMPI_MCA_BTL_OPENIB_HAVE_SRQ
if(mca_btl_openib_component.use_srq) { if(mca_btl_openib_component.use_srq) {
OPAL_THREAD_ADD32(&openib_btl->srr_posted_low, -1); OPAL_THREAD_ADD32((int32_t*) &openib_btl->srr_posted_low, -1);
MCA_BTL_OPENIB_POST_SRR_LOW(openib_btl, 0); MCA_BTL_OPENIB_POST_SRR_LOW(openib_btl, 0);
} else { } else {
#endif #endif
OPAL_THREAD_ADD32(&endpoint->rr_posted_low, -1); OPAL_THREAD_ADD32((int32_t*) &endpoint->rr_posted_low, -1);
MCA_BTL_OPENIB_ENDPOINT_POST_RR_LOW(((mca_btl_openib_frag_t*) (void*) MCA_BTL_OPENIB_ENDPOINT_POST_RR_LOW(((mca_btl_openib_frag_t*) (void*)
(unsigned long)wc.wr_id)->endpoint, 0); (unsigned long)wc.wr_id)->endpoint, 0);
#ifdef OMPI_MCA_BTL_OPENIB_HAVE_SRQ #ifdef OMPI_MCA_BTL_OPENIB_HAVE_SRQ

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

@ -156,65 +156,71 @@ void mca_btl_openib_post_recv(void);
#define MCA_BTL_OPENIB_ENDPOINT_POST_RR_HIGH(post_rr_high_endpoint, \ #define MCA_BTL_OPENIB_ENDPOINT_POST_RR_HIGH(endpoint, \
post_rr_high_additional) \ additional) \
{ \ { \
mca_btl_openib_module_t * post_rr_high_openib_btl = post_rr_high_endpoint->endpoint_btl; \ do { \
OPAL_THREAD_LOCK(&post_rr_high_openib_btl->ib_lock); \ mca_btl_openib_module_t * openib_btl = endpoint->endpoint_btl; \
if(post_rr_high_endpoint->rr_posted_high <= mca_btl_openib_component.ib_rr_buf_min+post_rr_high_additional && \ OPAL_THREAD_LOCK(&openib_btl->ib_lock); \
post_rr_high_endpoint->rr_posted_high < mca_btl_openib_component.ib_rr_buf_max){ \ if(endpoint->rr_posted_high <= mca_btl_openib_component.ib_rr_buf_min+additional && \
endpoint->rr_posted_high < mca_btl_openib_component.ib_rr_buf_max){ \
MCA_BTL_OPENIB_ENDPOINT_POST_RR_SUB(mca_btl_openib_component.ib_rr_buf_max - \ MCA_BTL_OPENIB_ENDPOINT_POST_RR_SUB(mca_btl_openib_component.ib_rr_buf_max - \
post_rr_high_endpoint->rr_posted_high, \ endpoint->rr_posted_high, \
post_rr_high_endpoint, \ endpoint, \
&post_rr_high_openib_btl->recv_free_eager, \ &openib_btl->recv_free_eager, \
&post_rr_high_endpoint->rr_posted_high, \ &endpoint->rr_posted_high, \
post_rr_high_endpoint->lcl_qp_high); \ endpoint->lcl_qp_high); \
} \ } \
OPAL_THREAD_UNLOCK(&post_rr_high_openib_btl->ib_lock); \ OPAL_THREAD_UNLOCK(&openib_btl->ib_lock); \
} while(0); \
} }
#define MCA_BTL_OPENIB_ENDPOINT_POST_RR_LOW(post_rr_low_endpoint, \ #define MCA_BTL_OPENIB_ENDPOINT_POST_RR_LOW(endpoint, \
post_rr_low_additional) { \ additional) { \
mca_btl_openib_module_t * post_rr_low_openib_btl = post_rr_low_endpoint->endpoint_btl; \ do { \
OPAL_THREAD_LOCK(&post_rr_low_openib_btl->ib_lock); \ mca_btl_openib_module_t * openib_btl = endpoint->endpoint_btl; \
if(post_rr_low_endpoint->rr_posted_low <= mca_btl_openib_component.ib_rr_buf_min+post_rr_low_additional && \ OPAL_THREAD_LOCK(&openib_btl->ib_lock); \
post_rr_low_endpoint->rr_posted_low < mca_btl_openib_component.ib_rr_buf_max){ \ if(endpoint->rr_posted_low <= mca_btl_openib_component.ib_rr_buf_min+additional && \
endpoint->rr_posted_low < mca_btl_openib_component.ib_rr_buf_max){ \
MCA_BTL_OPENIB_ENDPOINT_POST_RR_SUB(mca_btl_openib_component.ib_rr_buf_max - \ MCA_BTL_OPENIB_ENDPOINT_POST_RR_SUB(mca_btl_openib_component.ib_rr_buf_max - \
post_rr_low_endpoint->rr_posted_low, \ endpoint->rr_posted_low, \
post_rr_low_endpoint, \ endpoint, \
&post_rr_low_openib_btl->recv_free_max, \ &openib_btl->recv_free_max, \
&post_rr_low_endpoint->rr_posted_low, \ &endpoint->rr_posted_low, \
post_rr_low_endpoint->lcl_qp_low \ endpoint->lcl_qp_low \
); } \ ); } \
OPAL_THREAD_UNLOCK(&post_rr_low_openib_btl->ib_lock); \ OPAL_THREAD_UNLOCK(&openib_btl->ib_lock); \
} while(0); \
} }
#define MCA_BTL_OPENIB_ENDPOINT_POST_RR_SUB(post_rr_sub_cnt, \ #define MCA_BTL_OPENIB_ENDPOINT_POST_RR_SUB(cnt, \
post_rr_sub_endpoint, \ my_endpoint, \
post_rr_sub_frag_list, \ frag_list, \
post_rr_sub_rr_posted, \ rr_posted, \
post_rr_sub_qp ) \ qp ) \
{\ {\
uint32_t post_rr_sub_i; \ do { \
int post_rr_sub_rc; \ uint32_t i; \
opal_list_item_t* post_rr_sub_item; \ int rc; \
mca_btl_openib_frag_t* post_rr_sub_frag; \ opal_list_item_t* item; \
struct ibv_recv_wr* post_rr_sub_bad_wr; \ mca_btl_openib_frag_t* frag; \
for(post_rr_sub_i = 0; post_rr_sub_i < post_rr_sub_cnt; post_rr_sub_i++) { \ struct ibv_recv_wr* bad_wr; \
OMPI_FREE_LIST_WAIT(post_rr_sub_frag_list, post_rr_sub_item, post_rr_sub_rc); \ for(i = 0; i < cnt; i++) { \
post_rr_sub_frag = (mca_btl_openib_frag_t*) post_rr_sub_item; \ OMPI_FREE_LIST_WAIT(frag_list, item, rc); \
post_rr_sub_frag->endpoint = post_rr_sub_endpoint; \ frag = (mca_btl_openib_frag_t*) item; \
post_rr_sub_frag->sg_entry.length = post_rr_sub_frag->size + \ frag->endpoint = my_endpoint; \
((unsigned char*) post_rr_sub_frag->segment.seg_addr.pval- \ frag->sg_entry.length = frag->size + \
(unsigned char*) post_rr_sub_frag->hdr); \ ((unsigned char*) frag->segment.seg_addr.pval- \
if(ibv_post_recv(post_rr_sub_qp, \ (unsigned char*) frag->hdr); \
&post_rr_sub_frag->wr_desc.rr_desc, \ if(ibv_post_recv(qp, \
&post_rr_sub_bad_wr)) { \ &frag->wr_desc.rr_desc, \
&bad_wr)) { \
BTL_ERROR(("error posting receive errno says %s\n", strerror(errno))); \ BTL_ERROR(("error posting receive errno says %s\n", strerror(errno))); \
return OMPI_ERROR; \ return OMPI_ERROR; \
}\ }\
}\ }\
OPAL_THREAD_ADD32(post_rr_sub_rr_posted, post_rr_sub_cnt); \ OPAL_THREAD_ADD32((int32_t*) rr_posted, cnt); \
} while(0); \
} }

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

@ -47,6 +47,8 @@ int mca_rcache_rb_mru_insert(
*/ */
old_reg = (mca_mpool_base_registration_t*) old_reg = (mca_mpool_base_registration_t*)
opal_list_get_first(&rcache->mru_list); opal_list_get_first(&rcache->mru_list);
/* we need to retain first, because we only want the registration
removed from the tree and the mru */
old_reg->mpool->mpool_retain(old_reg->mpool, old_reg); old_reg->mpool->mpool_retain(old_reg->mpool, old_reg);
old_reg->mpool->mpool_deregister(old_reg->mpool, old_reg); old_reg->mpool->mpool_deregister(old_reg->mpool, old_reg);