1
1

change all instances of ompi_free_list_init to ompi_free_list_init_new. Header

and payload data are specified separately at this stage.

This commit was SVN r16633.
Этот коммит содержится в:
Rich Graham 2007-11-01 23:38:50 +00:00
родитель aa82acd34c
Коммит 27a748e7eb
22 изменённых файлов: 194 добавлений и 84 удалений

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

@ -188,8 +188,8 @@ int ompi_free_list_grow(ompi_free_list_t* flist, size_t num_elements)
/* allocate the rest from the mpool */
if(flist->fl_mpool != NULL) {
elem_size = OPAL_ALIGN(flist->fl_frag_size -
flist->fl_frag_class->cls_sizeof, flist->fl_frag_alignment, size_t);
elem_size = OPAL_ALIGN(flist->fl_payload_buffer_size,
flist->fl_payload_buffer_alignment, size_t);
if(elem_size != 0) {
mpool_alloc_ptr = (unsigned char *) flist->fl_mpool->mpool_alloc(flist->fl_mpool,
num_elements * elem_size, flist->fl_frag_alignment,

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

@ -50,9 +50,10 @@ void ompi_rb_tree_construct(opal_object_t * object)
ompi_rb_tree_t * tree = (ompi_rb_tree_t *) object;
tree->root_ptr = NULL;
OBJ_CONSTRUCT(&(tree->free_list), ompi_free_list_t);
ompi_free_list_init(&(tree->free_list), sizeof(ompi_rb_tree_node_t),
OBJ_CLASS(ompi_rb_tree_node_t),
0, -1 , 128, NULL);
ompi_free_list_init_new(&(tree->free_list), sizeof(ompi_rb_tree_node_t),
CACHE_LINE_SIZE, OBJ_CLASS(ompi_rb_tree_node_t),
0,CACHE_LINE_SIZE,
0, -1 , 128, NULL);
}
/* the destructor function */

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

@ -100,9 +100,11 @@ mca_allocator_base_module_t* mca_allocator_basic_component_init(
OBJ_CONSTRUCT(&module->seg_lock, opal_mutex_t);
OBJ_CONSTRUCT(&module->seg_descriptors, ompi_free_list_t);
ompi_free_list_init(&module->seg_descriptors,
ompi_free_list_init_new(&module->seg_descriptors,
sizeof(mca_allocator_basic_segment_t),
CACHE_LINE_SIZE,
OBJ_CLASS(mca_allocator_basic_segment_t),
0,CACHE_LINE_SIZE,
0, /* initial size */
-1, /* maximum size */
16, /* increment to grow by */

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

@ -176,25 +176,31 @@ mca_btl_base_module_t** mca_btl_elan_component_init( int *num_btl_modules,
OBJ_CONSTRUCT (&mca_btl_elan_component.elan_frag_max, ompi_free_list_t);
OBJ_CONSTRUCT (&mca_btl_elan_component.elan_frag_user, ompi_free_list_t);
OBJ_CONSTRUCT(&mca_btl_elan_component.elan_procs, opal_list_t);
ompi_free_list_init( &mca_btl_elan_component.elan_frag_eager,
sizeof(mca_btl_elan_frag_t) + mca_btl_elan_module.super.btl_eager_limit,
OBJ_CLASS(mca_btl_elan_frag_t),
mca_btl_elan_component.elan_free_list_num,
mca_btl_elan_component.elan_free_list_max,
mca_btl_elan_component.elan_free_list_inc,
NULL ); /* use default allocator */
ompi_free_list_init_new( &mca_btl_elan_component.elan_frag_eager,
sizeof(mca_btl_elan_frag_t) + mca_btl_elan_module.super.btl_eager_limit,
CACHE_LINE_SIZE,
OBJ_CLASS(mca_btl_elan_frag_t),
0,CACHE_LINE_SIZE,
mca_btl_elan_component.elan_free_list_num,
mca_btl_elan_component.elan_free_list_max,
mca_btl_elan_component.elan_free_list_inc,
NULL ); /* use default allocator */
ompi_free_list_init( &mca_btl_elan_component.elan_frag_user,
ompi_free_list_init_new( &mca_btl_elan_component.elan_frag_user,
sizeof(mca_btl_elan_frag_t),
CACHE_LINE_SIZE,
OBJ_CLASS(mca_btl_elan_frag_t),
0,CACHE_LINE_SIZE,
mca_btl_elan_component.elan_free_list_num,
mca_btl_elan_component.elan_free_list_max,
mca_btl_elan_component.elan_free_list_inc,
NULL ); /* use default allocator */
ompi_free_list_init( &mca_btl_elan_component.elan_frag_max,
ompi_free_list_init_new( &mca_btl_elan_component.elan_frag_max,
sizeof(mca_btl_elan_frag_t)+mca_btl_elan_module.super.btl_max_send_size,
CACHE_LINE_SIZE,
OBJ_CLASS(mca_btl_elan_frag_t),
0,CACHE_LINE_SIZE,
mca_btl_elan_component.elan_free_list_num,
mca_btl_elan_component.elan_free_list_max,
mca_btl_elan_component.elan_free_list_inc,

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

@ -281,29 +281,37 @@ mca_btl_gm_module_init (mca_btl_gm_module_t * btl)
}
/* initialize free lists */
ompi_free_list_init( &btl->gm_frag_eager,
sizeof (mca_btl_gm_frag_eager_t) + (1 << mca_btl_gm_component.gm_eager_frag_size) + sizeof (uintptr_t),
OBJ_CLASS (mca_btl_gm_frag_eager_t),
btl->gm_max_send_tokens,
mca_btl_gm_component.gm_free_list_max,
mca_btl_gm_component.gm_free_list_inc,
btl->super.btl_mpool );
ompi_free_list_init_new( &btl->gm_frag_eager,
sizeof (mca_btl_gm_frag_eager_t),
CACHE_LINE_SIZE,
OBJ_CLASS (mca_btl_gm_frag_eager_t),
1 << mca_btl_gm_component.gm_eager_frag_size) + sizeof (uintptr_t),
CACHE_LINE_SIZE,
btl->gm_max_send_tokens,
mca_btl_gm_component.gm_free_list_max,
mca_btl_gm_component.gm_free_list_inc,
btl->super.btl_mpool );
ompi_free_list_init( &btl->gm_frag_max,
sizeof (mca_btl_gm_frag_max_t) + (1 << mca_btl_gm_component.gm_max_frag_size) + sizeof (uintptr_t),
OBJ_CLASS (mca_btl_gm_frag_max_t),
btl->gm_max_recv_tokens,
mca_btl_gm_component.gm_free_list_max,
mca_btl_gm_component.gm_free_list_inc,
btl->super.btl_mpool );
ompi_free_list_init_new( &btl->gm_frag_max,
sizeof (mca_btl_gm_frag_max_t),
CACHE_LINE_SIZE,
OBJ_CLASS (mca_btl_gm_frag_max_t),
1 << mca_btl_gm_component.gm_max_frag_size) + sizeof (uintptr_t),
CACHE_LINE_SIZE,
btl->gm_max_recv_tokens,
mca_btl_gm_component.gm_free_list_max,
mca_btl_gm_component.gm_free_list_inc,
btl->super.btl_mpool );
ompi_free_list_init( &btl->gm_frag_user,
sizeof (mca_btl_gm_frag_user_t),
OBJ_CLASS (mca_btl_gm_frag_user_t),
mca_btl_gm_component.gm_free_list_num,
mca_btl_gm_component.gm_free_list_max,
mca_btl_gm_component.gm_free_list_inc,
NULL );
ompi_free_list_init_new( &btl->gm_frag_user,
sizeof (mca_btl_gm_frag_user_t),
CACHE_LINE_SIZE,
OBJ_CLASS (mca_btl_gm_frag_user_t),
0,CACHE_LINE_SIZE,
mca_btl_gm_component.gm_free_list_num,
mca_btl_gm_component.gm_free_list_max,
mca_btl_gm_component.gm_free_list_inc,
NULL );
/* post receive buffers */

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

@ -462,17 +462,21 @@ mca_btl_base_module_t** mca_btl_mx_component_init(int *num_btl_modules,
OBJ_CONSTRUCT(&mca_btl_mx_component.mx_procs, opal_list_t);
OBJ_CONSTRUCT(&mca_btl_mx_component.mx_lock, opal_mutex_t);
ompi_free_list_init( &mca_btl_mx_component.mx_send_eager_frags,
ompi_free_list_init_new( &mca_btl_mx_component.mx_send_eager_frags,
sizeof(mca_btl_mx_frag_t) + mca_btl_mx_module.super.btl_eager_limit,
CACHE_LINE_SIZE,
OBJ_CLASS(mca_btl_mx_frag_t),
0,CACHE_LINE_SIZE,
mca_btl_mx_component.mx_free_list_num,
mca_btl_mx_component.mx_free_list_max,
mca_btl_mx_component.mx_free_list_inc,
NULL ); /* use default allocator */
ompi_free_list_init( &mca_btl_mx_component.mx_send_user_frags,
ompi_free_list_init_init( &mca_btl_mx_component.mx_send_user_frags,
sizeof(mca_btl_mx_frag_t),
CACHE_LINE_SIZE,
OBJ_CLASS(mca_btl_mx_frag_t),
0,CACHE_LINE_SIZE,
mca_btl_mx_component.mx_free_list_num,
mca_btl_mx_component.mx_free_list_max,
mca_btl_mx_component.mx_free_list_inc,

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

@ -546,7 +546,7 @@ int mca_btl_ud_module_init(mca_btl_ud_module_t *ud_btl)
struct ibv_recv_wr* bad_wr;
mca_btl_ud_frag_t* frag;
ompi_free_list_item_t* item;
uint32_t length;
uint32_t length,length_payload;
int32_t rc, i;
ud_btl->sd_wqe = mca_btl_ofud_component.sd_num;
@ -605,17 +605,25 @@ int mca_btl_ud_module_init(mca_btl_ud_module_t *ud_btl)
length = sizeof(mca_btl_ud_frag_t) + sizeof(mca_btl_ud_header_t) +
ud_btl->super.btl_eager_limit + 2 * MCA_BTL_IB_FRAG_ALIGN;
ompi_free_list_init(&ud_btl->recv_frags,
length_payload=sizeof(mca_btl_ud_frag_t) + sizeof(mca_btl_ud_header_t) +
ud_btl->super.btl_eager_limit + 2 * MCA_BTL_IB_FRAG_ALIGN -
sizeof(mca_btl_ud_recv_frag_t);
ompi_free_list_init_new(&ud_btl->recv_frags,
length + sizeof(mca_btl_ud_ib_header_t),
CACHE_LINE_SIZE,
OBJ_CLASS(mca_btl_ud_recv_frag_t),
length_payload,CACHE_LINE_SIZE,
mca_btl_ofud_component.rd_num,
mca_btl_ofud_component.rd_num,
mca_btl_ofud_component.rd_num,
ud_btl->super.btl_mpool);
#if 0
ompi_free_list_init(&ud_btl->recv_frags,
ompi_free_list_init_new(&ud_btl->recv_frags,
length + sizeof(mca_btl_ud_ib_header_t),
CACHE_LINE_SIZE,
OBJ_CLASS(mca_btl_ud_recv_frag_t),
length_payload,CACHE_LINE_SIZE,
mca_btl_ofud_component.rd_num_init,
mca_btl_ofud_component.rd_num_max,
mca_btl_ofud_component.rd_num_inc,
@ -648,9 +656,11 @@ int mca_btl_ud_module_init(mca_btl_ud_module_t *ud_btl)
OBJ_CONSTRUCT(&ud_btl->send_frags, ompi_free_list_t);
OBJ_CONSTRUCT(&ud_btl->user_frags, ompi_free_list_t);
ompi_free_list_init(&ud_btl->send_frags,
ompi_free_list_init_new(&ud_btl->send_frags,
length,
CACHE_LINE_SIZE,
OBJ_CLASS(mca_btl_ud_send_frag_t),
length_payload,CACHE_LINE_SIZE,
mca_btl_ofud_component.sd_num >> 1,
-1,
mca_btl_ofud_component.sd_num << 2,
@ -660,9 +670,15 @@ int mca_btl_ud_module_init(mca_btl_ud_module_t *ud_btl)
length = sizeof(mca_btl_ud_frag_t) +
sizeof(mca_btl_ud_header_t) + 2 * MCA_BTL_IB_FRAG_ALIGN;
ompi_free_list_init(&ud_btl->user_frags,
length_paylod = sizeof(mca_btl_ud_frag_t) +
sizeof(mca_btl_ud_header_t) + 2 * MCA_BTL_IB_FRAG_ALIGN-
sizeof(mca_btl_ud_user_frag_t);
ompi_free_list_init_new(&ud_btl->user_frags,
length,
CACHE_LINE_SIZE,
OBJ_CLASS(mca_btl_ud_user_frag_t),
length_payload,CACHE_LINE_SIZE,
mca_btl_ofud_component.sd_num >> 1,
-1,
mca_btl_ofud_component.sd_num << 2,

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

@ -245,29 +245,35 @@ mca_btl_portals_component_init(int *num_btls,
OBJ_CONSTRUCT(&(mca_btl_portals_module.portals_frag_user), ompi_free_list_t);
/* eager frags */
ompi_free_list_init(&(mca_btl_portals_module.portals_frag_eager),
ompi_free_list_init_new(&(mca_btl_portals_module.portals_frag_eager),
sizeof(mca_btl_portals_frag_eager_t) +
mca_btl_portals_module.super.btl_eager_limit,
CACHE_LINE_SIZE,
OBJ_CLASS(mca_btl_portals_frag_eager_t),
0,CACHE_LINE_SIZE,
mca_btl_portals_component.portals_free_list_init_num,
mca_btl_portals_component.portals_free_list_eager_max_num,
mca_btl_portals_component.portals_free_list_inc_num,
NULL);
/* send frags */
ompi_free_list_init(&(mca_btl_portals_module.portals_frag_max),
ompi_free_list_init_new(&(mca_btl_portals_module.portals_frag_max),
sizeof(mca_btl_portals_frag_max_t) +
mca_btl_portals_module.super.btl_max_send_size,
CACHE_LINE_SIZE,
OBJ_CLASS(mca_btl_portals_frag_max_t),
0,CACHE_LINE_SIZE,
mca_btl_portals_component.portals_free_list_init_num,
mca_btl_portals_component.portals_free_list_max_num,
mca_btl_portals_component.portals_free_list_inc_num,
NULL);
/* user frags */
ompi_free_list_init(&(mca_btl_portals_module.portals_frag_user),
ompi_free_list_init_new(&(mca_btl_portals_module.portals_frag_user),
sizeof(mca_btl_portals_frag_user_t),
CACHE_LINE_SIZE,
OBJ_CLASS(mca_btl_portals_frag_user_t),
0,CACHE_LINE_SIZE,
mca_btl_portals_component.portals_free_list_init_num,
mca_btl_portals_component.portals_free_list_max_num,
mca_btl_portals_component.portals_free_list_inc_num,

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

@ -144,23 +144,29 @@ mca_btl_base_module_t** mca_btl_self_component_init( int *num_btls,
}
/* initialize free lists */
ompi_free_list_init( &mca_btl_self_component.self_frags_eager,
ompi_free_list_init_new( &mca_btl_self_component.self_frags_eager,
sizeof(mca_btl_self_frag_eager_t) + mca_btl_self.btl_eager_limit,
CACHE_LINE_SIZE,
OBJ_CLASS(mca_btl_self_frag_eager_t),
0,CACHE_LINE_SIZE,
mca_btl_self_component.free_list_num,
mca_btl_self_component.free_list_max,
mca_btl_self_component.free_list_inc,
NULL );
ompi_free_list_init( &mca_btl_self_component.self_frags_send,
ompi_free_list_init_new( &mca_btl_self_component.self_frags_send,
sizeof(mca_btl_self_frag_send_t) + mca_btl_self.btl_max_send_size,
CACHE_LINE_SIZE,
OBJ_CLASS(mca_btl_self_frag_send_t),
0,CACHE_LINE_SIZE,
mca_btl_self_component.free_list_num,
mca_btl_self_component.free_list_max,
mca_btl_self_component.free_list_inc,
NULL );
ompi_free_list_init( &mca_btl_self_component.self_frags_rdma,
ompi_free_list_init_new( &mca_btl_self_component.self_frags_rdma,
sizeof(mca_btl_self_frag_rdma_t),
CACHE_LINE_SIZE,
OBJ_CLASS(mca_btl_self_frag_rdma_t),
0,CACHE_LINE_SIZE,
mca_btl_self_component.free_list_num,
mca_btl_self_component.free_list_max,
mca_btl_self_component.free_list_inc,

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

@ -136,7 +136,7 @@ int mca_btl_sm_add_procs(
ompi_bitmap_t* reachability)
{
int return_code = OMPI_SUCCESS, cnt, len;
size_t size, length;
size_t size, length, length_payload;
int32_t n_local_procs, proc, j, n_to_allocate, i;
ompi_proc_t* my_proc; /* pointer to caller's proc structure */
mca_btl_sm_t *btl_sm;
@ -551,27 +551,35 @@ int mca_btl_sm_add_procs(
/* initialize fragment descriptor free lists */
/* allocation will be for the fragment descriptor and payload buffer */
length = sizeof(mca_btl_sm_frag1_t) + sizeof(mca_btl_sm_hdr_t) +
length = sizeof(mca_btl_sm_frag1_t);
length_payload = sizeof(mca_btl_sm_hdr_t) +
mca_btl_sm_component.eager_limit;
ompi_free_list_init(&mca_btl_sm_component.sm_frags1, length,
ompi_free_list_init_new(&mca_btl_sm_component.sm_frags1, length,
CACHE_LINE_SIZE,
OBJ_CLASS(mca_btl_sm_frag1_t),
length_payload,CACHE_LINE_SIZE,
mca_btl_sm_component.sm_free_list_num,
mca_btl_sm_component.sm_free_list_max,
mca_btl_sm_component.sm_free_list_inc,
mca_btl_sm_component.sm_mpool); /* use shared-memory pool */
length = sizeof(mca_btl_sm_frag2_t) + sizeof(mca_btl_sm_hdr_t) +
length = sizeof(mca_btl_sm_frag2_t);
length_payload = sizeof(mca_btl_sm_hdr_t) +
mca_btl_sm_component.max_frag_size;
ompi_free_list_init(&mca_btl_sm_component.sm_frags2, length,
ompi_free_list_init_new(&mca_btl_sm_component.sm_frags2, length,
CACHE_LINE_SIZE,
OBJ_CLASS(mca_btl_sm_frag2_t),
length_payload,CACHE_LINE_SIZE,
mca_btl_sm_component.sm_free_list_num,
mca_btl_sm_component.sm_free_list_max,
mca_btl_sm_component.sm_free_list_inc,
mca_btl_sm_component.sm_mpool); /* use shared-memory pool */
ompi_free_list_init(&mca_btl_sm_component.sm_frags,
ompi_free_list_init_new(&mca_btl_sm_component.sm_frags,
sizeof(mca_btl_sm_frag_t),
CACHE_LINE_SIZE,
OBJ_CLASS(mca_btl_sm_frag_t),
0,CACHE_LINE_SIZE,
mca_btl_sm_component.sm_free_list_num,
-1,
mca_btl_sm_component.sm_free_list_inc,

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

@ -784,27 +784,33 @@ mca_btl_base_module_t** mca_btl_tcp_component_init(int *num_btl_modules,
*num_btl_modules = 0;
/* initialize free lists */
ompi_free_list_init( &mca_btl_tcp_component.tcp_frag_eager,
ompi_free_list_init_new( &mca_btl_tcp_component.tcp_frag_eager,
sizeof (mca_btl_tcp_frag_eager_t) +
mca_btl_tcp_module.super.btl_eager_limit,
CACHE_LINE_SIZE,
OBJ_CLASS (mca_btl_tcp_frag_eager_t),
0,CACHE_LINE_SIZE,
mca_btl_tcp_component.tcp_free_list_num,
mca_btl_tcp_component.tcp_free_list_max,
mca_btl_tcp_component.tcp_free_list_inc,
NULL );
ompi_free_list_init( &mca_btl_tcp_component.tcp_frag_max,
ompi_free_list_init_new( &mca_btl_tcp_component.tcp_frag_max,
sizeof (mca_btl_tcp_frag_max_t) +
mca_btl_tcp_module.super.btl_max_send_size,
CACHE_LINE_SIZE,
OBJ_CLASS (mca_btl_tcp_frag_max_t),
0,CACHE_LINE_SIZE,
mca_btl_tcp_component.tcp_free_list_num,
mca_btl_tcp_component.tcp_free_list_max,
mca_btl_tcp_component.tcp_free_list_inc,
NULL );
ompi_free_list_init( &mca_btl_tcp_component.tcp_frag_user,
ompi_free_list_init_new( &mca_btl_tcp_component.tcp_frag_user,
sizeof (mca_btl_tcp_frag_user_t),
CACHE_LINE_SIZE,
OBJ_CLASS (mca_btl_tcp_frag_user_t),
0,CACHE_LINE_SIZE,
mca_btl_tcp_component.tcp_free_list_num,
mca_btl_tcp_component.tcp_free_list_max,
mca_btl_tcp_component.tcp_free_list_inc,

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

@ -103,9 +103,11 @@ int mca_io_base_request_create_freelist(void)
i = mca_base_param_find("io", NULL, "base_freelist_increment");
mca_base_param_lookup_int(i, &incr);
ompi_free_list_init(&mca_io_base_requests,
ompi_free_list_init_new(&mca_io_base_requests,
sizeof(mca_io_base_request_t) + size,
CACHE_LINE_SIZE,
OBJ_CLASS(mca_io_base_request_t),
0,CACHE_LINE_SIZE,
init, -1, incr,
NULL);

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

@ -75,8 +75,12 @@ int mca_mpool_base_tree_init(void) {
OBJ_CONSTRUCT(&mca_mpool_base_tree, ompi_rb_tree_t);
OBJ_CONSTRUCT(&mca_mpool_base_tree_item_free_list, ompi_free_list_t);
OBJ_CONSTRUCT(&tree_lock, opal_mutex_t);
rc = ompi_free_list_init(&mca_mpool_base_tree_item_free_list, sizeof(mca_mpool_base_tree_item_t),
OBJ_CLASS(mca_mpool_base_tree_item_t), 0, -1 , 4, NULL);
rc = ompi_free_list_init_new(&mca_mpool_base_tree_item_free_list,
sizeof(mca_mpool_base_tree_item_t),
CACHE_LINE_SIZE,
OBJ_CLASS(mca_mpool_base_tree_item_t),
0,CACHE_LINE_SIZE,
0, -1 , 4, NULL);
if(OMPI_SUCCESS == rc) {
rc = ompi_rb_tree_init(&mca_mpool_base_tree, mca_mpool_base_tree_node_compare);
}

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

@ -55,9 +55,11 @@ void mca_mpool_rdma_module_init(mca_mpool_rdma_module_t* mpool)
mpool->super.flags = MCA_MPOOL_FLAGS_MPI_ALLOC_MEM;
OBJ_CONSTRUCT(&mpool->reg_list, ompi_free_list_t);
ompi_free_list_init(&mpool->reg_list, mpool->resources.sizeof_reg,
OBJ_CLASS(mca_mpool_base_registration_t), 0, -1, 32,
NULL);
ompi_free_list_init_new(&mpool->reg_list, mpool->resources.sizeof_reg,
CACHE_LINE_SIZE,
OBJ_CLASS(mca_mpool_base_registration_t),
0,CACHE_LINE_SIZE,
0, -1, 32, NULL);
OBJ_CONSTRUCT(&mpool->mru_list, opal_list_t);
mpool->stat_cache_hit = mpool->stat_cache_miss = mpool->stat_evicted = 0;
mpool->stat_cache_found = mpool->stat_cache_notfound = 0;

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

@ -140,9 +140,11 @@ ompi_mtl_portals_component_init(bool enable_progress_threads,
}
OBJ_CONSTRUCT(&ompi_mtl_portals.event_fl, ompi_free_list_t);
ompi_free_list_init(&ompi_mtl_portals.event_fl,
ompi_free_list_init_new(&ompi_mtl_portals.event_fl,
sizeof(ompi_mtl_portals_event_t),
CACHE_LINE_SIZE,
OBJ_CLASS(ompi_mtl_portals_event_t),
0,CACHE_LINE_SIZE,
1, -1, 1, NULL);
OBJ_CONSTRUCT(&ompi_mtl_portals.ptl_recv_short_blocks, opal_list_t);

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

@ -56,17 +56,21 @@ mca_pml_cm_enable(bool enable)
{
/* BWB - FIX ME - need to have this actually do something,
maybe? */
ompi_free_list_init(&mca_pml_base_send_requests,
ompi_free_list_init_new(&mca_pml_base_send_requests,
sizeof(mca_pml_cm_hvy_send_request_t) + ompi_mtl->mtl_request_size,
CACHE_LINE_SIZE,
OBJ_CLASS(mca_pml_cm_hvy_send_request_t),
0,CACHE_LINE_SIZE,
ompi_pml_cm.free_list_num,
ompi_pml_cm.free_list_max,
ompi_pml_cm.free_list_inc,
NULL);
ompi_free_list_init(&mca_pml_base_recv_requests,
ompi_free_list_init_new(&mca_pml_base_recv_requests,
sizeof(mca_pml_cm_hvy_recv_request_t) + ompi_mtl->mtl_request_size,
CACHE_LINE_SIZE,
OBJ_CLASS(mca_pml_cm_hvy_recv_request_t),
0,CACHE_LINE_SIZE,
ompi_pml_cm.free_list_num,
ompi_pml_cm.free_list_max,
ompi_pml_cm.free_list_inc,

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

@ -143,9 +143,11 @@ mca_pml_base_module_t* mca_pml_crcpw_component_init(int* priority,
"pml:crcpw: component_init: Initalize Wrapper");
OBJ_CONSTRUCT(&pml_state_list, ompi_free_list_t);
ompi_free_list_init( &pml_state_list,
ompi_free_list_init_new( &pml_state_list,
sizeof(ompi_crcp_base_pml_state_t),
CACHE_LINE_SIZE,
OBJ_CLASS(ompi_crcp_base_pml_state_t),
0,CACHE_LINE_SIZE,
5, /* Initial number */
-1, /* Max = Unlimited */
64, /* Increment by */

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

@ -70,17 +70,21 @@ int mca_pml_dr_enable(bool enable)
if( false == enable ) return OMPI_SUCCESS;
/* requests */
ompi_free_list_init( &mca_pml_base_send_requests,
ompi_free_list_init_new( &mca_pml_base_send_requests,
sizeof(mca_pml_dr_send_request_t),
CACHE_LINE_SIZE,
OBJ_CLASS(mca_pml_dr_send_request_t),
0,CACHE_LINE_SIZE,
mca_pml_dr.free_list_num,
mca_pml_dr.free_list_max,
mca_pml_dr.free_list_inc,
NULL );
ompi_free_list_init( &mca_pml_base_recv_requests,
ompi_free_list_init_new( &mca_pml_base_recv_requests,
sizeof(mca_pml_dr_recv_request_t),
CACHE_LINE_SIZE,
OBJ_CLASS(mca_pml_dr_recv_request_t),
0,CACHE_LINE_SIZE,
mca_pml_dr.free_list_num,
mca_pml_dr.free_list_max,
mca_pml_dr.free_list_inc,
@ -88,18 +92,22 @@ int mca_pml_dr_enable(bool enable)
/* fragments */
OBJ_CONSTRUCT(&mca_pml_dr.recv_frags, ompi_free_list_t);
ompi_free_list_init( &mca_pml_dr.recv_frags,
ompi_free_list_init_new( &mca_pml_dr.recv_frags,
sizeof(mca_pml_dr_recv_frag_t),
CACHE_LINE_SIZE,
OBJ_CLASS(mca_pml_dr_recv_frag_t),
0,CACHE_LINE_SIZE,
mca_pml_dr.free_list_num,
mca_pml_dr.free_list_max,
mca_pml_dr.free_list_inc,
NULL );
OBJ_CONSTRUCT(&mca_pml_dr.vfrags, ompi_free_list_t);
ompi_free_list_init( &mca_pml_dr.vfrags,
ompi_free_list_init_new( &mca_pml_dr.vfrags,
sizeof(mca_pml_dr_vfrag_t),
CACHE_LINE_SIZE,
OBJ_CLASS(mca_pml_dr_vfrag_t),
0,CACHE_LINE_SIZE,
mca_pml_dr.free_list_num,
mca_pml_dr.free_list_max,
mca_pml_dr.free_list_inc,
@ -207,10 +215,12 @@ int mca_pml_dr_add_procs(ompi_proc_t** procs, size_t nprocs)
if(OMPI_SUCCESS != rc)
return rc;
ompi_free_list_init(
ompi_free_list_init_new(
&mca_pml_dr.buffers,
sizeof(mca_pml_dr_buffer_t) + mca_pml_dr.eager_limit,
CACHE_LINE_SIZE,
OBJ_CLASS(mca_pml_dr_buffer_t),
0,CACHE_LINE_SIZE,
0,
mca_pml_dr.free_list_max,
mca_pml_dr.free_list_inc,

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

@ -81,9 +81,11 @@ int mca_pml_ob1_enable(bool enable)
/* fragments */
OBJ_CONSTRUCT(&mca_pml_ob1.rdma_frags, ompi_free_list_t);
ompi_free_list_init( &mca_pml_ob1.rdma_frags,
ompi_free_list_init_new( &mca_pml_ob1.rdma_frags,
sizeof(mca_pml_ob1_rdma_frag_t),
CACHE_LINE_SIZE,
OBJ_CLASS(mca_pml_ob1_rdma_frag_t),
0,CACHE_LINE_SIZE,
mca_pml_ob1.free_list_num,
mca_pml_ob1.free_list_max,
mca_pml_ob1.free_list_inc,
@ -91,18 +93,22 @@ int mca_pml_ob1_enable(bool enable)
OBJ_CONSTRUCT(&mca_pml_ob1.recv_frags, ompi_free_list_t);
ompi_free_list_init( &mca_pml_ob1.recv_frags,
ompi_free_list_init_new( &mca_pml_ob1.recv_frags,
sizeof(mca_pml_ob1_recv_frag_t) + mca_pml_ob1.unexpected_limit,
CACHE_LINE_SIZE,
OBJ_CLASS(mca_pml_ob1_recv_frag_t),
0,CACHE_LINE_SIZE,
mca_pml_ob1.free_list_num,
mca_pml_ob1.free_list_max,
mca_pml_ob1.free_list_inc,
NULL );
OBJ_CONSTRUCT(&mca_pml_ob1.pending_pckts, ompi_free_list_t);
ompi_free_list_init( &mca_pml_ob1.pending_pckts,
ompi_free_list_init_new( &mca_pml_ob1.pending_pckts,
sizeof(mca_pml_ob1_pckt_pending_t),
CACHE_LINE_SIZE,
OBJ_CLASS(mca_pml_ob1_pckt_pending_t),
0,CACHE_LINE_SIZE,
mca_pml_ob1.free_list_num,
mca_pml_ob1.free_list_max,
mca_pml_ob1.free_list_inc,
@ -111,10 +117,12 @@ int mca_pml_ob1_enable(bool enable)
OBJ_CONSTRUCT(&mca_pml_ob1.buffers, ompi_free_list_t);
OBJ_CONSTRUCT(&mca_pml_ob1.send_ranges, ompi_free_list_t);
ompi_free_list_init( &mca_pml_ob1.send_ranges,
ompi_free_list_init_new( &mca_pml_ob1.send_ranges,
sizeof(mca_pml_ob1_send_range_t) +
(mca_pml_ob1.max_send_per_range - 1) * sizeof(mca_pml_ob1_com_btl_t),
CACHE_LINE_SIZE,
OBJ_CLASS(mca_pml_ob1_send_range_t),
0,CACHE_LINE_SIZE,
mca_pml_ob1.free_list_num,
mca_pml_ob1.free_list_max,
mca_pml_ob1.free_list_inc,
@ -131,21 +139,25 @@ int mca_pml_ob1_enable(bool enable)
* should get ownership for the send and receive requests list, and
* initialize them with the size of our own requests.
*/
ompi_free_list_init( &mca_pml_base_send_requests,
ompi_free_list_init_new( &mca_pml_base_send_requests,
sizeof(mca_pml_ob1_send_request_t) +
(mca_pml_ob1.max_rdma_per_request - 1) *
sizeof(mca_pml_ob1_com_btl_t),
CACHE_LINE_SIZE,
OBJ_CLASS(mca_pml_ob1_send_request_t),
0,CACHE_LINE_SIZE,
mca_pml_ob1.free_list_num,
mca_pml_ob1.free_list_max,
mca_pml_ob1.free_list_inc,
NULL );
ompi_free_list_init( &mca_pml_base_recv_requests,
ompi_free_list_init_new( &mca_pml_base_recv_requests,
sizeof(mca_pml_ob1_recv_request_t) +
(mca_pml_ob1.max_rdma_per_request - 1) *
sizeof(mca_pml_ob1_com_btl_t),
CACHE_LINE_SIZE,
OBJ_CLASS(mca_pml_ob1_recv_request_t),
0,CACHE_LINE_SIZE,
mca_pml_ob1.free_list_num,
mca_pml_ob1.free_list_max,
mca_pml_ob1.free_list_inc,

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

@ -99,9 +99,11 @@ static mca_vprotocol_base_module_t *mca_vprotocol_pessimist_component_init( int*
OBJ_CONSTRUCT(&mca_vprotocol_pessimist.replay_events, opal_list_t);
OBJ_CONSTRUCT(&mca_vprotocol_pessimist.pending_events, opal_list_t);
OBJ_CONSTRUCT(&mca_vprotocol_pessimist.events_pool, ompi_free_list_t);
ompi_free_list_init(&mca_vprotocol_pessimist.events_pool,
ompi_free_list_init_new(&mca_vprotocol_pessimist.events_pool,
sizeof(mca_vprotocol_pessimist_event_t),
CACHE_LINE_SIZE,
OBJ_CLASS(mca_vprotocol_pessimist_event_t),
0,CACHE_LINE_SIZE,
_free_list_num,
_free_list_max,
_free_list_inc,

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

@ -34,8 +34,12 @@ int mca_rcache_rb_tree_node_compare(void * key1, void * key2);
int mca_rcache_rb_tree_init(mca_rcache_rb_module_t* rcache) {
OBJ_CONSTRUCT(&rcache->rb_tree, ompi_rb_tree_t);
OBJ_CONSTRUCT(&rcache->rb_tree_item_list, ompi_free_list_t);
ompi_free_list_init(&rcache->rb_tree_item_list, sizeof(mca_rcache_rb_tree_item_t),
OBJ_CLASS(mca_rcache_rb_tree_item_t), 0, -1, 32, NULL);
ompi_free_list_init_new(&rcache->rb_tree_item_list,
sizeof(mca_rcache_rb_tree_item_t),
CACHE_LINE_SIZE,
OBJ_CLASS(mca_rcache_rb_tree_item_t),
0,CACHE_LINE_SIZE,
0, -1, 32, NULL);
return ompi_rb_tree_init(&rcache->rb_tree,
mca_rcache_rb_tree_node_compare);

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

@ -314,8 +314,11 @@ void test2(void)
struct timeval start, end;
OBJ_CONSTRUCT(&key_list, ompi_free_list_t);
ompi_free_list_init(&key_list, sizeof(ompi_test_rb_value_t),
OBJ_CLASS(ompi_test_rb_value_t), 0, -1 , 128, NULL);
ompi_free_list_init_new(&key_list, sizeof(ompi_test_rb_value_t),
CACHE_LINE_SIZE,
OBJ_CLASS(ompi_test_rb_value_t),
0,CACHE_LINE_SIZE,
0, -1 , 128, NULL);
OBJ_CONSTRUCT(&tree, ompi_rb_tree_t);
rc = ompi_rb_tree_init(&tree, mem_node_compare);