fix threaded compile
fix misc warnings cleanup posting of receive descriptors comment why we retain before deregister in rcache_rb_mru.c This commit was SVN r7595.
Этот коммит содержится в:
родитель
4df7d936bf
Коммит
eefe0fd04a
@ -155,10 +155,10 @@ int mca_btl_openib_register(
|
||||
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].cbdata = cbdata;
|
||||
OPAL_THREAD_UNLOCK(&openib->ib_lock);
|
||||
OPAL_THREAD_UNLOCK(&openib_btl->ib_lock);
|
||||
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) \
|
||||
{ \
|
||||
do{ \
|
||||
OPAL_THREAD_LOCK(&openib_btl->ib_lock); \
|
||||
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){ \
|
||||
@ -412,10 +413,12 @@ int mca_btl_openib_module_init(mca_btl_openib_module_t* openib_btl);
|
||||
openib_btl->srq_high); \
|
||||
} \
|
||||
OPAL_THREAD_UNLOCK(&openib_btl->ib_lock); \
|
||||
} while(0); \
|
||||
}
|
||||
|
||||
#define MCA_BTL_OPENIB_POST_SRR_LOW(openib_btl, additional) \
|
||||
{ \
|
||||
do { \
|
||||
OPAL_THREAD_LOCK(&openib_btl->ib_lock); \
|
||||
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){ \
|
||||
@ -427,6 +430,7 @@ int mca_btl_openib_module_init(mca_btl_openib_module_t* openib_btl);
|
||||
openib_btl->srq_low); \
|
||||
} \
|
||||
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; \
|
||||
}\
|
||||
}\
|
||||
OPAL_THREAD_ADD32(srr_posted, cnt); \
|
||||
OPAL_THREAD_ADD32((int32_t*) srr_posted, cnt); \
|
||||
} while(0);\
|
||||
}
|
||||
|
||||
|
@ -593,11 +593,11 @@ int mca_btl_openib_component_progress()
|
||||
|
||||
#ifdef OMPI_MCA_BTL_OPENIB_HAVE_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);
|
||||
} else {
|
||||
#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);
|
||||
#ifdef OMPI_MCA_BTL_OPENIB_HAVE_SRQ
|
||||
}
|
||||
@ -661,11 +661,11 @@ int mca_btl_openib_component_progress()
|
||||
|
||||
#ifdef OMPI_MCA_BTL_OPENIB_HAVE_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);
|
||||
} else {
|
||||
#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*)
|
||||
(unsigned long)wc.wr_id)->endpoint, 0);
|
||||
#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, \
|
||||
post_rr_high_additional) \
|
||||
#define MCA_BTL_OPENIB_ENDPOINT_POST_RR_HIGH(endpoint, \
|
||||
additional) \
|
||||
{ \
|
||||
mca_btl_openib_module_t * post_rr_high_openib_btl = post_rr_high_endpoint->endpoint_btl; \
|
||||
OPAL_THREAD_LOCK(&post_rr_high_openib_btl->ib_lock); \
|
||||
if(post_rr_high_endpoint->rr_posted_high <= mca_btl_openib_component.ib_rr_buf_min+post_rr_high_additional && \
|
||||
post_rr_high_endpoint->rr_posted_high < mca_btl_openib_component.ib_rr_buf_max){ \
|
||||
do { \
|
||||
mca_btl_openib_module_t * openib_btl = endpoint->endpoint_btl; \
|
||||
OPAL_THREAD_LOCK(&openib_btl->ib_lock); \
|
||||
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 - \
|
||||
post_rr_high_endpoint->rr_posted_high, \
|
||||
post_rr_high_endpoint, \
|
||||
&post_rr_high_openib_btl->recv_free_eager, \
|
||||
&post_rr_high_endpoint->rr_posted_high, \
|
||||
post_rr_high_endpoint->lcl_qp_high); \
|
||||
endpoint->rr_posted_high, \
|
||||
endpoint, \
|
||||
&openib_btl->recv_free_eager, \
|
||||
&endpoint->rr_posted_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, \
|
||||
post_rr_low_additional) { \
|
||||
mca_btl_openib_module_t * post_rr_low_openib_btl = post_rr_low_endpoint->endpoint_btl; \
|
||||
OPAL_THREAD_LOCK(&post_rr_low_openib_btl->ib_lock); \
|
||||
if(post_rr_low_endpoint->rr_posted_low <= mca_btl_openib_component.ib_rr_buf_min+post_rr_low_additional && \
|
||||
post_rr_low_endpoint->rr_posted_low < mca_btl_openib_component.ib_rr_buf_max){ \
|
||||
#define MCA_BTL_OPENIB_ENDPOINT_POST_RR_LOW(endpoint, \
|
||||
additional) { \
|
||||
do { \
|
||||
mca_btl_openib_module_t * openib_btl = endpoint->endpoint_btl; \
|
||||
OPAL_THREAD_LOCK(&openib_btl->ib_lock); \
|
||||
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 - \
|
||||
post_rr_low_endpoint->rr_posted_low, \
|
||||
post_rr_low_endpoint, \
|
||||
&post_rr_low_openib_btl->recv_free_max, \
|
||||
&post_rr_low_endpoint->rr_posted_low, \
|
||||
post_rr_low_endpoint->lcl_qp_low \
|
||||
endpoint->rr_posted_low, \
|
||||
endpoint, \
|
||||
&openib_btl->recv_free_max, \
|
||||
&endpoint->rr_posted_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, \
|
||||
post_rr_sub_endpoint, \
|
||||
post_rr_sub_frag_list, \
|
||||
post_rr_sub_rr_posted, \
|
||||
post_rr_sub_qp ) \
|
||||
#define MCA_BTL_OPENIB_ENDPOINT_POST_RR_SUB(cnt, \
|
||||
my_endpoint, \
|
||||
frag_list, \
|
||||
rr_posted, \
|
||||
qp ) \
|
||||
{\
|
||||
uint32_t post_rr_sub_i; \
|
||||
int post_rr_sub_rc; \
|
||||
opal_list_item_t* post_rr_sub_item; \
|
||||
mca_btl_openib_frag_t* post_rr_sub_frag; \
|
||||
struct ibv_recv_wr* post_rr_sub_bad_wr; \
|
||||
for(post_rr_sub_i = 0; post_rr_sub_i < post_rr_sub_cnt; post_rr_sub_i++) { \
|
||||
OMPI_FREE_LIST_WAIT(post_rr_sub_frag_list, post_rr_sub_item, post_rr_sub_rc); \
|
||||
post_rr_sub_frag = (mca_btl_openib_frag_t*) post_rr_sub_item; \
|
||||
post_rr_sub_frag->endpoint = post_rr_sub_endpoint; \
|
||||
post_rr_sub_frag->sg_entry.length = post_rr_sub_frag->size + \
|
||||
((unsigned char*) post_rr_sub_frag->segment.seg_addr.pval- \
|
||||
(unsigned char*) post_rr_sub_frag->hdr); \
|
||||
if(ibv_post_recv(post_rr_sub_qp, \
|
||||
&post_rr_sub_frag->wr_desc.rr_desc, \
|
||||
&post_rr_sub_bad_wr)) { \
|
||||
do { \
|
||||
uint32_t i; \
|
||||
int rc; \
|
||||
opal_list_item_t* item; \
|
||||
mca_btl_openib_frag_t* frag; \
|
||||
struct ibv_recv_wr* bad_wr; \
|
||||
for(i = 0; i < cnt; i++) { \
|
||||
OMPI_FREE_LIST_WAIT(frag_list, item, rc); \
|
||||
frag = (mca_btl_openib_frag_t*) item; \
|
||||
frag->endpoint = my_endpoint; \
|
||||
frag->sg_entry.length = frag->size + \
|
||||
((unsigned char*) frag->segment.seg_addr.pval- \
|
||||
(unsigned char*) frag->hdr); \
|
||||
if(ibv_post_recv(qp, \
|
||||
&frag->wr_desc.rr_desc, \
|
||||
&bad_wr)) { \
|
||||
BTL_ERROR(("error posting receive errno says %s\n", strerror(errno))); \
|
||||
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*)
|
||||
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_deregister(old_reg->mpool, old_reg);
|
||||
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user