From e0b265885d10e0d893563ee08f2bd21b75488857 Mon Sep 17 00:00:00 2001 From: Galen Shipman Date: Thu, 23 Jun 2005 15:53:51 +0000 Subject: [PATCH] - Modified the mpool interface to use mca_mpool_base_registration_t instead of -mca_bmi_base_registration_t - Also corrected a bug in mca_common_sm_mmap_seg_alloc where a unitialized -pointer was dereferenced - Misc other changes. This commit was SVN r6145. --- src/class/ompi_free_list.c | 2 +- src/class/ompi_rb_tree.c | 21 +++++++ src/mca/allocator/allocator.h | 10 +-- src/mca/allocator/basic/allocator_basic.c | 4 +- src/mca/allocator/basic/allocator_basic.h | 4 +- src/mca/allocator/bucket/allocator_bucket.c | 4 +- .../allocator/bucket/allocator_bucket_alloc.c | 6 +- .../allocator/bucket/allocator_bucket_alloc.h | 6 +- src/mca/bmi/bmi.h | 6 +- src/mca/bmi/ib/bmi_ib.c | 39 ++++++++---- src/mca/bmi/ib/bmi_ib.h | 4 +- src/mca/bmi/ib/bmi_ib_component.c | 2 +- src/mca/bmi/ib/bmi_ib_frag.c | 2 +- src/mca/bmi/self/bmi_self.c | 4 +- src/mca/bmi/self/bmi_self.h | 4 +- src/mca/bmi/sm/bmi_sm.c | 2 +- src/mca/bmi/sm/bmi_sm.h | 2 +- src/mca/common/sm/common_sm_mmap.c | 3 +- src/mca/common/sm/common_sm_mmap.h | 4 +- src/mca/common/vapi/vapi_mem_reg.h | 8 +-- src/mca/mpool/base/base.h | 18 +++--- src/mca/mpool/base/mpool_base_alloc.c | 61 +++++++++++++++---- src/mca/mpool/base/mpool_base_lookup.c | 8 +-- src/mca/mpool/mpool.h | 24 ++++---- src/mca/mpool/sm/mpool_sm.h | 6 +- src/mca/mpool/sm/mpool_sm_component.c | 6 +- src/mca/mpool/sm/mpool_sm_module.c | 6 +- src/mca/mpool/vapi/mpool_vapi.h | 14 ++--- src/mca/mpool/vapi/mpool_vapi_component.c | 8 +-- src/mca/mpool/vapi/mpool_vapi_module.c | 18 +++--- src/mca/pml/base/pml_base_bsend.c | 2 +- src/mca/pml/ob1/pml_ob1_recvreq.c | 6 +- src/mca/pml/ob1/pml_ob1_sendreq.c | 6 +- 33 files changed, 191 insertions(+), 129 deletions(-) diff --git a/src/class/ompi_free_list.c b/src/class/ompi_free_list.c index 6b8b499f42..f04d06c0c0 100644 --- a/src/class/ompi_free_list.c +++ b/src/class/ompi_free_list.c @@ -75,7 +75,7 @@ int ompi_free_list_grow(ompi_free_list_t* flist, size_t num_elements) unsigned char* ptr; size_t i; size_t mod; - struct mca_bmi_base_registration_t* user_out; + struct mca_mpool_base_registration_t* user_out; if (flist->fl_max_to_alloc > 0 && flist->fl_num_allocated + num_elements > flist->fl_max_to_alloc) return OMPI_ERR_TEMP_OUT_OF_RESOURCE; diff --git a/src/class/ompi_rb_tree.c b/src/class/ompi_rb_tree.c index 966b517af8..76572c5381 100644 --- a/src/class/ompi_rb_tree.c +++ b/src/class/ompi_rb_tree.c @@ -188,6 +188,27 @@ void * ompi_rb_tree_find(ompi_rb_tree_t *tree, void *key) return(NULL); } +/* Finds the node in the tree based on the key */ +void * ompi_rb_tree_find_with_cmp(ompi_rb_tree_t *tree, + void *key, + ompi_rb_tree_comp_fn_t* comp) +{ + ompi_rb_tree_node_t * node; + int compvalue; + + node = tree->root_ptr->left; + while (node != tree->nill) { + compvalue = (*comp)(key, node->key); + /* if the result of the comparison function is 0, we found it */ + if (compvalue == 0) { + return(node->value); + } + /* else if it is less than 0, go left, else right */ + (compvalue < 0) ? (node = node->left) : (node = node->right); + } + /* if we didn't find anything, return NULL */ + return(NULL); +} /* Finds the node in the tree based on the key and returns a pointer * to the node. This is a bit a code duplication, but this has to be fast * so we go ahead with the duplication */ diff --git a/src/mca/allocator/allocator.h b/src/mca/allocator/allocator.h index e247fe340b..978705d7ce 100644 --- a/src/mca/allocator/allocator.h +++ b/src/mca/allocator/allocator.h @@ -21,8 +21,8 @@ #define MCA_ALLOCATOR_H #include "mca/mca.h" -struct mca_bmi_base_registration_t; -struct mca_bmi_base_resources_t; +struct mca_mpool_base_registration_t; +struct mca_mpool_base_resources_t; #if defined(c_plusplus) || defined(__cplusplus) @@ -38,7 +38,7 @@ typedef void* (*mca_allocator_base_module_alloc_fn_t)( struct mca_allocator_base_module_t*, size_t size, size_t align, - struct mca_bmi_base_registration_t** registration); + struct mca_mpool_base_registration_t** registration); /** * The realloc function typedef @@ -46,7 +46,7 @@ typedef void* (*mca_allocator_base_module_alloc_fn_t)( typedef void* (*mca_allocator_base_module_realloc_fn_t)( struct mca_allocator_base_module_t*, void*, size_t, - struct mca_bmi_base_registration_t** registration); + struct mca_mpool_base_registration_t** registration); /** * Free function typedef @@ -103,7 +103,7 @@ typedef struct mca_allocator_base_module_t mca_allocator_base_module_t; typedef void* (*mca_allocator_base_component_segment_alloc_fn_t)( struct mca_mpool_base_module_t* module, size_t* size, - struct mca_bmi_base_registration_t** registration); + struct mca_mpool_base_registration_t** registration); /** * A function to free memory from the control of the allocator framework diff --git a/src/mca/allocator/basic/allocator_basic.c b/src/mca/allocator/basic/allocator_basic.c index 055b4a3722..fd919882fc 100644 --- a/src/mca/allocator/basic/allocator_basic.c +++ b/src/mca/allocator/basic/allocator_basic.c @@ -161,7 +161,7 @@ void *mca_allocator_basic_alloc( mca_allocator_base_module_t * base, size_t size, size_t align, - struct mca_bmi_base_registration_t** registration) + struct mca_mpool_base_registration_t** registration) { mca_allocator_basic_module_t* module = (mca_allocator_basic_module_t*)base; mca_allocator_basic_segment_t* seg; @@ -241,7 +241,7 @@ void * mca_allocator_basic_realloc( mca_allocator_base_module_t * base, void * ptr, size_t size, - struct mca_bmi_base_registration_t** registration) + struct mca_mpool_base_registration_t** registration) { unsigned char* addr = ((unsigned char*)ptr) - sizeof(size_t); size_t alloc_size = *(size_t*)addr; diff --git a/src/mca/allocator/basic/allocator_basic.h b/src/mca/allocator/basic/allocator_basic.h index e111875be0..975503d7c4 100644 --- a/src/mca/allocator/basic/allocator_basic.h +++ b/src/mca/allocator/basic/allocator_basic.h @@ -92,7 +92,7 @@ mca_allocator_base_module_t* mca_allocator_basic_component_init( mca_allocator_base_module_t * mem, size_t size, size_t align, - struct mca_bmi_base_registration_t** registration); + struct mca_mpool_base_registration_t** registration); /** * Attempts to resize the passed region of memory into a larger or a smaller @@ -112,7 +112,7 @@ mca_allocator_base_module_t* mca_allocator_basic_component_init( mca_allocator_base_module_t * mem, void * ptr, size_t size, - struct mca_bmi_base_registration_t** registration); + struct mca_mpool_base_registration_t** registration); /** * Frees the passed region of memory diff --git a/src/mca/allocator/bucket/allocator_bucket.c b/src/mca/allocator/bucket/allocator_bucket.c index 3c2db95cac..290f5c2d05 100644 --- a/src/mca/allocator/bucket/allocator_bucket.c +++ b/src/mca/allocator/bucket/allocator_bucket.c @@ -34,7 +34,7 @@ int mca_allocator_bucket_module_close(void); void * mca_allocator_bucket_alloc_wrapper( struct mca_allocator_base_module_t* allocator, size_t size, size_t align, - struct mca_bmi_base_registration_t** registration); + struct mca_mpool_base_registration_t** registration); static int mca_allocator_num_buckets; @@ -91,7 +91,7 @@ void * mca_allocator_bucket_alloc_wrapper( struct mca_allocator_base_module_t* allocator, size_t size, size_t align, - struct mca_bmi_base_registration_t** registration) + struct mca_mpool_base_registration_t** registration) { if(0 == align){ return(mca_allocator_bucket_alloc(allocator, size, registration)); diff --git a/src/mca/allocator/bucket/allocator_bucket_alloc.c b/src/mca/allocator/bucket/allocator_bucket_alloc.c index 52354bbc26..cfdb22d7bb 100644 --- a/src/mca/allocator/bucket/allocator_bucket_alloc.c +++ b/src/mca/allocator/bucket/allocator_bucket_alloc.c @@ -71,7 +71,7 @@ mca_allocator_bucket_t * mca_allocator_bucket_init( void * mca_allocator_bucket_alloc( mca_allocator_base_module_t * mem, size_t size, - struct mca_bmi_base_registration_t** registration) + struct mca_mpool_base_registration_t** registration) { mca_allocator_bucket_t * mem_options = (mca_allocator_bucket_t *) mem; /* initialize for the later bit shifts */ @@ -154,7 +154,7 @@ void * mca_allocator_bucket_alloc_align( mca_allocator_base_module_t * mem, size_t size, size_t alignment, - struct mca_bmi_base_registration_t** registration) + struct mca_mpool_base_registration_t** registration) { mca_allocator_bucket_t * mem_options = (mca_allocator_bucket_t *) mem; int bucket_num = 1; @@ -237,7 +237,7 @@ void * mca_allocator_bucket_realloc( mca_allocator_base_module_t * mem, void * ptr, size_t size, - struct mca_bmi_base_registration_t** registration) + struct mca_mpool_base_registration_t** registration) { mca_allocator_bucket_t * mem_options = (mca_allocator_bucket_t *) mem; /* initialize for later bit shifts */ diff --git a/src/mca/allocator/bucket/allocator_bucket_alloc.h b/src/mca/allocator/bucket/allocator_bucket_alloc.h index 0737935e97..6e65a28231 100644 --- a/src/mca/allocator/bucket/allocator_bucket_alloc.h +++ b/src/mca/allocator/bucket/allocator_bucket_alloc.h @@ -125,7 +125,7 @@ typedef struct mca_allocator_bucket_t mca_allocator_bucket_t; void * mca_allocator_bucket_alloc( mca_allocator_base_module_t * mem, size_t size, - struct mca_bmi_base_registration_t** registration); + struct mca_mpool_base_registration_t** registration); /** * Accepts a request for memory in a specific region defined by the @@ -146,7 +146,7 @@ typedef struct mca_allocator_bucket_t mca_allocator_bucket_t; mca_allocator_base_module_t * mem, size_t size, size_t alignment, - struct mca_bmi_base_registration_t** registration); + struct mca_mpool_base_registration_t** registration); /** * Attempts to resize the passed region of memory into a larger or a smaller @@ -166,7 +166,7 @@ typedef struct mca_allocator_bucket_t mca_allocator_bucket_t; mca_allocator_base_module_t * mem, void * ptr, size_t size, - struct mca_bmi_base_registration_t** registration); + struct mca_mpool_base_registration_t** registration); /** * Frees the passed region of memory diff --git a/src/mca/bmi/bmi.h b/src/mca/bmi/bmi.h index e7b322a7a0..855b0834da 100644 --- a/src/mca/bmi/bmi.h +++ b/src/mca/bmi/bmi.h @@ -119,8 +119,8 @@ struct mca_bmi_base_module_t; struct mca_bmi_base_endpoint_t; struct mca_bmi_base_descriptor_t; -struct mca_bmi_base_registration_t; -struct mca_bmi_base_resources_t; +struct mca_mpool_base_registration_t; +struct mca_mpool_base_resources_t; /* send/recv operations require tag matching */ @@ -410,7 +410,7 @@ typedef int (*mca_bmi_base_module_free_fn_t)( typedef struct mca_bmi_base_descriptor_t* (*mca_bmi_base_module_prepare_fn_t)( struct mca_bmi_base_module_t* bmi, struct mca_bmi_base_endpoint_t* endpoint, - struct mca_bmi_base_registration_t* registration, + struct mca_mpool_base_registration_t* registration, struct ompi_convertor_t* convertor, size_t reserve, size_t* size diff --git a/src/mca/bmi/ib/bmi_ib.c b/src/mca/bmi/ib/bmi_ib.c index dde30ea7f2..a959a8ff96 100644 --- a/src/mca/bmi/ib/bmi_ib.c +++ b/src/mca/bmi/ib/bmi_ib.c @@ -58,6 +58,8 @@ mca_bmi_ib_module_t mca_bmi_ib_module = { } }; + + int mca_bmi_ib_add_procs( struct mca_bmi_base_module_t* bmi, size_t nprocs, @@ -221,7 +223,7 @@ int mca_bmi_ib_free( mca_bmi_base_descriptor_t* mca_bmi_ib_prepare_src( struct mca_bmi_base_module_t* bmi, struct mca_bmi_base_endpoint_t* endpoint, - struct mca_bmi_base_registration_t* registration, + struct mca_mpool_base_registration_t* registration, struct ompi_convertor_t* convertor, size_t reserve, size_t* size @@ -330,10 +332,16 @@ mca_bmi_base_descriptor_t* mca_bmi_ib_prepare_src( reg_len = (unsigned char*)registration->bound - (unsigned char*)iov.iov_base + 1; if(frag->segment.seg_len > reg_len) { - frag->ret = VAPI_deregister_mr( - ib_bmi->nic, - registration->hndl - ); + ib_bmi->ib_pool->mpool_deregister( + ib_bmi->ib_pool, + registration->base, + 0, + registration); + + /* frag->ret = VAPI_deregister_mr( */ +/* ib_bmi->nic, */ +/* registration->hndl */ +/* ); */ mca_mpool_base_remove((void*) registration->base); @@ -355,7 +363,7 @@ mca_bmi_base_descriptor_t* mca_bmi_ib_prepare_src( rc = mca_mpool_base_insert(iov.iov_base, iov.iov_len, ib_bmi->ib_pool, - &ib_bmi->super, + (void*) (&ib_bmi->super), registration); if(rc != OMPI_SUCCESS) return NULL; @@ -391,7 +399,7 @@ mca_bmi_base_descriptor_t* mca_bmi_ib_prepare_src( mca_bmi_base_descriptor_t* mca_bmi_ib_prepare_dst( struct mca_bmi_base_module_t* bmi, struct mca_bmi_base_endpoint_t* endpoint, - struct mca_bmi_base_registration_t* registration, + struct mca_mpool_base_registration_t* registration, struct ompi_convertor_t* convertor, size_t reserve, size_t* size) @@ -414,11 +422,16 @@ mca_bmi_base_descriptor_t* mca_bmi_ib_prepare_dst( frag->segment.seg_addr.pval = convertor->pBaseBuf + convertor->bConverted; if(NULL!= registration){ if(frag->segment.seg_len > reg_len) { - - frag->ret = VAPI_deregister_mr( - ib_bmi->nic, - registration->hndl - ); + ib_bmi->ib_pool->mpool_deregister( + ib_bmi->ib_pool, + registration->base, + 0, + registration); + +/* frag->ret = VAPI_deregister_mr( */ +/* ib_bmi->nic, */ +/* registration->hndl */ +/* ); */ mca_mpool_base_remove((void*) registration->base); @@ -440,7 +453,7 @@ mca_bmi_base_descriptor_t* mca_bmi_ib_prepare_dst( rc = mca_mpool_base_insert(frag->segment.seg_addr.pval, *size, ib_bmi->ib_pool, - &ib_bmi->super, + (void*) (&ib_bmi->super), (void*) registration); if(rc != OMPI_SUCCESS) return NULL; diff --git a/src/mca/bmi/ib/bmi_ib.h b/src/mca/bmi/ib/bmi_ib.h index 75a9a1e654..a5a807d545 100644 --- a/src/mca/bmi/ib/bmi_ib.h +++ b/src/mca/bmi/ib/bmi_ib.h @@ -343,7 +343,7 @@ extern int mca_bmi_ib_free( mca_bmi_base_descriptor_t* mca_bmi_ib_prepare_src( struct mca_bmi_base_module_t* bmi, struct mca_bmi_base_endpoint_t* peer, - struct mca_bmi_base_registration_t* registration, + struct mca_mpool_base_registration_t* registration, struct ompi_convertor_t* convertor, size_t reserve, size_t* size @@ -359,7 +359,7 @@ mca_bmi_base_descriptor_t* mca_bmi_ib_prepare_src( extern mca_bmi_base_descriptor_t* mca_bmi_ib_prepare_dst( struct mca_bmi_base_module_t* bmi, struct mca_bmi_base_endpoint_t* peer, - struct mca_bmi_base_registration_t* registration, + struct mca_mpool_base_registration_t* registration, struct ompi_convertor_t* convertor, size_t reserve, size_t* size); diff --git a/src/mca/bmi/ib/bmi_ib_component.c b/src/mca/bmi/ib/bmi_ib_component.c index a98cfd615d..aa513d17c9 100644 --- a/src/mca/bmi/ib/bmi_ib_component.c +++ b/src/mca/bmi/ib/bmi_ib_component.c @@ -242,7 +242,7 @@ mca_bmi_base_module_t** mca_bmi_ib_component_init(int *num_bmi_modules, uint32_t num_hcas; mca_bmi_base_module_t** bmis; uint32_t i,j, length; - mca_bmi_base_resources_t hca_pd; + mca_mpool_base_resources_t hca_pd; ompi_list_t bmi_list; mca_bmi_ib_module_t * ib_bmi; mca_bmi_base_selected_module_t* ib_selected; diff --git a/src/mca/bmi/ib/bmi_ib_frag.c b/src/mca/bmi/ib/bmi_ib_frag.c index 6042cb7ced..ee194dd2ce 100644 --- a/src/mca/bmi/ib/bmi_ib_frag.c +++ b/src/mca/bmi/ib/bmi_ib_frag.c @@ -6,7 +6,7 @@ static void mca_bmi_ib_frag_common_constructor( mca_bmi_ib_frag_t* frag) { - mca_bmi_base_registration_t* mem_hndl = frag->base.super.user_data; + mca_mpool_base_registration_t* mem_hndl = frag->base.super.user_data; frag->hdr = (mca_bmi_ib_header_t*) (frag+1); /* initialize the bmi header to point to start at end of frag */ #if 0 mod = (unsigned long) frag->hdr % MCA_BMI_IB_FRAG_ALIGN; diff --git a/src/mca/bmi/self/bmi_self.c b/src/mca/bmi/self/bmi_self.c index 5cdf4e346f..d3762eecfb 100644 --- a/src/mca/bmi/self/bmi_self.c +++ b/src/mca/bmi/self/bmi_self.c @@ -186,7 +186,7 @@ extern int mca_bmi_self_free( struct mca_bmi_base_descriptor_t* mca_bmi_self_prepare_src( struct mca_bmi_base_module_t* bmi, struct mca_bmi_base_endpoint_t* endpoint, - struct mca_bmi_base_registration_t* registration, + struct mca_mpool_base_registration_t* registration, struct ompi_convertor_t* convertor, size_t reserve, size_t* size) @@ -252,7 +252,7 @@ struct mca_bmi_base_descriptor_t* mca_bmi_self_prepare_src( struct mca_bmi_base_descriptor_t* mca_bmi_self_prepare_dst( struct mca_bmi_base_module_t* bmi, struct mca_bmi_base_endpoint_t* endpoint, - struct mca_bmi_base_registration_t* registration, + struct mca_mpool_base_registration_t* registration, struct ompi_convertor_t* convertor, size_t reserve, size_t* size) diff --git a/src/mca/bmi/self/bmi_self.h b/src/mca/bmi/self/bmi_self.h index 729962b770..28980f03c3 100644 --- a/src/mca/bmi/self/bmi_self.h +++ b/src/mca/bmi/self/bmi_self.h @@ -206,7 +206,7 @@ extern int mca_bmi_self_free( struct mca_bmi_base_descriptor_t* mca_bmi_self_prepare_src( struct mca_bmi_base_module_t* bmi, struct mca_bmi_base_endpoint_t* endpoint, - struct mca_bmi_base_registration_t* registration, + struct mca_mpool_base_registration_t* registration, struct ompi_convertor_t* convertor, size_t reserve, size_t* size @@ -221,7 +221,7 @@ struct mca_bmi_base_descriptor_t* mca_bmi_self_prepare_src( struct mca_bmi_base_descriptor_t* mca_bmi_self_prepare_dst( struct mca_bmi_base_module_t* bmi, struct mca_bmi_base_endpoint_t* endpoint, - struct mca_bmi_base_registration_t* registration, + struct mca_mpool_base_registration_t* registration, struct ompi_convertor_t* convertor, size_t reserve, size_t* size diff --git a/src/mca/bmi/sm/bmi_sm.c b/src/mca/bmi/sm/bmi_sm.c index dfd4123de6..b3c0d6bf22 100644 --- a/src/mca/bmi/sm/bmi_sm.c +++ b/src/mca/bmi/sm/bmi_sm.c @@ -776,7 +776,7 @@ extern int mca_bmi_sm_free( struct mca_bmi_base_descriptor_t* mca_bmi_sm_prepare_src( struct mca_bmi_base_module_t* bmi, struct mca_bmi_base_endpoint_t* endpoint, - struct mca_bmi_base_registration_t* registration, + struct mca_mpool_base_registration_t* registration, struct ompi_convertor_t* convertor, size_t reserve, size_t* size) diff --git a/src/mca/bmi/sm/bmi_sm.h b/src/mca/bmi/sm/bmi_sm.h index 1fecd7d5cb..3c50615ca6 100644 --- a/src/mca/bmi/sm/bmi_sm.h +++ b/src/mca/bmi/sm/bmi_sm.h @@ -300,7 +300,7 @@ extern int mca_bmi_sm_free( struct mca_bmi_base_descriptor_t* mca_bmi_sm_prepare_src( struct mca_bmi_base_module_t* bmi, struct mca_bmi_base_endpoint_t* endpoint, - struct mca_bmi_base_registration_t* registration, + struct mca_mpool_base_registration_t* registration, struct ompi_convertor_t* convertor, size_t reserve, size_t* size diff --git a/src/mca/common/sm/common_sm_mmap.c b/src/mca/common/sm/common_sm_mmap.c index 1bd50a9ab1..12ca544346 100644 --- a/src/mca/common/sm/common_sm_mmap.c +++ b/src/mca/common/sm/common_sm_mmap.c @@ -216,7 +216,7 @@ mca_common_sm_mmap_t* mca_common_sm_mmap_init(size_t size, char *file_name, void* mca_common_sm_mmap_seg_alloc( struct mca_mpool_base_module_t* mpool, size_t* size, - struct mca_bmi_base_registration_t** registration) + struct mca_mpool_base_registration_t** registration) { mca_common_sm_mmap_t* map = mca_common_sm_mmap; mca_common_sm_file_header_t* seg = map->map_seg; @@ -230,7 +230,6 @@ void* mca_common_sm_mmap_seg_alloc( addr = map->data_addr + seg->seg_offset; seg->seg_offset += *size; } - *registration = NULL; ompi_atomic_unlock(&seg->seg_lock); return addr; } diff --git a/src/mca/common/sm/common_sm_mmap.h b/src/mca/common/sm/common_sm_mmap.h index 1727585e0e..a4590b9483 100644 --- a/src/mca/common/sm/common_sm_mmap.h +++ b/src/mca/common/sm/common_sm_mmap.h @@ -27,7 +27,7 @@ extern "C" { #endif struct mca_mpool_base_module_t; -struct mca_bmi_base_registration_t; +struct mca_mpool_base_registration_t; struct mca_common_sm_file_header_t { @@ -99,7 +99,7 @@ extern mca_common_sm_mmap_t* mca_common_sm_mmap_init( extern void* mca_common_sm_mmap_seg_alloc( struct mca_mpool_base_module_t* mpool, size_t* size, - struct mca_bmi_base_registration_t** registration); + struct mca_mpool_base_registration_t** registration); /* * Instance that is shared between components that use shared memory diff --git a/src/mca/common/vapi/vapi_mem_reg.h b/src/mca/common/vapi/vapi_mem_reg.h index 809b27cacb..67234ca1f4 100644 --- a/src/mca/common/vapi/vapi_mem_reg.h +++ b/src/mca/common/vapi/vapi_mem_reg.h @@ -27,14 +27,14 @@ extern "C" { #endif -struct mca_bmi_base_resources_t { +struct mca_mpool_base_resources_t { VAPI_hca_hndl_t hca; /* the hca (nic) */ VAPI_pd_hndl_t pd_tag; /* the protection domain */ }; -typedef struct mca_bmi_base_resources_t mca_bmi_base_resources_t; +typedef struct mca_mpool_base_resources_t mca_mpool_base_resources_t; -struct mca_bmi_base_registration_t { +struct mca_mpool_base_registration_t { VAPI_mr_hndl_t hndl; /* Memory region handle */ @@ -49,7 +49,7 @@ struct mca_bmi_base_registration_t { void * bound; }; -typedef struct mca_bmi_base_registration_t mca_bmi_base_registration_t; +typedef struct mca_mpool_base_registration_t mca_mpool_base_registration_t; #if defined(c_plusplus) || defined(__cplusplus) } diff --git a/src/mca/mpool/base/base.h b/src/mca/mpool/base/base.h index 020824f590..bc346ad44f 100644 --- a/src/mca/mpool/base/base.h +++ b/src/mca/mpool/base/base.h @@ -32,11 +32,11 @@ extern "C" { #endif struct mca_mpool_base_selected_module_t { - ompi_list_item_t super; - mca_mpool_base_component_t *mpool_component; - mca_mpool_base_module_t *mpool_module; - struct mca_bmi_base_module_t *mpool_bmi; - struct mca_bmi_base_resources_t *mpool_resources; + ompi_list_item_t super; + mca_mpool_base_component_t *mpool_component; + mca_mpool_base_module_t *mpool_module; + void* user_data; + struct mca_mpool_base_resources_t *mpool_resources; }; typedef struct mca_mpool_base_selected_module_t mca_mpool_base_selected_module_t; @@ -68,8 +68,8 @@ typedef struct mca_mpool_base_key_t mca_mpool_base_key_t; struct mca_mpool_base_reg_mpool_t { mca_mpool_base_module_t * mpool; /**< the registered memory pool */ - struct mca_bmi_base_module_t *bmi_module; /**< bmi that registered the memory */ - struct mca_bmi_base_registration_t* bmi_registration; /**< bmi specific info associated w/ registration */ + void* user_data; /**< user data */ + struct mca_mpool_base_registration_t* mpool_registration; /**< mpool specific info associated w/ registration */ }; typedef struct mca_mpool_base_reg_mpool_t mca_mpool_base_reg_mpool_t; @@ -96,8 +96,8 @@ OMPI_DECLSPEC int mca_mpool_base_close(void); OMPI_DECLSPEC mca_mpool_base_component_t* mca_mpool_base_component_lookup(const char* name); OMPI_DECLSPEC mca_mpool_base_module_t* mca_mpool_base_module_create( const char* name, - struct mca_bmi_base_module_t* bmi, - struct mca_bmi_base_resources_t* bmi_resources); + void* user_data, + struct mca_mpool_base_resources_t* mpool_resources); /* * Globals diff --git a/src/mca/mpool/base/mpool_base_alloc.c b/src/mca/mpool/base/mpool_base_alloc.c index 468b2831bf..97b97f983c 100644 --- a/src/mca/mpool/base/mpool_base_alloc.c +++ b/src/mca/mpool/base/mpool_base_alloc.c @@ -60,8 +60,8 @@ int mca_mpool_base_tree_node_compare(void * key1, void * key2) int mca_mpool_base_insert(void * addr, size_t size, mca_mpool_base_module_t* mpool, - struct mca_bmi_base_module_t* bmi, - struct mca_bmi_base_registration_t* registration) + void* user_data, + struct mca_mpool_base_registration_t* registration) { ompi_list_item_t *item; int rc; @@ -80,8 +80,8 @@ int mca_mpool_base_insert(void * addr, size_t size, if(rc != OMPI_SUCCESS) return rc; ((mca_mpool_base_chunk_t *) item)->mpools[0].mpool = mpool; - ((mca_mpool_base_chunk_t *) item)->mpools[0].bmi_module = bmi; - ((mca_mpool_base_chunk_t *) item)->mpools[0].bmi_registration = registration; + ((mca_mpool_base_chunk_t *) item)->mpools[0].user_data = user_data; + ((mca_mpool_base_chunk_t *) item)->mpools[0].mpool_registration = registration; return OMPI_SUCCESS; } @@ -143,7 +143,7 @@ void * mca_mpool_base_alloc(size_t size, ompi_info_t * info) mca_mpool_base_selected_module_t * no_reg_function = NULL; mca_mpool_base_selected_module_t ** has_reg_function = (mca_mpool_base_selected_module_t **) malloc(num_modules * sizeof(mca_mpool_base_module_t *)); - struct mca_bmi_base_registration_t * registration; + struct mca_mpool_base_registration_t * registration; void * mem = NULL; char * key; bool match_found; @@ -253,8 +253,8 @@ void * mca_mpool_base_alloc(size_t size, ompi_info_t * info) ((mca_mpool_base_chunk_t *) item)->key.bottom = mem; ((mca_mpool_base_chunk_t *) item)->key.top = (void *)((char *) mem + size - 1); ((mca_mpool_base_chunk_t *) item)->mpools[num_modules].mpool = mpool; - ((mca_mpool_base_chunk_t *) item)->mpools[num_modules].bmi_module = no_reg_function->mpool_bmi; - ((mca_mpool_base_chunk_t *) item)->mpools[num_modules++].bmi_registration = registration; + ((mca_mpool_base_chunk_t *) item)->mpools[num_modules].user_data = (void*) no_reg_function->user_data; + ((mca_mpool_base_chunk_t *) item)->mpools[num_modules++].mpool_registration = registration; num_modules++; } else @@ -264,8 +264,8 @@ void * mca_mpool_base_alloc(size_t size, ompi_info_t * info) ((mca_mpool_base_chunk_t *) item)->key.bottom = mem; ((mca_mpool_base_chunk_t *) item)->key.top = (void *) ((char *) mem + size - 1); ((mca_mpool_base_chunk_t *) item)->mpools[num_modules].mpool = mpool; - ((mca_mpool_base_chunk_t *) item)->mpools[num_modules].bmi_module = has_reg_function[i]->mpool_bmi; - ((mca_mpool_base_chunk_t *) item)->mpools[num_modules++].bmi_registration = registration; + ((mca_mpool_base_chunk_t *) item)->mpools[num_modules].user_data = has_reg_function[i]->user_data; + ((mca_mpool_base_chunk_t *) item)->mpools[num_modules++].mpool_registration = registration; i++; num_modules++; } @@ -286,8 +286,8 @@ void * mca_mpool_base_alloc(size_t size, ompi_info_t * info) return NULL; } ((mca_mpool_base_chunk_t *) item)->mpools[num_modules].mpool = mpool; - ((mca_mpool_base_chunk_t *) item)->mpools[num_modules].bmi_module = has_reg_function[i]->mpool_bmi; - ((mca_mpool_base_chunk_t *) item)->mpools[num_modules].bmi_registration = registration; + ((mca_mpool_base_chunk_t *) item)->mpools[num_modules].user_data = has_reg_function[i]->user_data; + ((mca_mpool_base_chunk_t *) item)->mpools[num_modules].mpool_registration = registration; num_modules++; i++; } @@ -349,10 +349,10 @@ int mca_mpool_base_free(void * base) chunk->mpools[i].mpool->mpool_deregister(chunk->mpools[i].mpool, chunk->key.bottom, ((char *) chunk->key.top - (char *) chunk->key.bottom + 1), - chunk->mpools[i].bmi_registration + chunk->mpools[i].mpool_registration ); } - chunk->mpools[i].mpool->mpool_free(chunk->mpools[i].mpool, chunk->key.bottom, chunk->mpools[i].bmi_registration); + chunk->mpools[i].mpool->mpool_free(chunk->mpools[i].mpool, chunk->key.bottom, chunk->mpools[i].mpool_registration); OMPI_FREE_LIST_RETURN(&mca_mpool_base_mem_list, (ompi_list_item_t *) chunk); OMPI_THREAD_LOCK(mca_mpool_base_tree_lock); @@ -381,3 +381,38 @@ struct mca_mpool_base_chunk_t * mca_mpool_base_find(void * base) ompi_rb_tree_find(&mca_mpool_base_tree, &base); } + +/* int mca_bmi_ib_tree_node_compare_range(void * key1, void * key2) */ +/* { */ +/* if(((mca_mpool_base_key_t *) key1)->bottom < */ +/* ((mca_mpool_base_key_t *) key2)->bottom) */ +/* { */ +/* return -1; */ +/* } */ +/* else if((((mca_mpool_base_key_t *) key1)->bottom + ((mca_mpool_base_key_t *) key1)->length) > */ +/* ((mca_mpool_base_key_t *) key2)->top) */ +/* { */ +/* return 1; */ +/* } */ +/* else */ +/* { */ +/* return 0; */ +/* } */ +/* } */ + + +/* /\** */ +/* * Searches the mpool to see if it has allocated the memory that is passed in. */ +/* * If so it returns an array of mpools the memory is registered with. */ +/* * */ +/* * @param base pointer to the memory to lookup */ +/* * */ +/* * @retval NULL if the memory is not in any mpool */ +/* * @retval pointer to an array of type mca_mpool_base_reg_mpool_t */ +/* *\/ */ +/* struct mca_mpool_base_chunk_t * mca_mpool_base_find_range(void * base) */ +/* { */ +/* return (mca_mpool_base_chunk_t *) */ +/* ompi_rb_tree_find(&mca_mpool_base_tree, &base); */ +/* } */ + diff --git a/src/mca/mpool/base/mpool_base_lookup.c b/src/mca/mpool/base/mpool_base_lookup.c index 594903ccd3..44c2ba577d 100644 --- a/src/mca/mpool/base/mpool_base_lookup.c +++ b/src/mca/mpool/base/mpool_base_lookup.c @@ -46,8 +46,8 @@ mca_mpool_base_component_t* mca_mpool_base_component_lookup(const char* name) mca_mpool_base_module_t* mca_mpool_base_module_create( const char* name, - struct mca_bmi_base_module_t* bmi, - struct mca_bmi_base_resources_t* resources) + void* user_data, + struct mca_mpool_base_resources_t* resources) { mca_mpool_base_component_t* component = NULL; @@ -69,11 +69,11 @@ mca_mpool_base_module_t* mca_mpool_base_module_create( if(NULL == component) return NULL; - module = component->mpool_init(bmi,resources); + module = component->mpool_init(resources); sm = OBJ_NEW(mca_mpool_base_selected_module_t); sm->mpool_component = component; sm->mpool_module = module; - sm->mpool_bmi = bmi; + sm->user_data = user_data; sm->mpool_resources = resources; ompi_list_append(&mca_mpool_base_modules, (ompi_list_item_t*) sm); return module; diff --git a/src/mca/mpool/mpool.h b/src/mca/mpool/mpool.h index fda371689f..c9bedacdd4 100644 --- a/src/mca/mpool/mpool.h +++ b/src/mca/mpool/mpool.h @@ -21,17 +21,15 @@ #define MCA_MPOOL_H #include "mca/mca.h" #include "info/info.h" -struct mca_mpool_t; -struct mca_bmi_base_module_t; -struct mca_bmi_base_resources_t; -struct mca_bmi_base_registration_t; + +struct mca_mpool_base_resources_t; +struct mca_mpool_base_registration_t; /** * component initialize */ typedef struct mca_mpool_base_module_t* (*mca_mpool_base_component_init_fn_t)( - struct mca_bmi_base_module_t* bmi, - struct mca_bmi_base_resources_t*); + struct mca_mpool_base_resources_t*); /** * allocate function typedef @@ -40,7 +38,7 @@ typedef void* (*mca_mpool_base_module_alloc_fn_t)( struct mca_mpool_base_module_t* mpool, size_t size, size_t align, - struct mca_bmi_base_registration_t** registration); + struct mca_mpool_base_registration_t** registration); /** * realloc function typedef @@ -49,7 +47,7 @@ typedef void* (*mca_mpool_base_module_realloc_fn_t)( struct mca_mpool_base_module_t* mpool, void* addr, size_t size, - struct mca_bmi_base_registration_t** registration); + struct mca_mpool_base_registration_t** registration); /** * free function typedef @@ -57,7 +55,7 @@ typedef void* (*mca_mpool_base_module_realloc_fn_t)( typedef void (*mca_mpool_base_module_free_fn_t)( struct mca_mpool_base_module_t* mpool, void *addr, - struct mca_bmi_base_registration_t* registration); + struct mca_mpool_base_registration_t* registration); /** * register memory @@ -66,7 +64,7 @@ typedef int (*mca_mpool_base_module_register_fn_t)( struct mca_mpool_base_module_t* mpool, void * addr, size_t size, - struct mca_bmi_base_registration_t** registration); + struct mca_mpool_base_registration_t** registration); /** * deregister memory @@ -75,7 +73,7 @@ typedef int (*mca_mpool_base_module_deregister_fn_t)( struct mca_mpool_base_module_t* mpool, void * addr, size_t size, - struct mca_bmi_base_registration_t* registration); + struct mca_mpool_base_registration_t* registration); /** * if appropriate - returns base address of memory pool @@ -187,8 +185,8 @@ OMPI_DECLSPEC int mca_mpool_base_insert( void * addr, size_t size, mca_mpool_base_module_t* mpool, - struct mca_bmi_base_module_t* bmi, - struct mca_bmi_base_registration_t* registration); + void* user_in, + struct mca_mpool_base_registration_t* registration); OMPI_DECLSPEC int mca_mpool_base_remove(void * base); diff --git a/src/mca/mpool/sm/mpool_sm.h b/src/mca/mpool/sm/mpool_sm.h index 407815a198..542c5d66c1 100644 --- a/src/mca/mpool/sm/mpool_sm.h +++ b/src/mca/mpool/sm/mpool_sm.h @@ -66,7 +66,7 @@ void* mca_mpool_sm_alloc( mca_mpool_base_module_t* mpool, size_t size, size_t align, - struct mca_bmi_base_registration_t** registration); + struct mca_mpool_base_registration_t** registration); /** * realloc function typedef @@ -75,7 +75,7 @@ void* mca_mpool_sm_realloc( mca_mpool_base_module_t* mpool, void* addr, size_t size, - struct mca_bmi_base_registration_t** registration); + struct mca_mpool_base_registration_t** registration); /** * free function typedef @@ -83,7 +83,7 @@ void* mca_mpool_sm_realloc( void mca_mpool_sm_free( mca_mpool_base_module_t* mpool, void * addr, - struct mca_bmi_base_registration_t* registration); + struct mca_mpool_base_registration_t* registration); #if defined(c_plusplus) || defined(__cplusplus) diff --git a/src/mca/mpool/sm/mpool_sm_component.c b/src/mca/mpool/sm/mpool_sm_component.c index 4b81fa1ac2..c00053f563 100644 --- a/src/mca/mpool/sm/mpool_sm_component.c +++ b/src/mca/mpool/sm/mpool_sm_component.c @@ -29,8 +29,7 @@ */ static int mca_mpool_sm_open(void); static mca_mpool_base_module_t* mca_mpool_sm_init( - struct mca_bmi_base_module_t* bmi, - struct mca_bmi_base_resources_t* resources); + struct mca_mpool_base_resources_t* resources); mca_mpool_sm_component_t mca_mpool_sm_component = { { @@ -98,8 +97,7 @@ static int mca_mpool_sm_open(void) static mca_mpool_base_module_t* mca_mpool_sm_init( - struct mca_bmi_base_module_t* bmi, - struct mca_bmi_base_resources_t* resources) + struct mca_mpool_base_resources_t* resources) { char *file_name; int len; diff --git a/src/mca/mpool/sm/mpool_sm_module.c b/src/mca/mpool/sm/mpool_sm_module.c index 2e0e51cc3a..028ff00138 100644 --- a/src/mca/mpool/sm/mpool_sm_module.c +++ b/src/mca/mpool/sm/mpool_sm_module.c @@ -52,7 +52,7 @@ void* mca_mpool_sm_alloc( mca_mpool_base_module_t* mpool, size_t size, size_t align, - struct mca_bmi_base_registration_t** registration) + struct mca_mpool_base_registration_t** registration) { mca_mpool_sm_module_t* mpool_sm = (mca_mpool_sm_module_t*)mpool; return mpool_sm->sm_allocator->alc_alloc(mpool_sm->sm_allocator, size, align, registration); @@ -65,7 +65,7 @@ void* mca_mpool_sm_realloc( mca_mpool_base_module_t* mpool, void* addr, size_t size, - struct mca_bmi_base_registration_t** registration) + struct mca_mpool_base_registration_t** registration) { mca_mpool_sm_module_t* mpool_sm = (mca_mpool_sm_module_t*)mpool; return mpool_sm->sm_allocator->alc_realloc(mpool_sm->sm_allocator, addr, size, registration); @@ -75,7 +75,7 @@ void* mca_mpool_sm_realloc( * free function */ void mca_mpool_sm_free(mca_mpool_base_module_t* mpool, void * addr, - struct mca_bmi_base_registration_t* registration) + struct mca_mpool_base_registration_t* registration) { mca_mpool_sm_module_t* mpool_sm = (mca_mpool_sm_module_t*)mpool; mpool_sm->sm_allocator->alc_free(mpool_sm->sm_allocator, addr); diff --git a/src/mca/mpool/vapi/mpool_vapi.h b/src/mca/mpool/vapi/mpool_vapi.h index 8feecb2cc0..eaa87911c6 100644 --- a/src/mca/mpool/vapi/mpool_vapi.h +++ b/src/mca/mpool/vapi/mpool_vapi.h @@ -55,7 +55,7 @@ OMPI_COMP_EXPORT extern mca_mpool_vapi_component_t mca_mpool_vapi_component; struct mca_mpool_vapi_module_t { mca_mpool_base_module_t super; mca_allocator_base_module_t * vapi_allocator; - mca_bmi_base_resources_t hca_pd; + mca_mpool_base_resources_t hca_pd; }; typedef struct mca_mpool_vapi_module_t mca_mpool_vapi_module_t; /* @@ -76,7 +76,7 @@ void* mca_mpool_vapi_alloc( mca_mpool_base_module_t* mpool, size_t size, size_t align, - struct mca_bmi_base_registration_t** registration); + struct mca_mpool_base_registration_t** registration); /** * realloc function typedef @@ -85,7 +85,7 @@ void* mca_mpool_vapi_realloc( mca_mpool_base_module_t* mpool, void* addr, size_t size, - struct mca_bmi_base_registration_t** registration); + struct mca_mpool_base_registration_t** registration); /** * register function typedef @@ -94,13 +94,13 @@ int mca_mpool_vapi_register( mca_mpool_base_module_t* mpool, void *addr, size_t size, - struct mca_bmi_base_registration_t** registration); + struct mca_mpool_base_registration_t** registration); int mca_mpool_vapi_deregister( mca_mpool_base_module_t* mpool, void *addr, size_t size, - struct mca_bmi_base_registration_t* ); + struct mca_mpool_base_registration_t* ); /** @@ -108,12 +108,12 @@ int mca_mpool_vapi_deregister( */ void mca_mpool_vapi_free(mca_mpool_base_module_t* mpool, void * addr, - struct mca_bmi_base_registration_t* registration); + struct mca_mpool_base_registration_t* registration); void* mca_common_vapi_segment_alloc( struct mca_mpool_base_module_t* module, size_t* size, - struct mca_bmi_base_registration_t** registration); + struct mca_mpool_base_registration_t** registration); #if defined(c_plusplus) || defined(__cplusplus) } diff --git a/src/mca/mpool/vapi/mpool_vapi_component.c b/src/mca/mpool/vapi/mpool_vapi_component.c index 786e61c248..862437b429 100644 --- a/src/mca/mpool/vapi/mpool_vapi_component.c +++ b/src/mca/mpool/vapi/mpool_vapi_component.c @@ -29,8 +29,7 @@ */ static int mca_mpool_vapi_open(void); static mca_mpool_base_module_t* mca_mpool_vapi_init( - struct mca_bmi_base_module_t* module, - struct mca_bmi_base_resources_t* resources); + struct mca_mpool_base_resources_t* resources); mca_mpool_vapi_component_t mca_mpool_vapi_component = { { @@ -92,7 +91,7 @@ static int mca_mpool_vapi_open(void) void* mca_common_vapi_segment_alloc( struct mca_mpool_base_module_t* mpool, size_t* size, - struct mca_bmi_base_registration_t** registration) + struct mca_mpool_base_registration_t** registration) { void* addr_malloc = (void*)malloc((*size) + mca_mpool_vapi_component.page_size); void* addr = (void*) ALIGN_ADDR(addr_malloc, mca_mpool_vapi_component.page_size_log); @@ -105,8 +104,7 @@ void* mca_common_vapi_segment_alloc( /* Allocates a segment of memory and registers with IB, user_out returns the memory handle. */ static mca_mpool_base_module_t* mca_mpool_vapi_init( - struct mca_bmi_base_module_t* bmi, - struct mca_bmi_base_resources_t* resources) + struct mca_mpool_base_resources_t* resources) { mca_mpool_vapi_module_t* mpool_module; mca_allocator_base_component_t* allocator_component; diff --git a/src/mca/mpool/vapi/mpool_vapi_module.c b/src/mca/mpool/vapi/mpool_vapi_module.c index a1338e4a49..67ec7b9bfa 100644 --- a/src/mca/mpool/vapi/mpool_vapi_module.c +++ b/src/mca/mpool/vapi/mpool_vapi_module.c @@ -44,7 +44,7 @@ void* mca_mpool_vapi_alloc( mca_mpool_base_module_t* mpool, size_t size, size_t align, - struct mca_bmi_base_registration_t** registration) + struct mca_mpool_base_registration_t** registration) { mca_mpool_vapi_module_t* mpool_vapi = (mca_mpool_vapi_module_t*)mpool; return mpool_vapi->vapi_allocator->alc_alloc(mpool_vapi->vapi_allocator, size, align, registration); @@ -55,20 +55,20 @@ void* mca_mpool_vapi_alloc( * register memory */ int mca_mpool_vapi_register(mca_mpool_base_module_t* mpool, void *addr, size_t size, - struct mca_bmi_base_registration_t** registration){ + struct mca_mpool_base_registration_t** registration){ mca_mpool_vapi_module_t * mpool_module = (mca_mpool_vapi_module_t*) mpool; VAPI_mrw_t mr_in, mr_out; VAPI_ret_t ret; - mca_bmi_base_registration_t* mem_hndl; + mca_mpool_base_registration_t* mem_hndl; memset(&mr_in, 0, sizeof(VAPI_mrw_t)); memset(&mr_out, 0, sizeof(VAPI_mrw_t)); - *registration = (void*) malloc(sizeof(mca_bmi_base_registration_t)); - mem_hndl = (mca_bmi_base_registration_t*) *registration; - memset(mem_hndl, 0, sizeof(mca_bmi_base_registration_t*)); + *registration = (void*) malloc(sizeof(mca_mpool_base_registration_t)); + mem_hndl = (mca_mpool_base_registration_t*) *registration; + memset(mem_hndl, 0, sizeof(mca_mpool_base_registration_t*)); mem_hndl->hndl = VAPI_INVAL_HNDL; @@ -106,7 +106,7 @@ int mca_mpool_vapi_register(mca_mpool_base_module_t* mpool, void *addr, size_t s * deregister memory */ int mca_mpool_vapi_deregister(mca_mpool_base_module_t* mpool, void *addr, size_t size, - struct mca_bmi_base_registration_t* registration){ + struct mca_mpool_base_registration_t* registration){ VAPI_ret_t ret; mca_mpool_vapi_module_t * mpool_vapi = (mca_mpool_vapi_module_t*) mpool; @@ -131,7 +131,7 @@ void* mca_mpool_vapi_realloc( mca_mpool_base_module_t* mpool, void* addr, size_t size, - struct mca_bmi_base_registration_t** registration) + struct mca_mpool_base_registration_t** registration) { mca_mpool_vapi_module_t* mpool_vapi = (mca_mpool_vapi_module_t*)mpool; return mpool_vapi->vapi_allocator->alc_realloc( mpool_vapi->vapi_allocator, addr, size, registration); @@ -141,7 +141,7 @@ void* mca_mpool_vapi_realloc( * free function */ void mca_mpool_vapi_free(mca_mpool_base_module_t* mpool, void * addr, - struct mca_bmi_base_registration_t* registration) + struct mca_mpool_base_registration_t* registration) { mca_mpool_vapi_module_t* mpool_vapi = (mca_mpool_vapi_module_t*)mpool; diff --git a/src/mca/pml/base/pml_base_bsend.c b/src/mca/pml/base/pml_base_bsend.c index 4b21e5b026..8c1eb6356b 100644 --- a/src/mca/pml/base/pml_base_bsend.c +++ b/src/mca/pml/base/pml_base_bsend.c @@ -45,7 +45,7 @@ static int32_t mca_pml_bsend_init = 0; static void* mca_pml_bsend_alloc_segment( struct mca_mpool_base_module_t* module, size_t* size_inout, - struct mca_bmi_base_registration_t** registration) + struct mca_mpool_base_registration_t** registration) { void *addr; size_t size = *size_inout; diff --git a/src/mca/pml/ob1/pml_ob1_recvreq.c b/src/mca/pml/ob1/pml_ob1_recvreq.c index dcba0f2bd3..46ce036e9d 100644 --- a/src/mca/pml/ob1/pml_ob1_recvreq.c +++ b/src/mca/pml/ob1/pml_ob1_recvreq.c @@ -150,7 +150,7 @@ static void mca_pml_ob1_recv_request_ack( hdr->hdr_match.hdr_common.hdr_flags & MCA_PML_OB1_HDR_FLAGS_PIN) { struct mca_mpool_base_reg_mpool_t *reg = recvreq->req_chunk->mpools; while(reg->mpool != NULL) { - if(NULL != mca_pml_ob1_ep_array_find(&proc->bmi_rdma,reg->bmi_module)) { + if(NULL != mca_pml_ob1_ep_array_find(&proc->bmi_rdma,(mca_bmi_base_module_t*) reg->user_data)) { recvreq->req_rdma_offset = hdr->hdr_frag_length; ack->hdr_rdma_offset = hdr->hdr_frag_length; recvreq->req_mpool = reg; @@ -386,7 +386,7 @@ void mca_pml_ob1_recv_request_schedule(mca_pml_ob1_recv_request_t* recvreq) } else { /* find the endpoint corresponding to this bmi and schedule the entire message */ - ep = mca_pml_ob1_ep_array_find(&proc->bmi_rdma, recvreq->req_mpool->bmi_module); + ep = mca_pml_ob1_ep_array_find(&proc->bmi_rdma, (mca_bmi_base_module_t*) recvreq->req_mpool->user_data); size = bytes_remaining; /* prepare a descriptor for RDMA */ @@ -397,7 +397,7 @@ void mca_pml_ob1_recv_request_schedule(mca_pml_ob1_recv_request_t* recvreq) dst = ep->bmi_prepare_dst( ep->bmi, ep->bmi_endpoint, - recvreq->req_mpool->bmi_registration, + recvreq->req_mpool->mpool_registration, &recvreq->req_recv.req_convertor, 0, &size); diff --git a/src/mca/pml/ob1/pml_ob1_sendreq.c b/src/mca/pml/ob1/pml_ob1_sendreq.c index a7accb161f..d384a3f9b1 100644 --- a/src/mca/pml/ob1/pml_ob1_sendreq.c +++ b/src/mca/pml/ob1/pml_ob1_sendreq.c @@ -584,7 +584,7 @@ void mca_pml_ob1_send_request_put( { mca_pml_ob1_proc_t* proc = sendreq->req_proc; mca_pml_ob1_endpoint_t* ep = mca_pml_ob1_ep_array_find(&proc->bmi_rdma,bmi); - struct mca_bmi_base_registration_t* reg = NULL; + struct mca_mpool_base_registration_t* reg = NULL; mca_bmi_base_descriptor_t* des; mca_pml_ob1_rdma_frag_t* frag; size_t offset = hdr->hdr_rdma_offset; @@ -612,8 +612,8 @@ void mca_pml_ob1_send_request_put( if(NULL != sendreq->req_chunk) { mca_mpool_base_reg_mpool_t* mpool = sendreq->req_chunk->mpools; while(mpool->mpool != NULL) { - if(mpool->bmi_module == bmi) { - reg = mpool->bmi_registration; + if(mpool->user_data == (void*) bmi) { + reg = mpool->mpool_registration; break; } mpool++;