1
1

carryover mvapi mpool changes to openib

This commit was SVN r6525.
Этот коммит содержится в:
Galen Shipman 2005-07-15 16:05:05 +00:00
родитель 723a7b56ef
Коммит 5af3cc8045
5 изменённых файлов: 20 добавлений и 21 удалений

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

@ -240,7 +240,7 @@ mca_btl_base_descriptor_t* mca_btl_openib_prepare_src(
if(NULL != openib_reg && 0 == ompi_convertor_need_buffers(convertor)){
bool is_leave_pinned = openib_reg->is_leave_pinned;
bool is_leave_pinned = openib_reg->base_reg.is_leave_pinned;
MCA_BTL_IB_FRAG_ALLOC_FRAG(btl, frag, rc);
if(NULL == frag){
return NULL;
@ -296,7 +296,7 @@ mca_btl_base_descriptor_t* mca_btl_openib_prepare_src(
OBJ_RETAIN(openib_reg);
if(is_leave_pinned) {
openib_reg->is_leave_pinned = is_leave_pinned;
openib_reg->base_reg.is_leave_pinned = is_leave_pinned;
opal_list_append(&openib_btl->reg_mru_list, (opal_list_item_t*) openib_reg);
}
}
@ -382,7 +382,7 @@ mca_btl_base_descriptor_t* mca_btl_openib_prepare_src(
return NULL;
OBJ_RETAIN(openib_reg);
openib_reg->is_leave_pinned = true;
openib_reg->base_reg.is_leave_pinned = true;
opal_list_append(&openib_btl->reg_mru_list, (opal_list_item_t*) openib_reg);
@ -392,7 +392,7 @@ mca_btl_base_descriptor_t* mca_btl_openib_prepare_src(
max_data,
(mca_mpool_base_registration_t**) &openib_reg);
openib_reg->is_leave_pinned = false;
openib_reg->base_reg.is_leave_pinned = false;
}
frag->mr = openib_reg->mr;
frag->sg_entry.length = max_data;
@ -508,7 +508,7 @@ mca_btl_base_descriptor_t* mca_btl_openib_prepare_dst(
if(NULL!= openib_reg){
reg_len = (unsigned char*)openib_reg->base_reg.bound - (unsigned char*)frag->segment.seg_addr.pval + 1;
bool is_leave_pinned = openib_reg->is_leave_pinned;
bool is_leave_pinned = openib_reg->base_reg.is_leave_pinned;
if(frag->segment.seg_len > reg_len ) {
size_t new_len = openib_reg->base_reg.bound - openib_reg->base_reg.base + 1
@ -548,7 +548,7 @@ mca_btl_base_descriptor_t* mca_btl_openib_prepare_dst(
OBJ_RETAIN(openib_reg);
if(is_leave_pinned) {
openib_reg->is_leave_pinned = is_leave_pinned;
openib_reg->base_reg.is_leave_pinned = is_leave_pinned;
opal_list_append(&openib_btl->reg_mru_list, (opal_list_item_t*) openib_reg);
}
@ -590,7 +590,7 @@ mca_btl_base_descriptor_t* mca_btl_openib_prepare_dst(
*size,
(mca_mpool_base_registration_t**) &openib_reg);
openib_reg->is_leave_pinned = true;
openib_reg->base_reg.is_leave_pinned = true;
rc = mca_mpool_base_insert(openib_reg->base_reg.base,
openib_reg->base_reg.bound - openib_reg->base_reg.base + 1,
@ -610,7 +610,7 @@ mca_btl_base_descriptor_t* mca_btl_openib_prepare_dst(
frag->segment.seg_addr.pval,
*size,
(mca_mpool_base_registration_t**) &openib_reg);
openib_reg->is_leave_pinned=false;
openib_reg->base_reg.is_leave_pinned=false;
}

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

@ -145,9 +145,7 @@ void* mca_mpool_mvapi_realloc(
size_t size,
mca_mpool_base_registration_t** registration)
{
mca_mpool_mvapi_module_t* mpool_mvapi = (mca_mpool_mvapi_module_t*)mpool;
mca_mpool_base_registration_t* old_reg = *registration;
void* new_mem = mpool->mpool_alloc(mpool, size, 0, registration);
memcpy(new_mem, addr, old_reg->bound - old_reg->base);
mpool->mpool_free(mpool, addr, &old_reg);
@ -161,8 +159,7 @@ void mca_mpool_mvapi_free(mca_mpool_base_module_t* mpool, void * addr,
mca_mpool_base_registration_t* registration)
{
mca_mpool_mvapi_module_t* mpool_mvapi = (mca_mpool_mvapi_module_t*)mpool;
mpool_mvapi->super.mpool_deregister(mpool, addr, 0, registration);
mpool->mpool_deregister(mpool, addr, 0, registration);
free(registration->alloc_base);

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

@ -67,8 +67,7 @@ struct mca_mpool_openib_module_t {
struct mca_mpool_openib_registration_t {
mca_mpool_base_registration_t base_reg;
struct ibv_mr *mr;
bool is_leave_pinned;
};
typedef struct mca_mpool_openib_registration_t mca_mpool_openib_registration_t;
OMPI_DECLSPEC OBJ_CLASS_DECLARATION(mca_mpool_openib_registration_t);

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

@ -65,7 +65,7 @@ mca_mpool_openib_component_t mca_mpool_openib_component = {
static void mca_mpool_openib_registration_constructor( mca_mpool_openib_registration_t * registration )
{
registration->is_leave_pinned = false;
registration->base_reg.is_leave_pinned = false;
}
static void mca_mpool_openib_registration_destructor( mca_mpool_openib_registration_t * registration )
@ -79,7 +79,7 @@ static void mca_mpool_openib_registration_destructor( mca_mpool_openib_registrat
registration->base_reg.base = NULL;
registration->base_reg.bound = NULL;
registration->is_leave_pinned=false;
registration->base_reg.is_leave_pinned=false;
}

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

@ -123,8 +123,12 @@ void* mca_mpool_openib_realloc(
size_t size,
mca_mpool_base_registration_t** registration)
{
mca_mpool_openib_module_t* mpool_openib = (mca_mpool_openib_module_t*)mpool;
return mpool_openib->vapi_allocator->alc_realloc( mpool_openib->vapi_allocator, addr, size, registration);
mca_mpool_base_registration_t* old_reg = *registration;
void* new_mem = mpool->mpool_alloc(mpool, size, 0, registration);
memcpy(new_mem, addr, old_reg->bound - old_reg->base);
mpool->mpool_free(mpool, addr, &old_reg);
return new_mem;
}
/**
@ -134,9 +138,8 @@ void mca_mpool_openib_free(mca_mpool_base_module_t* mpool, void * addr,
mca_mpool_base_registration_t* registration)
{
mca_mpool_openib_module_t* mpool_openib = (mca_mpool_openib_module_t*)mpool;
mpool_openib->super.mpool_deregister(mpool, addr, 0, registration);
mpool_openib->vapi_allocator->alc_free(mpool_openib->vapi_allocator, addr);
mpool->mpool_deregister(mpool, addr, 0, registration);
free(registration->alloc_base);
}