Mostly cleanups - preprocessor fixes and removal of OPAL_OUTPUTs.
Also updated to match recent mpool_free changes. This commit was SVN r10273.
Этот коммит содержится в:
родитель
75176370ae
Коммит
9a92394bfd
@ -9,6 +9,8 @@
|
|||||||
* University of Stuttgart. All rights reserved.
|
* University of Stuttgart. All rights reserved.
|
||||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
|
* Copyright (c) 2006 Sandia National Laboratories. All rights
|
||||||
|
* reserved.
|
||||||
* $COPYRIGHT$
|
* $COPYRIGHT$
|
||||||
*
|
*
|
||||||
* Additional copyrights may follow
|
* Additional copyrights may follow
|
||||||
@ -99,7 +101,7 @@ static void mca_mpool_udapl_registration_constructor(mca_mpool_udapl_registratio
|
|||||||
|
|
||||||
static void mca_mpool_udapl_registration_destructor(mca_mpool_udapl_registration_t *registration)
|
static void mca_mpool_udapl_registration_destructor(mca_mpool_udapl_registration_t *registration)
|
||||||
{
|
{
|
||||||
#ifdef OMPI_ENABLE_DEBUG
|
#if OMPI_ENABLE_DEBUG
|
||||||
registration->base_reg.base = NULL;
|
registration->base_reg.base = NULL;
|
||||||
registration->base_reg.bound = NULL;
|
registration->base_reg.bound = NULL;
|
||||||
registration->base_reg.flags = 0;
|
registration->base_reg.flags = 0;
|
||||||
@ -117,7 +119,6 @@ OBJ_CLASS_INSTANCE(mca_mpool_udapl_registration_t,
|
|||||||
*/
|
*/
|
||||||
static int mca_mpool_udapl_open(void)
|
static int mca_mpool_udapl_open(void)
|
||||||
{
|
{
|
||||||
OPAL_OUTPUT((0, "mpool_udapl_open\n"));
|
|
||||||
return OMPI_SUCCESS;
|
return OMPI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -127,8 +128,6 @@ static mca_mpool_base_module_t* mca_mpool_udapl_init(
|
|||||||
{
|
{
|
||||||
mca_mpool_udapl_module_t* udapl_mpool;
|
mca_mpool_udapl_module_t* udapl_mpool;
|
||||||
|
|
||||||
OPAL_OUTPUT((0, "mpool_udapl_init\n"));
|
|
||||||
|
|
||||||
mca_base_param_reg_string(&mca_mpool_udapl_component.super.mpool_version,
|
mca_base_param_reg_string(&mca_mpool_udapl_component.super.mpool_version,
|
||||||
"rcache_name", "The name of the registration cache the mpool should use",
|
"rcache_name", "The name of the registration cache the mpool should use",
|
||||||
false, false, "rb", &(mca_mpool_udapl_component.rcache_name));
|
false, false, "rb", &(mca_mpool_udapl_component.rcache_name));
|
||||||
|
@ -9,6 +9,8 @@
|
|||||||
* University of Stuttgart. All rights reserved.
|
* University of Stuttgart. All rights reserved.
|
||||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
|
* Copyright (c) 2006 Sandia National Laboratories. All rights
|
||||||
|
* reserved.
|
||||||
* $COPYRIGHT$
|
* $COPYRIGHT$
|
||||||
*
|
*
|
||||||
* Additional copyrights may follow
|
* Additional copyrights may follow
|
||||||
@ -33,8 +35,6 @@ uint64_t mca_mpool_udapl_mem_registered;
|
|||||||
*/
|
*/
|
||||||
void mca_mpool_udapl_module_init(mca_mpool_udapl_module_t* mpool)
|
void mca_mpool_udapl_module_init(mca_mpool_udapl_module_t* mpool)
|
||||||
{
|
{
|
||||||
OPAL_OUTPUT((0, "mpool_udapl_module_init\n"));
|
|
||||||
|
|
||||||
mpool->super.mpool_component = &mca_mpool_udapl_component.super;
|
mpool->super.mpool_component = &mca_mpool_udapl_component.super;
|
||||||
mpool->super.mpool_base = NULL; /* no base .. */
|
mpool->super.mpool_base = NULL; /* no base .. */
|
||||||
mpool->super.mpool_alloc = mca_mpool_udapl_alloc;
|
mpool->super.mpool_alloc = mca_mpool_udapl_alloc;
|
||||||
@ -64,8 +64,6 @@ void* mca_mpool_udapl_alloc(
|
|||||||
mca_mpool_base_registration_t** registration)
|
mca_mpool_base_registration_t** registration)
|
||||||
{
|
{
|
||||||
void* addr = malloc(size+align);
|
void* addr = malloc(size+align);
|
||||||
|
|
||||||
/* TODO - align addr to dat_optimal_alignment */
|
|
||||||
if(NULL == addr)
|
if(NULL == addr)
|
||||||
return NULL;
|
return NULL;
|
||||||
if(OMPI_SUCCESS != mca_mpool_udapl_register(mpool,
|
if(OMPI_SUCCESS != mca_mpool_udapl_register(mpool,
|
||||||
@ -94,8 +92,6 @@ int mca_mpool_udapl_register(
|
|||||||
DAT_VADDR dat_addr;
|
DAT_VADDR dat_addr;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
OPAL_OUTPUT((0, "mpool_udapl_register\n"));
|
|
||||||
|
|
||||||
udapl_mpool = (mca_mpool_udapl_module_t*)mpool;
|
udapl_mpool = (mca_mpool_udapl_module_t*)mpool;
|
||||||
reg = OBJ_NEW(mca_mpool_udapl_registration_t);
|
reg = OBJ_NEW(mca_mpool_udapl_registration_t);
|
||||||
if(NULL == reg) {
|
if(NULL == reg) {
|
||||||
@ -108,7 +104,6 @@ int mca_mpool_udapl_register(
|
|||||||
reg->base_reg.bound = up_align_addr((void*)((unsigned long) addr + size -1),
|
reg->base_reg.bound = up_align_addr((void*)((unsigned long) addr + size -1),
|
||||||
mca_mpool_base_page_size_log);
|
mca_mpool_base_page_size_log);
|
||||||
|
|
||||||
|
|
||||||
region.for_va = addr;
|
region.for_va = addr;
|
||||||
reg->lmr_triplet.virtual_address = (DAT_VADDR)addr;
|
reg->lmr_triplet.virtual_address = (DAT_VADDR)addr;
|
||||||
reg->lmr_triplet.segment_length = size;
|
reg->lmr_triplet.segment_length = size;
|
||||||
@ -146,20 +141,12 @@ int mca_mpool_udapl_deregister(mca_mpool_base_module_t* mpool,
|
|||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
OPAL_OUTPUT((0, "mpool_udapl_deregister\n"));
|
|
||||||
|
|
||||||
if(reg->flags & (MCA_MPOOL_FLAGS_CACHE | MCA_MPOOL_FLAGS_PERSIST)) {
|
if(reg->flags & (MCA_MPOOL_FLAGS_CACHE | MCA_MPOOL_FLAGS_PERSIST)) {
|
||||||
mpool->rcache->rcache_delete(mpool->rcache,
|
mpool->rcache->rcache_delete(mpool->rcache, reg, reg->flags);
|
||||||
reg,
|
reg->flags = 0;
|
||||||
reg->flags);
|
|
||||||
}
|
}
|
||||||
if((rc = mca_mpool_udapl_release(mpool, reg)) != OMPI_SUCCESS) {
|
|
||||||
OPAL_OUTPUT((0, "[%s:%d] error(%d) deregistering udapl memory\n", __FILE__, __LINE__, rc));
|
|
||||||
assert(0);
|
|
||||||
return OMPI_ERR_OUT_OF_RESOURCE;
|
|
||||||
|
|
||||||
}
|
return mca_mpool_udapl_release(mpool, reg);
|
||||||
return OMPI_SUCCESS;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -171,15 +158,15 @@ void* mca_mpool_udapl_realloc(
|
|||||||
size_t size,
|
size_t size,
|
||||||
mca_mpool_base_registration_t** registration)
|
mca_mpool_base_registration_t** registration)
|
||||||
{
|
{
|
||||||
void *new_addr = mca_mpool_udapl_alloc(mpool,size,0, (*registration)->flags, registration);
|
mca_mpool_base_registration_t* old_reg = *registration;
|
||||||
|
void *new_addr = mca_mpool_udapl_alloc(mpool,
|
||||||
OPAL_OUTPUT((0, "mpool_udapl_realloc\n"));
|
size, 0, (*registration)->flags, registration);
|
||||||
|
|
||||||
if(new_addr == NULL) {
|
if(new_addr == NULL) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy(new_addr, addr, size);
|
memcpy(new_addr, addr, size);
|
||||||
mca_mpool_udapl_free(mpool,addr,*registration);
|
mca_mpool_udapl_free(mpool, addr, old_reg);
|
||||||
return new_addr;
|
return new_addr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -189,9 +176,7 @@ void* mca_mpool_udapl_realloc(
|
|||||||
void mca_mpool_udapl_free(mca_mpool_base_module_t* mpool, void * addr,
|
void mca_mpool_udapl_free(mca_mpool_base_module_t* mpool, void * addr,
|
||||||
mca_mpool_base_registration_t* registration)
|
mca_mpool_base_registration_t* registration)
|
||||||
{
|
{
|
||||||
if(registration){
|
|
||||||
mpool->mpool_deregister(mpool, registration);
|
mpool->mpool_deregister(mpool, registration);
|
||||||
}
|
|
||||||
free(addr);
|
free(addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -202,13 +187,7 @@ int mca_mpool_udapl_find(
|
|||||||
ompi_pointer_array_t *regs,
|
ompi_pointer_array_t *regs,
|
||||||
uint32_t* cnt)
|
uint32_t* cnt)
|
||||||
{
|
{
|
||||||
OPAL_OUTPUT((0, "mpool_udapl_find\n"));
|
return mpool->rcache->rcache_find(mpool->rcache, addr, size, regs, cnt);
|
||||||
|
|
||||||
return mpool->rcache->rcache_find(mpool->rcache,
|
|
||||||
addr,
|
|
||||||
size,
|
|
||||||
regs,
|
|
||||||
cnt);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int mca_mpool_udapl_release(
|
int mca_mpool_udapl_release(
|
||||||
@ -235,7 +214,6 @@ int mca_mpool_udapl_retain(
|
|||||||
struct mca_mpool_base_module_t* mpool,
|
struct mca_mpool_base_module_t* mpool,
|
||||||
mca_mpool_base_registration_t* registration)
|
mca_mpool_base_registration_t* registration)
|
||||||
{
|
{
|
||||||
OPAL_OUTPUT((0, "mpool_udapl_retain\n"));
|
|
||||||
OPAL_THREAD_ADD32(®istration->ref_count, 1);
|
OPAL_THREAD_ADD32(®istration->ref_count, 1);
|
||||||
return OMPI_SUCCESS;
|
return OMPI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user