make ompi_free_list_item_t a class..
This will go to the 1.1 branch but will probably require a few changes as ompi_free_list_t is different in the branch.. This commit was SVN r10306.
Этот коммит содержится в:
родитель
a31a73cb15
Коммит
18dda70fd0
@ -43,6 +43,9 @@ static OBJ_CLASS_INSTANCE(ompi_free_list_memory_t,
|
|||||||
opal_list_item_t,
|
opal_list_item_t,
|
||||||
NULL, NULL);
|
NULL, NULL);
|
||||||
|
|
||||||
|
OBJ_CLASS_INSTANCE(ompi_free_list_item_t,
|
||||||
|
opal_list_item_t,
|
||||||
|
NULL, NULL);
|
||||||
|
|
||||||
static void ompi_free_list_construct(ompi_free_list_t* fl)
|
static void ompi_free_list_construct(ompi_free_list_t* fl)
|
||||||
{
|
{
|
||||||
|
@ -57,6 +57,8 @@ struct ompi_free_list_item_t
|
|||||||
};
|
};
|
||||||
typedef struct ompi_free_list_item_t ompi_free_list_item_t;
|
typedef struct ompi_free_list_item_t ompi_free_list_item_t;
|
||||||
|
|
||||||
|
OBJ_CLASS_DECLARATION(ompi_free_list_item_t);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize a free list.
|
* Initialize a free list.
|
||||||
*
|
*
|
||||||
@ -110,18 +112,18 @@ OMPI_DECLSPEC int ompi_free_list_parse( ompi_free_list_t* list,
|
|||||||
#define OMPI_FREE_LIST_GET(fl, item, rc) \
|
#define OMPI_FREE_LIST_GET(fl, item, rc) \
|
||||||
{ \
|
{ \
|
||||||
if(opal_using_threads()) { \
|
if(opal_using_threads()) { \
|
||||||
item = opal_atomic_lifo_pop(&((fl)->super)); \
|
item = (ompi_free_list_item_t*) opal_atomic_lifo_pop(&((fl)->super)); \
|
||||||
if(NULL == item) { \
|
if(NULL == item) { \
|
||||||
opal_mutex_lock(&((fl)->fl_lock)); \
|
opal_mutex_lock(&((fl)->fl_lock)); \
|
||||||
ompi_free_list_grow((fl), (fl)->fl_num_per_alloc); \
|
ompi_free_list_grow((fl), (fl)->fl_num_per_alloc); \
|
||||||
opal_mutex_unlock(&((fl)->fl_lock)); \
|
opal_mutex_unlock(&((fl)->fl_lock)); \
|
||||||
item = opal_atomic_lifo_pop(&((fl)->super)); \
|
item = (ompi_free_list_item_t*) opal_atomic_lifo_pop(&((fl)->super)); \
|
||||||
} \
|
} \
|
||||||
} else { \
|
} else { \
|
||||||
item = opal_atomic_lifo_pop(&((fl)->super)); \
|
item = (ompi_free_list_item_t*) opal_atomic_lifo_pop(&((fl)->super)); \
|
||||||
if(NULL == item) { \
|
if(NULL == item) { \
|
||||||
ompi_free_list_grow((fl), (fl)->fl_num_per_alloc); \
|
ompi_free_list_grow((fl), (fl)->fl_num_per_alloc); \
|
||||||
item = opal_atomic_lifo_pop(&((fl)->super)); \
|
item =(ompi_free_list_item_t*) opal_atomic_lifo_pop(&((fl)->super)); \
|
||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
rc = (NULL == item) ? OMPI_ERR_TEMP_OUT_OF_RESOURCE : OMPI_SUCCESS; \
|
rc = (NULL == item) ? OMPI_ERR_TEMP_OUT_OF_RESOURCE : OMPI_SUCCESS; \
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
#include "ompi/class/ompi_rb_tree.h"
|
#include "ompi/class/ompi_rb_tree.h"
|
||||||
|
|
||||||
/* declare the instance of the classes */
|
/* declare the instance of the classes */
|
||||||
OBJ_CLASS_INSTANCE(ompi_rb_tree_node_t, opal_list_item_t, NULL, NULL);
|
OBJ_CLASS_INSTANCE(ompi_rb_tree_node_t, ompi_free_list_item_t, NULL, NULL);
|
||||||
OBJ_CLASS_INSTANCE(ompi_rb_tree_t, opal_object_t, ompi_rb_tree_construct,
|
OBJ_CLASS_INSTANCE(ompi_rb_tree_t, opal_object_t, ompi_rb_tree_construct,
|
||||||
ompi_rb_tree_destruct);
|
ompi_rb_tree_destruct);
|
||||||
|
|
||||||
@ -71,7 +71,7 @@ int ompi_rb_tree_init(ompi_rb_tree_t * tree,
|
|||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
opal_list_item_t * node;
|
ompi_free_list_item_t * node;
|
||||||
/* we need to get memory for the root pointer from the free list */
|
/* we need to get memory for the root pointer from the free list */
|
||||||
OMPI_FREE_LIST_GET(&(tree->free_list), node, rc);
|
OMPI_FREE_LIST_GET(&(tree->free_list), node, rc);
|
||||||
tree->root_ptr = (ompi_rb_tree_node_t *) node;
|
tree->root_ptr = (ompi_rb_tree_node_t *) node;
|
||||||
@ -110,7 +110,7 @@ int ompi_rb_tree_insert(ompi_rb_tree_t *tree, void * key, void * value)
|
|||||||
{
|
{
|
||||||
ompi_rb_tree_node_t * y;
|
ompi_rb_tree_node_t * y;
|
||||||
ompi_rb_tree_node_t * node;
|
ompi_rb_tree_node_t * node;
|
||||||
opal_list_item_t * item;
|
ompi_free_list_item_t * item;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
/* get the memory for a node */
|
/* get the memory for a node */
|
||||||
@ -266,17 +266,17 @@ int ompi_rb_tree_delete(ompi_rb_tree_t *tree, void *key)
|
|||||||
/* Destroy the hashmap */
|
/* Destroy the hashmap */
|
||||||
int ompi_rb_tree_destroy(ompi_rb_tree_t *tree)
|
int ompi_rb_tree_destroy(ompi_rb_tree_t *tree)
|
||||||
{
|
{
|
||||||
opal_list_item_t * item;
|
ompi_free_list_item_t * item;
|
||||||
/* Recursive inorder traversal for delete */
|
/* Recursive inorder traversal for delete */
|
||||||
|
|
||||||
inorder_destroy(tree, tree->root_ptr);
|
inorder_destroy(tree, tree->root_ptr);
|
||||||
/* Now free the root -- root does not get free'd in the above
|
/* Now free the root -- root does not get free'd in the above
|
||||||
* inorder destroy */
|
* inorder destroy */
|
||||||
item = (opal_list_item_t *) tree->root_ptr;
|
item = (ompi_free_list_item_t *) tree->root_ptr;
|
||||||
OMPI_FREE_LIST_RETURN(&(tree->free_list), item);
|
OMPI_FREE_LIST_RETURN(&(tree->free_list), item);
|
||||||
|
|
||||||
/* free the tree->nill node */
|
/* free the tree->nill node */
|
||||||
item = (opal_list_item_t *) tree->nill;
|
item = (ompi_free_list_item_t *) tree->nill;
|
||||||
OMPI_FREE_LIST_RETURN(&(tree->free_list), item);
|
OMPI_FREE_LIST_RETURN(&(tree->free_list), item);
|
||||||
return(OMPI_SUCCESS);
|
return(OMPI_SUCCESS);
|
||||||
}
|
}
|
||||||
@ -411,7 +411,7 @@ void btree_delete_fixup(ompi_rb_tree_t *tree, ompi_rb_tree_node_t * x)
|
|||||||
void
|
void
|
||||||
inorder_destroy(ompi_rb_tree_t *tree, ompi_rb_tree_node_t * node)
|
inorder_destroy(ompi_rb_tree_t *tree, ompi_rb_tree_node_t * node)
|
||||||
{
|
{
|
||||||
opal_list_item_t * item;
|
ompi_free_list_item_t * item;
|
||||||
|
|
||||||
if (node == tree->nill) {
|
if (node == tree->nill) {
|
||||||
return;
|
return;
|
||||||
@ -420,14 +420,14 @@ inorder_destroy(ompi_rb_tree_t *tree, ompi_rb_tree_node_t * node)
|
|||||||
inorder_destroy(tree, node->left);
|
inorder_destroy(tree, node->left);
|
||||||
|
|
||||||
if (node->left != tree->nill) {
|
if (node->left != tree->nill) {
|
||||||
item = (opal_list_item_t *) node->left;
|
item = (ompi_free_list_item_t *) node->left;
|
||||||
--tree->tree_size;
|
--tree->tree_size;
|
||||||
OMPI_FREE_LIST_RETURN(&(tree->free_list), item);
|
OMPI_FREE_LIST_RETURN(&(tree->free_list), item);
|
||||||
}
|
}
|
||||||
|
|
||||||
inorder_destroy(tree, node->right);
|
inorder_destroy(tree, node->right);
|
||||||
if (node->right != tree->nill) {
|
if (node->right != tree->nill) {
|
||||||
item = (opal_list_item_t *) node->right;
|
item = (ompi_free_list_item_t *) node->right;
|
||||||
--tree->tree_size;
|
--tree->tree_size;
|
||||||
OMPI_FREE_LIST_RETURN(&(tree->free_list), item);
|
OMPI_FREE_LIST_RETURN(&(tree->free_list), item);
|
||||||
}
|
}
|
||||||
|
@ -47,7 +47,7 @@ typedef enum {RED, BLACK} ompi_rb_tree_nodecolor_t;
|
|||||||
*/
|
*/
|
||||||
struct ompi_rb_tree_node_t
|
struct ompi_rb_tree_node_t
|
||||||
{
|
{
|
||||||
opal_list_item_t super; /**< the parent class */
|
ompi_free_list_item_t super; /**< the parent class */
|
||||||
ompi_rb_tree_nodecolor_t color; /**< the node color */
|
ompi_rb_tree_nodecolor_t color; /**< the node color */
|
||||||
struct ompi_rb_tree_node_t * parent;/**< the parent node, can be NULL */
|
struct ompi_rb_tree_node_t * parent;/**< the parent node, can be NULL */
|
||||||
struct ompi_rb_tree_node_t * left; /**< the left child - can be nill */
|
struct ompi_rb_tree_node_t * left; /**< the left child - can be nill */
|
||||||
|
@ -54,7 +54,7 @@ mca_allocator_base_component_t mca_allocator_basic_component = {
|
|||||||
|
|
||||||
OBJ_CLASS_INSTANCE(
|
OBJ_CLASS_INSTANCE(
|
||||||
mca_allocator_basic_segment_t,
|
mca_allocator_basic_segment_t,
|
||||||
opal_list_item_t,
|
ompi_free_list_item_t,
|
||||||
NULL,
|
NULL,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
@ -123,7 +123,7 @@ static void mca_allocator_basic_combine_prev(
|
|||||||
mca_allocator_basic_segment_t *prev = (mca_allocator_basic_segment_t*)item;
|
mca_allocator_basic_segment_t *prev = (mca_allocator_basic_segment_t*)item;
|
||||||
if(prev->seg_addr + prev->seg_size == seg->seg_addr) {
|
if(prev->seg_addr + prev->seg_size == seg->seg_addr) {
|
||||||
prev->seg_size += seg->seg_size;
|
prev->seg_size += seg->seg_size;
|
||||||
opal_list_remove_item(&module->seg_list, &seg->seg_item);
|
opal_list_remove_item(&module->seg_list, &seg->seg_item.super);
|
||||||
OMPI_FREE_LIST_RETURN(&module->seg_descriptors, &seg->seg_item);
|
OMPI_FREE_LIST_RETURN(&module->seg_descriptors, &seg->seg_item);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -140,7 +140,7 @@ static void mca_allocator_basic_combine_next(
|
|||||||
if(seg->seg_addr + seg->seg_size == next->seg_addr) {
|
if(seg->seg_addr + seg->seg_size == next->seg_addr) {
|
||||||
next->seg_addr = seg->seg_addr;
|
next->seg_addr = seg->seg_addr;
|
||||||
next->seg_size += seg->seg_size;
|
next->seg_size += seg->seg_size;
|
||||||
opal_list_remove_item(&module->seg_list, &seg->seg_item);
|
opal_list_remove_item(&module->seg_list, &seg->seg_item.super);
|
||||||
OMPI_FREE_LIST_RETURN(&module->seg_descriptors, &seg->seg_item);
|
OMPI_FREE_LIST_RETURN(&module->seg_descriptors, &seg->seg_item);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -167,16 +167,16 @@ void *mca_allocator_basic_alloc(
|
|||||||
{
|
{
|
||||||
mca_allocator_basic_module_t* module = (mca_allocator_basic_module_t*)base;
|
mca_allocator_basic_module_t* module = (mca_allocator_basic_module_t*)base;
|
||||||
mca_allocator_basic_segment_t* seg;
|
mca_allocator_basic_segment_t* seg;
|
||||||
opal_list_item_t* item;
|
ompi_free_list_item_t* item;
|
||||||
unsigned char* addr;
|
unsigned char* addr;
|
||||||
size_t allocated_size;
|
size_t allocated_size;
|
||||||
OPAL_THREAD_LOCK(&module->seg_lock);
|
OPAL_THREAD_LOCK(&module->seg_lock);
|
||||||
|
|
||||||
/* search the list for a segment of the required size */
|
/* search the list for a segment of the required size */
|
||||||
size += sizeof(size_t);
|
size += sizeof(size_t);
|
||||||
for(item = opal_list_get_first(&module->seg_list);
|
for(item = (ompi_free_list_item_t*) opal_list_get_first(&module->seg_list);
|
||||||
item != opal_list_get_end(&module->seg_list);
|
item != (ompi_free_list_item_t*) opal_list_get_end(&module->seg_list);
|
||||||
item = opal_list_get_next(item)) {
|
item = (ompi_free_list_item_t*) opal_list_get_next(&item->super)) {
|
||||||
seg = (mca_allocator_basic_segment_t*)item;
|
seg = (mca_allocator_basic_segment_t*)item;
|
||||||
|
|
||||||
/* split the segment */
|
/* split the segment */
|
||||||
@ -189,7 +189,7 @@ void *mca_allocator_basic_alloc(
|
|||||||
return addr+sizeof(size_t);
|
return addr+sizeof(size_t);
|
||||||
} else if (seg->seg_size == size) {
|
} else if (seg->seg_size == size) {
|
||||||
addr = seg->seg_addr;
|
addr = seg->seg_addr;
|
||||||
opal_list_remove_item(&module->seg_list, item);
|
opal_list_remove_item(&module->seg_list, &item->super);
|
||||||
OMPI_FREE_LIST_RETURN(&module->seg_descriptors, item);
|
OMPI_FREE_LIST_RETURN(&module->seg_descriptors, item);
|
||||||
OPAL_THREAD_UNLOCK(&module->seg_lock);
|
OPAL_THREAD_UNLOCK(&module->seg_lock);
|
||||||
*(size_t*)addr = size;
|
*(size_t*)addr = size;
|
||||||
@ -215,7 +215,7 @@ void *mca_allocator_basic_alloc(
|
|||||||
seg = (mca_allocator_basic_segment_t*)item;
|
seg = (mca_allocator_basic_segment_t*)item;
|
||||||
seg->seg_addr = addr + size;
|
seg->seg_addr = addr + size;
|
||||||
seg->seg_size = allocated_size - size;
|
seg->seg_size = allocated_size - size;
|
||||||
opal_list_append(&module->seg_list, item);
|
opal_list_append(&module->seg_list, &item->super);
|
||||||
}
|
}
|
||||||
|
|
||||||
*(size_t*)addr = size;
|
*(size_t*)addr = size;
|
||||||
@ -274,16 +274,16 @@ void mca_allocator_basic_free(
|
|||||||
{
|
{
|
||||||
mca_allocator_basic_module_t* module = (mca_allocator_basic_module_t*)base;
|
mca_allocator_basic_module_t* module = (mca_allocator_basic_module_t*)base;
|
||||||
mca_allocator_basic_segment_t* seg;
|
mca_allocator_basic_segment_t* seg;
|
||||||
opal_list_item_t *item;
|
ompi_free_list_item_t *item;
|
||||||
unsigned char* addr = (unsigned char*)ptr - sizeof(size_t);
|
unsigned char* addr = (unsigned char*)ptr - sizeof(size_t);
|
||||||
size_t size = *(size_t*)addr;
|
size_t size = *(size_t*)addr;
|
||||||
int rc;
|
int rc;
|
||||||
OPAL_THREAD_LOCK(&module->seg_lock);
|
OPAL_THREAD_LOCK(&module->seg_lock);
|
||||||
|
|
||||||
/* maintain the free list in sorted order by address */
|
/* maintain the free list in sorted order by address */
|
||||||
for(item = opal_list_get_first(&module->seg_list);
|
for(item = (ompi_free_list_item_t*) opal_list_get_first(&module->seg_list);
|
||||||
item != opal_list_get_end(&module->seg_list);
|
item != (ompi_free_list_item_t*) opal_list_get_end(&module->seg_list);
|
||||||
item = opal_list_get_next(item)) {
|
item = (ompi_free_list_item_t*) opal_list_get_next((&item->super))) {
|
||||||
seg = (mca_allocator_basic_segment_t*)item;
|
seg = (mca_allocator_basic_segment_t*)item;
|
||||||
|
|
||||||
if (seg->seg_addr < addr) {
|
if (seg->seg_addr < addr) {
|
||||||
@ -315,10 +315,11 @@ void mca_allocator_basic_free(
|
|||||||
OPAL_THREAD_UNLOCK(&module->seg_lock);
|
OPAL_THREAD_UNLOCK(&module->seg_lock);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
new_seg = (mca_allocator_basic_segment_t*)item;
|
new_seg = (
|
||||||
|
mca_allocator_basic_segment_t*)item;
|
||||||
new_seg->seg_addr = addr;
|
new_seg->seg_addr = addr;
|
||||||
new_seg->seg_size = size;
|
new_seg->seg_size = size;
|
||||||
opal_list_insert_pos(&module->seg_list, &seg->seg_item, item);
|
opal_list_insert_pos(&module->seg_list, &seg->seg_item.super, &item->super);
|
||||||
OPAL_THREAD_UNLOCK(&module->seg_lock);
|
OPAL_THREAD_UNLOCK(&module->seg_lock);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -334,7 +335,7 @@ void mca_allocator_basic_free(
|
|||||||
seg = (mca_allocator_basic_segment_t*)item;
|
seg = (mca_allocator_basic_segment_t*)item;
|
||||||
seg->seg_addr = addr;
|
seg->seg_addr = addr;
|
||||||
seg->seg_size = size;
|
seg->seg_size = size;
|
||||||
opal_list_append(&module->seg_list, item);
|
opal_list_append(&module->seg_list, &item->super);
|
||||||
OPAL_THREAD_UNLOCK(&module->seg_lock);
|
OPAL_THREAD_UNLOCK(&module->seg_lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
struct mca_allocator_basic_segment_t {
|
struct mca_allocator_basic_segment_t {
|
||||||
opal_list_item_t seg_item;
|
ompi_free_list_item_t seg_item;
|
||||||
unsigned char* seg_addr;
|
unsigned char* seg_addr;
|
||||||
size_t seg_size;
|
size_t seg_size;
|
||||||
};
|
};
|
||||||
|
@ -122,7 +122,7 @@ int mca_io_base_request_alloc(ompi_file_t *file,
|
|||||||
{
|
{
|
||||||
int err;
|
int err;
|
||||||
mca_io_base_module_request_once_init_fn_t func;
|
mca_io_base_module_request_once_init_fn_t func;
|
||||||
opal_list_item_t *item;
|
ompi_free_list_item_t *item;
|
||||||
|
|
||||||
/* See if we've got a request on the module's freelist (which is
|
/* See if we've got a request on the module's freelist (which is
|
||||||
cached on the file, since there's only one module per
|
cached on the file, since there's only one module per
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
#include "mpool_base_tree.h"
|
#include "mpool_base_tree.h"
|
||||||
|
|
||||||
|
|
||||||
OBJ_CLASS_INSTANCE(mca_mpool_base_tree_item_t, opal_list_item_t, NULL, NULL);
|
OBJ_CLASS_INSTANCE(mca_mpool_base_tree_item_t, ompi_free_list_item_t, NULL, NULL);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* use globals for the tree and the tree_item free list..
|
* use globals for the tree and the tree_item free list..
|
||||||
@ -96,7 +96,7 @@ mca_mpool_base_tree_item_t* mca_mpool_base_tree_find(void* base) {
|
|||||||
* get a tree item from the free list
|
* get a tree item from the free list
|
||||||
*/
|
*/
|
||||||
mca_mpool_base_tree_item_t* mca_mpool_base_tree_item_get(void) {
|
mca_mpool_base_tree_item_t* mca_mpool_base_tree_item_get(void) {
|
||||||
opal_list_item_t* item = NULL;
|
ompi_free_list_item_t* item = NULL;
|
||||||
int rc;
|
int rc;
|
||||||
OMPI_FREE_LIST_GET(&mca_mpool_base_tree_item_free_list,
|
OMPI_FREE_LIST_GET(&mca_mpool_base_tree_item_free_list,
|
||||||
item,
|
item,
|
||||||
|
@ -99,7 +99,7 @@ int mca_mpool_mvapi_register(
|
|||||||
mca_mpool_mvapi_registration_t * vapi_reg;
|
mca_mpool_mvapi_registration_t * vapi_reg;
|
||||||
VAPI_mrw_t mr_in, mr_out;
|
VAPI_mrw_t mr_in, mr_out;
|
||||||
VAPI_ret_t ret;
|
VAPI_ret_t ret;
|
||||||
opal_list_item_t *item;
|
ompi_free_list_item_t *item;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
|
|
||||||
@ -240,7 +240,7 @@ int mca_mpool_mvapi_release(
|
|||||||
opal_output(0, "%s: error unpinning vapi memory\n", __func__);
|
opal_output(0, "%s: error unpinning vapi memory\n", __func__);
|
||||||
return OMPI_ERROR;
|
return OMPI_ERROR;
|
||||||
}
|
}
|
||||||
OMPI_FREE_LIST_RETURN(&mpool_mvapi->reg_list, (opal_list_item_t*) vapi_reg);
|
OMPI_FREE_LIST_RETURN(&mpool_mvapi->reg_list, (ompi_free_list_item_t*) vapi_reg);
|
||||||
}
|
}
|
||||||
return OMPI_SUCCESS;
|
return OMPI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -90,7 +90,7 @@ int mca_mpool_openib_register(mca_mpool_base_module_t* mpool,
|
|||||||
|
|
||||||
mca_mpool_openib_module_t * mpool_module = (mca_mpool_openib_module_t*) mpool;
|
mca_mpool_openib_module_t * mpool_module = (mca_mpool_openib_module_t*) mpool;
|
||||||
mca_mpool_openib_registration_t * vapi_reg;
|
mca_mpool_openib_registration_t * vapi_reg;
|
||||||
opal_list_item_t *item;
|
ompi_free_list_item_t *item;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
OMPI_FREE_LIST_GET(&mpool_module->reg_list, item, rc);
|
OMPI_FREE_LIST_GET(&mpool_module->reg_list, item, rc);
|
||||||
@ -217,7 +217,7 @@ int mca_mpool_openib_release(
|
|||||||
opal_output(0, "%s: error unpinning openib memory errno says %s\n", __func__, strerror(errno));
|
opal_output(0, "%s: error unpinning openib memory errno says %s\n", __func__, strerror(errno));
|
||||||
return OMPI_ERROR;
|
return OMPI_ERROR;
|
||||||
}
|
}
|
||||||
OMPI_FREE_LIST_RETURN(&mpool_openib->reg_list, (opal_list_item_t*) openib_reg);
|
OMPI_FREE_LIST_RETURN(&mpool_openib->reg_list, (ompi_free_list_item_t*) openib_reg);
|
||||||
}
|
}
|
||||||
return OMPI_SUCCESS;
|
return OMPI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -62,14 +62,14 @@ do {
|
|||||||
|
|
||||||
OBJ_CLASS_INSTANCE(
|
OBJ_CLASS_INSTANCE(
|
||||||
mca_pml_dr_buffer_t,
|
mca_pml_dr_buffer_t,
|
||||||
opal_list_item_t,
|
ompi_free_list_item_t,
|
||||||
NULL,
|
NULL,
|
||||||
NULL
|
NULL
|
||||||
);
|
);
|
||||||
|
|
||||||
OBJ_CLASS_INSTANCE(
|
OBJ_CLASS_INSTANCE(
|
||||||
mca_pml_dr_recv_frag_t,
|
mca_pml_dr_recv_frag_t,
|
||||||
opal_list_item_t,
|
ompi_free_list_item_t,
|
||||||
NULL,
|
NULL,
|
||||||
NULL
|
NULL
|
||||||
);
|
);
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
#include "pml_dr_hdr.h"
|
#include "pml_dr_hdr.h"
|
||||||
|
|
||||||
struct mca_pml_dr_buffer_t {
|
struct mca_pml_dr_buffer_t {
|
||||||
opal_list_item_t super;
|
ompi_free_list_item_t super;
|
||||||
size_t len;
|
size_t len;
|
||||||
unsigned char addr[1];
|
unsigned char addr[1];
|
||||||
};
|
};
|
||||||
@ -37,7 +37,7 @@ OBJ_CLASS_DECLARATION(mca_pml_dr_buffer_t);
|
|||||||
|
|
||||||
|
|
||||||
struct mca_pml_dr_recv_frag_t {
|
struct mca_pml_dr_recv_frag_t {
|
||||||
opal_list_item_t super;
|
ompi_free_list_item_t super;
|
||||||
mca_pml_dr_hdr_t hdr;
|
mca_pml_dr_hdr_t hdr;
|
||||||
struct mca_pml_dr_recv_request_t* request;
|
struct mca_pml_dr_recv_request_t* request;
|
||||||
size_t num_segments;
|
size_t num_segments;
|
||||||
|
@ -66,7 +66,7 @@ OBJ_CLASS_DECLARATION(mca_pml_dr_recv_request_t);
|
|||||||
*/
|
*/
|
||||||
#define MCA_PML_DR_RECV_REQUEST_ALLOC(recvreq, rc) \
|
#define MCA_PML_DR_RECV_REQUEST_ALLOC(recvreq, rc) \
|
||||||
do { \
|
do { \
|
||||||
opal_list_item_t* item; \
|
ompi_free_list_item_t* item; \
|
||||||
rc = OMPI_SUCCESS; \
|
rc = OMPI_SUCCESS; \
|
||||||
OMPI_FREE_LIST_GET(&mca_pml_dr.recv_requests, item, rc); \
|
OMPI_FREE_LIST_GET(&mca_pml_dr.recv_requests, item, rc); \
|
||||||
recvreq = (mca_pml_dr_recv_request_t*)item; \
|
recvreq = (mca_pml_dr_recv_request_t*)item; \
|
||||||
|
@ -56,7 +56,7 @@ static void mca_pml_dr_vfrag_destruct(mca_pml_dr_vfrag_t* vfrag)
|
|||||||
|
|
||||||
OBJ_CLASS_INSTANCE(
|
OBJ_CLASS_INSTANCE(
|
||||||
mca_pml_dr_vfrag_t,
|
mca_pml_dr_vfrag_t,
|
||||||
opal_list_item_t,
|
ompi_free_list_item_t,
|
||||||
mca_pml_dr_vfrag_construct,
|
mca_pml_dr_vfrag_construct,
|
||||||
mca_pml_dr_vfrag_destruct
|
mca_pml_dr_vfrag_destruct
|
||||||
);
|
);
|
||||||
|
@ -34,7 +34,7 @@ extern "C" {
|
|||||||
#define MCA_PML_DR_VFRAG_RETRANS 0x04
|
#define MCA_PML_DR_VFRAG_RETRANS 0x04
|
||||||
|
|
||||||
struct mca_pml_dr_vfrag_t {
|
struct mca_pml_dr_vfrag_t {
|
||||||
opal_list_item_t super;
|
ompi_free_list_item_t super;
|
||||||
ompi_ptr_t vf_send;
|
ompi_ptr_t vf_send;
|
||||||
ompi_ptr_t vf_recv;
|
ompi_ptr_t vf_recv;
|
||||||
uint32_t vf_id;
|
uint32_t vf_id;
|
||||||
|
@ -133,6 +133,7 @@ int mca_pml_ob1_component_open(void)
|
|||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
OBJ_CONSTRUCT(&mca_pml_ob1.recv_frags, ompi_free_list_t);
|
OBJ_CONSTRUCT(&mca_pml_ob1.recv_frags, ompi_free_list_t);
|
||||||
|
|
||||||
ompi_free_list_init(
|
ompi_free_list_init(
|
||||||
&mca_pml_ob1.recv_frags,
|
&mca_pml_ob1.recv_frags,
|
||||||
sizeof(mca_pml_ob1_recv_frag_t),
|
sizeof(mca_pml_ob1_recv_frag_t),
|
||||||
|
@ -24,6 +24,6 @@
|
|||||||
|
|
||||||
OBJ_CLASS_INSTANCE(
|
OBJ_CLASS_INSTANCE(
|
||||||
mca_pml_ob1_rdma_frag_t,
|
mca_pml_ob1_rdma_frag_t,
|
||||||
opal_list_item_t,
|
ompi_free_list_item_t,
|
||||||
NULL,
|
NULL,
|
||||||
NULL);
|
NULL);
|
||||||
|
@ -34,7 +34,7 @@ typedef enum {
|
|||||||
} mca_pml_ob1_rdma_state_t;
|
} mca_pml_ob1_rdma_state_t;
|
||||||
|
|
||||||
struct mca_pml_ob1_rdma_frag_t {
|
struct mca_pml_ob1_rdma_frag_t {
|
||||||
opal_list_item_t super;
|
ompi_free_list_item_t super;
|
||||||
mca_btl_base_module_t* rdma_btl;
|
mca_btl_base_module_t* rdma_btl;
|
||||||
mca_pml_ob1_hdr_t rdma_hdr;
|
mca_pml_ob1_hdr_t rdma_hdr;
|
||||||
mca_pml_ob1_rdma_state_t rdma_state;
|
mca_pml_ob1_rdma_state_t rdma_state;
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
|
|
||||||
OBJ_CLASS_INSTANCE(
|
OBJ_CLASS_INSTANCE(
|
||||||
mca_pml_ob1_buffer_t,
|
mca_pml_ob1_buffer_t,
|
||||||
opal_list_item_t,
|
ompi_free_list_item_t,
|
||||||
NULL,
|
NULL,
|
||||||
NULL
|
NULL
|
||||||
);
|
);
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
#include "pml_ob1_hdr.h"
|
#include "pml_ob1_hdr.h"
|
||||||
|
|
||||||
struct mca_pml_ob1_buffer_t {
|
struct mca_pml_ob1_buffer_t {
|
||||||
opal_list_item_t super;
|
ompi_free_list_item_t super;
|
||||||
size_t len;
|
size_t len;
|
||||||
unsigned char addr[1];
|
unsigned char addr[1];
|
||||||
};
|
};
|
||||||
@ -37,7 +37,7 @@ OBJ_CLASS_DECLARATION(mca_pml_ob1_buffer_t);
|
|||||||
|
|
||||||
|
|
||||||
struct mca_pml_ob1_recv_frag_t {
|
struct mca_pml_ob1_recv_frag_t {
|
||||||
opal_list_item_t super;
|
ompi_free_list_item_t super;
|
||||||
mca_pml_ob1_hdr_t hdr;
|
mca_pml_ob1_hdr_t hdr;
|
||||||
struct mca_pml_ob1_recv_request_t* request;
|
struct mca_pml_ob1_recv_request_t* request;
|
||||||
size_t num_segments;
|
size_t num_segments;
|
||||||
|
@ -65,7 +65,7 @@ OBJ_CLASS_DECLARATION(mca_pml_ob1_recv_request_t);
|
|||||||
*/
|
*/
|
||||||
#define MCA_PML_OB1_RECV_REQUEST_ALLOC(recvreq, rc) \
|
#define MCA_PML_OB1_RECV_REQUEST_ALLOC(recvreq, rc) \
|
||||||
do { \
|
do { \
|
||||||
opal_list_item_t* item; \
|
ompi_free_list_item_t* item; \
|
||||||
rc = OMPI_SUCCESS; \
|
rc = OMPI_SUCCESS; \
|
||||||
OMPI_FREE_LIST_GET(&mca_pml_ob1.recv_requests, item, rc); \
|
OMPI_FREE_LIST_GET(&mca_pml_ob1.recv_requests, item, rc); \
|
||||||
recvreq = (mca_pml_ob1_recv_request_t*)item; \
|
recvreq = (mca_pml_ob1_recv_request_t*)item; \
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
#include "rcache_rb_tree.h"
|
#include "rcache_rb_tree.h"
|
||||||
|
|
||||||
|
|
||||||
OBJ_CLASS_INSTANCE(mca_rcache_rb_tree_item_t, opal_list_item_t, NULL, NULL);
|
OBJ_CLASS_INSTANCE(mca_rcache_rb_tree_item_t, ompi_free_list_item_t, NULL, NULL);
|
||||||
|
|
||||||
|
|
||||||
int mca_rcache_rb_tree_node_compare(void * key1, void * key2);
|
int mca_rcache_rb_tree_node_compare(void * key1, void * key2);
|
||||||
@ -106,7 +106,7 @@ int mca_rcache_rb_tree_insert(
|
|||||||
mca_mpool_base_registration_t* reg
|
mca_mpool_base_registration_t* reg
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
opal_list_item_t *item;
|
ompi_free_list_item_t *item;
|
||||||
int rc;
|
int rc;
|
||||||
mca_rcache_rb_tree_item_t* rb_tree_item;
|
mca_rcache_rb_tree_item_t* rb_tree_item;
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ static int ompi_request_empty_free(ompi_request_t** request)
|
|||||||
|
|
||||||
OBJ_CLASS_INSTANCE(
|
OBJ_CLASS_INSTANCE(
|
||||||
ompi_request_t,
|
ompi_request_t,
|
||||||
opal_list_item_t,
|
ompi_free_list_item_t,
|
||||||
ompi_request_construct,
|
ompi_request_construct,
|
||||||
ompi_request_destruct);
|
ompi_request_destruct);
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
#define OMPI_REQUEST_H
|
#define OMPI_REQUEST_H
|
||||||
|
|
||||||
#include "mpi.h"
|
#include "mpi.h"
|
||||||
#include "opal/class/opal_list.h"
|
#include "ompi/class/ompi_free_list.h"
|
||||||
#include "ompi/class/ompi_pointer_array.h"
|
#include "ompi/class/ompi_pointer_array.h"
|
||||||
#include "ompi/errhandler/errhandler.h"
|
#include "ompi/errhandler/errhandler.h"
|
||||||
#include "opal/threads/condition.h"
|
#include "opal/threads/condition.h"
|
||||||
@ -83,7 +83,7 @@ typedef int (*ompi_request_cancel_fn_t)(struct ompi_request_t* request, int flag
|
|||||||
* Main top-level request struct definition
|
* Main top-level request struct definition
|
||||||
*/
|
*/
|
||||||
struct ompi_request_t {
|
struct ompi_request_t {
|
||||||
opal_list_item_t super; /**< Base type */
|
ompi_free_list_item_t super; /**< Base type */
|
||||||
ompi_request_type_t req_type; /**< Enum indicating the type of the request */
|
ompi_request_type_t req_type; /**< Enum indicating the type of the request */
|
||||||
ompi_status_public_t req_status; /**< Completion status */
|
ompi_status_public_t req_status; /**< Completion status */
|
||||||
volatile bool req_complete; /**< Flag indicating wether request has completed */
|
volatile bool req_complete; /**< Flag indicating wether request has completed */
|
||||||
|
@ -272,14 +272,14 @@ typedef struct ompi_test_rb_key_t ompi_test_rb_key_t;
|
|||||||
|
|
||||||
struct ompi_test_rb_value_t
|
struct ompi_test_rb_value_t
|
||||||
{
|
{
|
||||||
opal_list_item_t super; /* the parent class */
|
ompi_free_list_item_t super; /* the parent class */
|
||||||
ompi_test_rb_key_t key; /* the key which holds the memory pointers */
|
ompi_test_rb_key_t key; /* the key which holds the memory pointers */
|
||||||
mca_mpool_base_module_t* registered_mpools[MAX_REGISTRATIONS];
|
mca_mpool_base_module_t* registered_mpools[MAX_REGISTRATIONS];
|
||||||
/* the mpools the memory is registered with */
|
/* the mpools the memory is registered with */
|
||||||
};
|
};
|
||||||
typedef struct ompi_test_rb_value_t ompi_test_rb_value_t;
|
typedef struct ompi_test_rb_value_t ompi_test_rb_value_t;
|
||||||
|
|
||||||
OBJ_CLASS_INSTANCE(ompi_test_rb_value_t, opal_list_item_t, NULL, NULL);
|
OBJ_CLASS_INSTANCE(ompi_test_rb_value_t, ompi_free_list_item_t, NULL, NULL);
|
||||||
|
|
||||||
int mem_node_compare(void * key1, void * key2)
|
int mem_node_compare(void * key1, void * key2)
|
||||||
{
|
{
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user