Track fragments by list, not by size..
-- reviewed by Brian, needs to hit all the branches.. This commit was SVN r10078.
Этот коммит содержится в:
родитель
38a0561d9b
Коммит
2667c52a5d
@ -218,17 +218,7 @@ int mca_btl_gm_free(
|
||||
mca_btl_base_descriptor_t* des)
|
||||
{
|
||||
mca_btl_gm_frag_t* frag = (mca_btl_gm_frag_t*)des;
|
||||
if(frag->size == 0) {
|
||||
btl->btl_mpool->mpool_release(btl->btl_mpool, frag->registration);
|
||||
MCA_BTL_GM_FRAG_RETURN_USER(btl, frag);
|
||||
} else if(frag->size == mca_btl_gm_component.gm_eager_frag_size) {
|
||||
MCA_BTL_GM_FRAG_RETURN_EAGER(btl, frag);
|
||||
} else if(frag->size == mca_btl_gm_component.gm_max_frag_size) {
|
||||
MCA_BTL_GM_FRAG_RETURN_MAX(btl, frag);
|
||||
} else {
|
||||
opal_output(0, "[%s:%d] mca_btl_gm_free: invalid descriptor\n", __FILE__,__LINE__);
|
||||
return OMPI_ERR_BAD_PARAM;
|
||||
}
|
||||
MCA_BTL_GM_FRAG_RETURN(btl, frag);
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
@ -314,7 +304,7 @@ mca_btl_base_descriptor_t* mca_btl_gm_prepare_src(
|
||||
®istration);
|
||||
|
||||
if(rc != OMPI_SUCCESS) {
|
||||
MCA_BTL_GM_FRAG_RETURN_USER(btl,frag);
|
||||
MCA_BTL_GM_FRAG_RETURN(btl,frag);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -341,7 +331,7 @@ mca_btl_base_descriptor_t* mca_btl_gm_prepare_src(
|
||||
rc = ompi_convertor_pack(convertor, &iov, &iov_count, &max_data, &free_after);
|
||||
*size = max_data;
|
||||
if( rc < 0 ) {
|
||||
MCA_BTL_GM_FRAG_RETURN_EAGER(btl, frag);
|
||||
MCA_BTL_GM_FRAG_RETURN(btl, frag);
|
||||
return NULL;
|
||||
}
|
||||
frag->segment.seg_len = max_data + reserve;
|
||||
@ -367,7 +357,7 @@ mca_btl_base_descriptor_t* mca_btl_gm_prepare_src(
|
||||
*size = max_data;
|
||||
|
||||
if( rc < 0 ) {
|
||||
MCA_BTL_GM_FRAG_RETURN_MAX(btl, frag);
|
||||
MCA_BTL_GM_FRAG_RETURN(btl, frag);
|
||||
return NULL;
|
||||
}
|
||||
frag->segment.seg_len = max_data + reserve;
|
||||
@ -443,7 +433,7 @@ mca_btl_base_descriptor_t* mca_btl_gm_prepare_dst(
|
||||
0,
|
||||
®istration);
|
||||
if(rc != OMPI_SUCCESS) {
|
||||
MCA_BTL_GM_FRAG_RETURN_USER(btl,frag);
|
||||
MCA_BTL_GM_FRAG_RETURN(btl,frag);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -50,6 +50,7 @@ struct mca_btl_gm_frag_t {
|
||||
size_t size;
|
||||
enum gm_priority priority;
|
||||
mca_btl_gm_frag_type_t type;
|
||||
ompi_free_list_t* my_list;
|
||||
};
|
||||
typedef struct mca_btl_gm_frag_t mca_btl_gm_frag_t;
|
||||
OBJ_CLASS_DECLARATION(mca_btl_gm_frag_t);
|
||||
@ -79,12 +80,7 @@ OBJ_CLASS_DECLARATION(mca_btl_gm_frag_user_t);
|
||||
opal_list_item_t *item; \
|
||||
OMPI_FREE_LIST_WAIT(&((mca_btl_gm_module_t*)btl)->gm_frag_eager, item, rc); \
|
||||
frag = (mca_btl_gm_frag_t*) item; \
|
||||
}
|
||||
|
||||
#define MCA_BTL_GM_FRAG_RETURN_EAGER(btl, frag) \
|
||||
{ \
|
||||
OMPI_FREE_LIST_RETURN(&((mca_btl_gm_module_t*)btl)->gm_frag_eager, \
|
||||
(opal_list_item_t*)(frag)); \
|
||||
frag->my_list = &((mca_btl_gm_module_t*)btl)->gm_frag_eager; \
|
||||
}
|
||||
|
||||
#define MCA_BTL_GM_FRAG_ALLOC_MAX(btl, frag, rc) \
|
||||
@ -93,26 +89,21 @@ OBJ_CLASS_DECLARATION(mca_btl_gm_frag_user_t);
|
||||
opal_list_item_t *item; \
|
||||
OMPI_FREE_LIST_WAIT(&((mca_btl_gm_module_t*)btl)->gm_frag_max, item, rc); \
|
||||
frag = (mca_btl_gm_frag_t*) item; \
|
||||
frag->my_list = &((mca_btl_gm_module_t*)btl)->gm_frag_max; \
|
||||
}
|
||||
|
||||
#define MCA_BTL_GM_FRAG_RETURN_MAX(btl, frag) \
|
||||
{ \
|
||||
OMPI_FREE_LIST_RETURN(&((mca_btl_gm_module_t*)btl)->gm_frag_max, \
|
||||
(opal_list_item_t*)(frag)); \
|
||||
}
|
||||
|
||||
|
||||
#define MCA_BTL_GM_FRAG_ALLOC_USER(btl, frag, rc) \
|
||||
{ \
|
||||
opal_list_item_t *item; \
|
||||
OMPI_FREE_LIST_WAIT(&((mca_btl_gm_module_t*)btl)->gm_frag_user, item, rc); \
|
||||
frag = (mca_btl_gm_frag_t*) item; \
|
||||
frag->my_list = &((mca_btl_gm_module_t*)btl)->gm_frag_user; \
|
||||
}
|
||||
|
||||
#define MCA_BTL_GM_FRAG_RETURN_USER(btl, frag) \
|
||||
#define MCA_BTL_GM_FRAG_RETURN(btl, frag) \
|
||||
{ \
|
||||
OMPI_FREE_LIST_RETURN(&((mca_btl_gm_module_t*)btl)->gm_frag_user, \
|
||||
(opal_list_item_t*)(frag)); \
|
||||
OMPI_FREE_LIST_RETURN(frag->my_list, \
|
||||
(opal_list_item_t*)(frag)); \
|
||||
}
|
||||
|
||||
|
||||
|
@ -223,17 +223,8 @@ int mca_btl_mvapi_free(
|
||||
mca_btl_base_descriptor_t* des)
|
||||
{
|
||||
mca_btl_mvapi_frag_t* frag = (mca_btl_mvapi_frag_t*)des;
|
||||
|
||||
if(frag->size == 0) {
|
||||
btl->btl_mpool->mpool_release(btl->btl_mpool, (mca_mpool_base_registration_t*) frag->vapi_reg);
|
||||
MCA_BTL_IB_FRAG_RETURN_FRAG(btl, frag);
|
||||
} else if(frag->size == mca_btl_mvapi_component.max_send_size){
|
||||
MCA_BTL_IB_FRAG_RETURN_MAX(btl, frag);
|
||||
} else if(frag->size == mca_btl_mvapi_component.eager_limit){
|
||||
MCA_BTL_IB_FRAG_RETURN_EAGER(btl, frag);
|
||||
} else {
|
||||
BTL_ERROR(("invalid descriptor"));
|
||||
}
|
||||
MCA_BTL_IB_FRAG_RETURN(btl, frag);
|
||||
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
@ -350,7 +341,7 @@ mca_btl_base_descriptor_t* mca_btl_mvapi_prepare_src(
|
||||
(mca_mpool_base_registration_t**) &vapi_reg);
|
||||
if(OMPI_SUCCESS != rc || NULL == vapi_reg) {
|
||||
BTL_ERROR(("mpool_register(%p,%lu) failed", iov.iov_base, max_data));
|
||||
MCA_BTL_IB_FRAG_RETURN_FRAG(btl, frag);
|
||||
MCA_BTL_IB_FRAG_RETURN(btl, frag);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -384,7 +375,7 @@ mca_btl_base_descriptor_t* mca_btl_mvapi_prepare_src(
|
||||
rc = ompi_convertor_pack(convertor, &iov, &iov_count, &max_data, &free_after);
|
||||
*size = max_data;
|
||||
if( rc < 0 ) {
|
||||
MCA_BTL_IB_FRAG_RETURN_EAGER(btl, frag);
|
||||
MCA_BTL_IB_FRAG_RETURN(btl, frag);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -414,7 +405,7 @@ mca_btl_base_descriptor_t* mca_btl_mvapi_prepare_src(
|
||||
*size = max_data;
|
||||
|
||||
if( rc < 0 ) {
|
||||
MCA_BTL_IB_FRAG_RETURN_MAX(btl, frag);
|
||||
MCA_BTL_IB_FRAG_RETURN(btl, frag);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -495,7 +486,7 @@ mca_btl_base_descriptor_t* mca_btl_mvapi_prepare_dst(
|
||||
if(OMPI_SUCCESS != rc || NULL == vapi_reg) {
|
||||
BTL_ERROR(("mpool_register(%p,%lu) failed: base %p lb %lu offset %lu",
|
||||
frag->segment.seg_addr.pval, *size, convertor->pBaseBuf, lb, convertor->bConverted));
|
||||
MCA_BTL_IB_FRAG_RETURN_FRAG(btl, frag);
|
||||
MCA_BTL_IB_FRAG_RETURN(btl, frag);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
@ -1042,7 +1042,8 @@ static void mca_btl_mvapi_endpoint_credits_lp(
|
||||
mca_btl_mvapi_endpoint_send_credits_lp(endpoint);
|
||||
}
|
||||
}
|
||||
MCA_BTL_IB_FRAG_RETURN_EAGER((mca_btl_mvapi_module_t*)btl, (mca_btl_mvapi_frag_t*)descriptor);
|
||||
MCA_BTL_IB_FRAG_RETURN(((mca_btl_mvapi_module_t*)btl),
|
||||
((mca_btl_mvapi_frag_t*)descriptor));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1084,7 +1085,7 @@ void mca_btl_mvapi_endpoint_send_credits_lp(
|
||||
if(ret != VAPI_SUCCESS) {
|
||||
OPAL_THREAD_ADD32(&endpoint->sd_credits_lp, -1);
|
||||
OPAL_THREAD_ADD32(&endpoint->rd_credits_lp, frag->hdr->credits);
|
||||
MCA_BTL_IB_FRAG_RETURN_EAGER(mvapi_btl, frag);
|
||||
MCA_BTL_IB_FRAG_RETURN(mvapi_btl, frag);
|
||||
BTL_ERROR(("error posting send request errno %d says %s", strerror(errno)));
|
||||
return;
|
||||
}
|
||||
@ -1115,7 +1116,8 @@ static void mca_btl_mvapi_endpoint_credits_hp(
|
||||
mca_btl_mvapi_endpoint_send_credits_hp(endpoint);
|
||||
}
|
||||
}
|
||||
MCA_BTL_IB_FRAG_RETURN_EAGER((mca_btl_mvapi_module_t*)btl, (mca_btl_mvapi_frag_t*)descriptor);
|
||||
MCA_BTL_IB_FRAG_RETURN(((mca_btl_mvapi_module_t*)btl),
|
||||
((mca_btl_mvapi_frag_t*)descriptor));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1162,7 +1164,7 @@ void mca_btl_mvapi_endpoint_send_credits_hp(
|
||||
if(ret != VAPI_SUCCESS) {
|
||||
OPAL_THREAD_ADD32(&endpoint->sd_credits_lp, -1);
|
||||
OPAL_THREAD_ADD32(&endpoint->rd_credits_lp, frag->hdr->credits);
|
||||
MCA_BTL_IB_FRAG_RETURN_EAGER(mvapi_btl, frag);
|
||||
MCA_BTL_IB_FRAG_RETURN(mvapi_btl, frag);
|
||||
BTL_ERROR(("error posting send request errno %d says %s", strerror(errno)));
|
||||
return;
|
||||
}
|
||||
@ -1174,8 +1176,8 @@ static void mca_btl_mvapi_endpoint_eager_rdma(
|
||||
struct mca_btl_base_descriptor_t* descriptor,
|
||||
int status)
|
||||
{
|
||||
MCA_BTL_IB_FRAG_RETURN_EAGER((mca_btl_mvapi_module_t*)btl,
|
||||
(mca_btl_mvapi_frag_t*)descriptor);
|
||||
MCA_BTL_IB_FRAG_RETURN(((mca_btl_mvapi_module_t*)btl),
|
||||
((mca_btl_mvapi_frag_t*)descriptor));
|
||||
}
|
||||
|
||||
static int mca_btl_mvapi_endpoint_send_eager_rdma(
|
||||
@ -1205,7 +1207,7 @@ static int mca_btl_mvapi_endpoint_send_eager_rdma(
|
||||
frag->segment.seg_len = sizeof(mca_btl_mvapi_eager_rdma_header_t);
|
||||
if (mca_btl_mvapi_endpoint_post_send(mvapi_btl, endpoint, frag) !=
|
||||
OMPI_SUCCESS) {
|
||||
MCA_BTL_IB_FRAG_RETURN_EAGER(mvapi_btl, frag);
|
||||
MCA_BTL_IB_FRAG_RETURN(mvapi_btl, frag);
|
||||
BTL_ERROR(("Error sending RDMA buffer", strerror(errno)));
|
||||
return -1;
|
||||
}
|
||||
|
@ -97,6 +97,7 @@ struct mca_btl_mvapi_frag_t {
|
||||
mca_btl_mvapi_header_t *hdr;
|
||||
mca_btl_mvapi_footer_t *ftr;
|
||||
mca_mpool_mvapi_registration_t * vapi_reg;
|
||||
ompi_free_list_t* my_list;
|
||||
};
|
||||
typedef struct mca_btl_mvapi_frag_t mca_btl_mvapi_frag_t;
|
||||
OBJ_CLASS_DECLARATION(mca_btl_mvapi_frag_t);
|
||||
@ -136,39 +137,31 @@ OBJ_CLASS_DECLARATION(mca_btl_mvapi_recv_frag_max_t);
|
||||
opal_list_item_t *item; \
|
||||
OMPI_FREE_LIST_WAIT(&((mca_btl_mvapi_module_t*)btl)->send_free_eager, item, rc); \
|
||||
frag = (mca_btl_mvapi_frag_t*) item; \
|
||||
frag->my_list = &((mca_btl_mvapi_module_t*)btl)->send_free_eager; \
|
||||
}
|
||||
|
||||
#define MCA_BTL_IB_FRAG_RETURN_EAGER(btl, frag) \
|
||||
{ \
|
||||
OMPI_FREE_LIST_RETURN(&((mca_btl_mvapi_module_t*)btl)->send_free_eager, (opal_list_item_t*)(frag)); \
|
||||
}
|
||||
|
||||
|
||||
#define MCA_BTL_IB_FRAG_ALLOC_MAX(btl, frag, rc) \
|
||||
{ \
|
||||
\
|
||||
opal_list_item_t *item; \
|
||||
OMPI_FREE_LIST_WAIT(&((mca_btl_mvapi_module_t*)btl)->send_free_max, item, rc); \
|
||||
frag = (mca_btl_mvapi_frag_t*) item; \
|
||||
frag->my_list = &((mca_btl_mvapi_module_t*)btl)->send_free_max; \
|
||||
}
|
||||
|
||||
#define MCA_BTL_IB_FRAG_RETURN_MAX(btl, frag) \
|
||||
{ \
|
||||
OMPI_FREE_LIST_RETURN(&((mca_btl_mvapi_module_t*)btl)->send_free_max, (opal_list_item_t*)(frag)); \
|
||||
}
|
||||
|
||||
|
||||
#define MCA_BTL_IB_FRAG_ALLOC_FRAG(btl, frag, rc) \
|
||||
{ \
|
||||
\
|
||||
opal_list_item_t *item; \
|
||||
OMPI_FREE_LIST_WAIT(&((mca_btl_mvapi_module_t*)btl)->send_free_frag, item, rc); \
|
||||
frag = (mca_btl_mvapi_frag_t*) item; \
|
||||
frag->my_list = &((mca_btl_mvapi_module_t*)btl)->send_free_frag; \
|
||||
}
|
||||
|
||||
#define MCA_BTL_IB_FRAG_RETURN_FRAG(btl, frag) \
|
||||
{ \
|
||||
OMPI_FREE_LIST_RETURN(&((mca_btl_mvapi_module_t*)btl)->send_free_frag, (opal_list_item_t*)(frag)); \
|
||||
#define MCA_BTL_IB_FRAG_RETURN(btl, frag) \
|
||||
{ \
|
||||
OMPI_FREE_LIST_RETURN(frag->my_list, \
|
||||
(opal_list_item_t*)(frag)); \
|
||||
}
|
||||
|
||||
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user