diff --git a/ompi/communicator/comm_request.c b/ompi/communicator/comm_request.c index 51274703fa..c816cd9dd9 100644 --- a/ompi/communicator/comm_request.c +++ b/ompi/communicator/comm_request.c @@ -32,7 +32,7 @@ static int ompi_comm_request_progress (void); void ompi_comm_request_init (void) { OBJ_CONSTRUCT(&ompi_comm_requests, opal_free_list_t); - (void) opal_free_list_init (&ompi_comm_requests, sizeof (ompi_comm_request_t), + (void) opal_free_list_init (&ompi_comm_requests, sizeof (ompi_comm_request_t), 8, OBJ_CLASS(ompi_comm_request_t), 0, 0, 0, -1, 8, NULL, 0, NULL, NULL, NULL); diff --git a/ompi/debuggers/ompi_common_dll.c b/ompi/debuggers/ompi_common_dll.c index 89843da3da..4a9930df0a 100644 --- a/ompi/debuggers/ompi_common_dll.c +++ b/ompi/debuggers/ompi_common_dll.c @@ -1,3 +1,4 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2007-2014 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2004-2013 The University of Tennessee and The University @@ -8,6 +9,8 @@ * Copyright (c) 2014 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2014 Intel, Inc. All rights reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -76,7 +79,7 @@ static int host_is_big_endian = 0; * internal objects. We have to make sure we're able to find all of * them in the image and compute their ofset in order to be able to * parse them later. We need to find the opal_list_item_t, the - * opal_list_t, the ompi_free_list_item_t, and the ompi_free_list_t. + * opal_list_t, the opal_free_list_item_t, and the opal_free_list_t. * * Once we have these offsets, we should make sure that we have access * to all requests lists and types. We're looking here only at the @@ -111,41 +114,41 @@ int ompi_fill_in_type_info(mqs_image *image, char **message) qh_type, opal_list_t, opal_list_sentinel); } { - mqs_type* qh_type = mqs_find_type( image, "ompi_free_list_item_t", mqs_lang_c ); + mqs_type* qh_type = mqs_find_type( image, "opal_free_list_item_t", mqs_lang_c ); if( !qh_type ) { - missing_in_action = "ompi_free_list_item_t"; + missing_in_action = "opal_free_list_item_t"; goto type_missing; } /* This is just an overloaded opal_list_item_t */ - i_info->ompi_free_list_item_t.type = qh_type; - i_info->ompi_free_list_item_t.size = mqs_sizeof(qh_type); + i_info->opal_free_list_item_t.type = qh_type; + i_info->opal_free_list_item_t.size = mqs_sizeof(qh_type); } { - mqs_type* qh_type = mqs_find_type( image, "ompi_free_list_t", mqs_lang_c ); + mqs_type* qh_type = mqs_find_type( image, "opal_free_list_t", mqs_lang_c ); if( !qh_type ) { - missing_in_action = "ompi_free_list_t"; + missing_in_action = "opal_free_list_t"; goto type_missing; } - i_info->ompi_free_list_t.type = qh_type; - i_info->ompi_free_list_t.size = mqs_sizeof(qh_type); - ompi_field_offset(i_info->ompi_free_list_t.offset.fl_mpool, - qh_type, ompi_free_list_t, fl_mpool); - ompi_field_offset(i_info->ompi_free_list_t.offset.fl_allocations, - qh_type, ompi_free_list_t, fl_allocations); - ompi_field_offset(i_info->ompi_free_list_t.offset.fl_frag_class, - qh_type, ompi_free_list_t, fl_frag_class); - ompi_field_offset(i_info->ompi_free_list_t.offset.fl_frag_size, - qh_type, ompi_free_list_t, fl_frag_size); - ompi_field_offset(i_info->ompi_free_list_t.offset.fl_frag_alignment, - qh_type, ompi_free_list_t, fl_frag_alignment); - ompi_field_offset(i_info->ompi_free_list_t.offset.fl_max_to_alloc, - qh_type, ompi_free_list_t, fl_max_to_alloc); - ompi_field_offset(i_info->ompi_free_list_t.offset.fl_num_per_alloc, - qh_type, ompi_free_list_t, fl_num_per_alloc); - ompi_field_offset(i_info->ompi_free_list_t.offset.fl_num_allocated, - qh_type, ompi_free_list_t, fl_num_allocated); + i_info->opal_free_list_t.type = qh_type; + i_info->opal_free_list_t.size = mqs_sizeof(qh_type); + ompi_field_offset(i_info->opal_free_list_t.offset.fl_mpool, + qh_type, opal_free_list_t, fl_mpool); + ompi_field_offset(i_info->opal_free_list_t.offset.fl_allocations, + qh_type, opal_free_list_t, fl_allocations); + ompi_field_offset(i_info->opal_free_list_t.offset.fl_frag_class, + qh_type, opal_free_list_t, fl_frag_class); + ompi_field_offset(i_info->opal_free_list_t.offset.fl_frag_size, + qh_type, opal_free_list_t, fl_frag_size); + ompi_field_offset(i_info->opal_free_list_t.offset.fl_frag_alignment, + qh_type, opal_free_list_t, fl_frag_alignment); + ompi_field_offset(i_info->opal_free_list_t.offset.fl_max_to_alloc, + qh_type, opal_free_list_t, fl_max_to_alloc); + ompi_field_offset(i_info->opal_free_list_t.offset.fl_num_per_alloc, + qh_type, opal_free_list_t, fl_num_per_alloc); + ompi_field_offset(i_info->opal_free_list_t.offset.fl_num_allocated, + qh_type, opal_free_list_t, fl_num_allocated); } { mqs_type* qh_type = mqs_find_type( image, "opal_hash_table_t", mqs_lang_c ); diff --git a/ompi/debuggers/ompi_common_dll_defs.h b/ompi/debuggers/ompi_common_dll_defs.h index edb143933c..527b7fee4c 100644 --- a/ompi/debuggers/ompi_common_dll_defs.h +++ b/ompi/debuggers/ompi_common_dll_defs.h @@ -1,9 +1,12 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2007-2014 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2004-2013 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2012-2013 Inria. All rights reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -65,7 +68,7 @@ typedef struct struct { mqs_type *type; int size; - } ompi_free_list_item_t; + } opal_free_list_item_t; struct { mqs_type *type; int size; @@ -79,7 +82,7 @@ typedef struct int fl_num_per_alloc; /* size_t */ int fl_num_allocated; /* size_t */ } offset; - } ompi_free_list_t; + } opal_free_list_t; struct { mqs_type *type; int size; diff --git a/ompi/debuggers/ompi_debuggers.c b/ompi/debuggers/ompi_debuggers.c index 4f07bb71ca..8d5177c179 100644 --- a/ompi/debuggers/ompi_debuggers.c +++ b/ompi/debuggers/ompi_debuggers.c @@ -1,4 +1,4 @@ -/* -*- Mode: C; c-basic-offset:4 ; -*- */ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology @@ -11,8 +11,8 @@ * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * Copyright (c) 2007-2011 Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2012 Los Alamos National Security, LLC. - * All rights reserved. + * Copyright (c) 2012-2015 Los Alamos National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -62,7 +62,7 @@ * debuggers will be unable to initialize the Open MPI debug library. */ #include "opal/class/opal_list.h" -#include "opal/class/ompi_free_list.h" +#include "opal/class/opal_free_list.h" #include "ompi/request/request.h" #include "ompi/mca/pml/base/pml_base_request.h" #include "ompi/mca/pml/base/pml_base_sendreq.h" @@ -110,8 +110,8 @@ OMPI_DECLSPEC int MPIR_debug_typedefs_sizeof[] = { */ OMPI_DECLSPEC opal_list_item_t* opal_list_item_t_type_force_inclusion = NULL; OMPI_DECLSPEC opal_list_t* opal_list_t_type_force_inclusion = NULL; -OMPI_DECLSPEC ompi_free_list_item_t* ompi_free_list_item_t_type_force_inclusion = NULL; -OMPI_DECLSPEC ompi_free_list_t* ompi_free_list_t_type_force_inclusion = NULL; +OMPI_DECLSPEC opal_free_list_item_t* opal_free_list_item_t_type_force_inclusion = NULL; +OMPI_DECLSPEC opal_free_list_t* opal_free_list_t_type_force_inclusion = NULL; OMPI_DECLSPEC ompi_request_t* ompi_request_t_type_force_inclusion = NULL; OMPI_DECLSPEC mca_pml_base_request_t* mca_pml_base_request_t_type_force_inclusion = NULL; OMPI_DECLSPEC mca_pml_base_send_request_t* mca_pml_base_send_request_t_type_force_inclusion = NULL; diff --git a/ompi/debuggers/ompi_msgq_dll.c b/ompi/debuggers/ompi_msgq_dll.c index e5b7325065..fabe6cb268 100644 --- a/ompi/debuggers/ompi_msgq_dll.c +++ b/ompi/debuggers/ompi_msgq_dll.c @@ -1,9 +1,12 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2007-2008 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2004-2010 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2008-2009 Sun Microsystems, Inc. All rights reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -860,9 +863,9 @@ static int next_item_opal_list_t( mqs_process *proc, mpi_process_info *p_info, #if defined(CODE_NOT_USED) /** - * Parsing the ompi_free_list lists. + * Parsing the opal_free_list lists. */ -static void ompi_free_list_t_dump_position( mqs_ompi_free_list_t_pos* position ) +static void opal_free_list_t_dump_position( mqs_opal_free_list_t_pos* position ) { printf( "position->opal_list_t_pos.current_item = 0x%llx\n", (long long)position->opal_list_t_pos.current_item ); printf( "position->opal_list_t_pos.list = 0x%llx\n", (long long)position->opal_list_t_pos.list ); @@ -881,8 +884,8 @@ static void ompi_free_list_t_dump_position( mqs_ompi_free_list_t_pos* position ) } #endif /* CODE_NOT_USED */ -static int ompi_free_list_t_init_parser( mqs_process *proc, mpi_process_info *p_info, - mqs_ompi_free_list_t_pos* position, mqs_taddr_t free_list ) +static int opal_free_list_t_init_parser( mqs_process *proc, mpi_process_info *p_info, + mqs_opal_free_list_t_pos* position, mqs_taddr_t free_list ) { mqs_image * image = mqs_get_image (proc); mpi_image_info *i_info = (mpi_image_info *)mqs_get_image_info (image); @@ -891,22 +894,22 @@ static int ompi_free_list_t_init_parser( mqs_process *proc, mpi_process_info *p_ position->free_list = free_list; position->fl_frag_size = - ompi_fetch_size_t( proc, position->free_list + i_info->ompi_free_list_t.offset.fl_frag_size, + ompi_fetch_size_t( proc, position->free_list + i_info->opal_free_list_t.offset.fl_frag_size, p_info ); position->fl_frag_alignment = - ompi_fetch_size_t( proc, position->free_list + i_info->ompi_free_list_t.offset.fl_frag_alignment, + ompi_fetch_size_t( proc, position->free_list + i_info->opal_free_list_t.offset.fl_frag_alignment, p_info ); position->fl_frag_class = - ompi_fetch_pointer( proc, position->free_list + i_info->ompi_free_list_t.offset.fl_frag_class, + ompi_fetch_pointer( proc, position->free_list + i_info->opal_free_list_t.offset.fl_frag_class, p_info ); position->fl_mpool = - ompi_fetch_pointer( proc, position->free_list + i_info->ompi_free_list_t.offset.fl_mpool, + ompi_fetch_pointer( proc, position->free_list + i_info->opal_free_list_t.offset.fl_mpool, p_info ); position->fl_num_per_alloc = - ompi_fetch_size_t( proc, position->free_list + i_info->ompi_free_list_t.offset.fl_num_per_alloc, + ompi_fetch_size_t( proc, position->free_list + i_info->opal_free_list_t.offset.fl_num_per_alloc, p_info ); position->fl_num_allocated = - ompi_fetch_size_t( proc, position->free_list + i_info->ompi_free_list_t.offset.fl_num_allocated, + ompi_fetch_size_t( proc, position->free_list + i_info->opal_free_list_t.offset.fl_num_allocated, p_info ); if( 0 == position->fl_mpool ) { @@ -919,7 +922,7 @@ static int ompi_free_list_t_init_parser( mqs_process *proc, mpi_process_info *p_ position->fl_frag_alignment, mqs_taddr_t ); /** - * Work around the strange ompi_free_list_t way to allocate elements. The first chunk is + * Work around the strange opal_free_list_t way to allocate elements. The first chunk is * not required to have the same size as the others. * A similar work around should be set for the last chunk of allocations too !!! But how * can we solve ONE equation with 2 unknowns ? @@ -931,7 +934,7 @@ static int ompi_free_list_t_init_parser( mqs_process *proc, mpi_process_info *p_ if( 0 == position->fl_num_initial_alloc ) position->fl_num_initial_alloc = position->fl_num_per_alloc; } - DEBUG(VERBOSE_LISTS,("ompi_free_list_t fl_frag_size = %lld fl_header_space = %lld\n" + DEBUG(VERBOSE_LISTS,("opal_free_list_t fl_frag_size = %lld fl_header_space = %lld\n" " fl_frag_alignment = %lld fl_num_per_alloc = %lld\n" " fl_num_allocated = %lld fl_num_initial_alloc = %lld\n" " header_space = %lld\n", @@ -944,7 +947,7 @@ static int ompi_free_list_t_init_parser( mqs_process *proc, mpi_process_info *p_ * Initialize the pointer to the opal_list_t. */ opal_list_t_init_parser( proc, p_info, &position->opal_list_t_pos, - position->free_list + i_info->ompi_free_list_t.offset.fl_allocations ); + position->free_list + i_info->opal_free_list_t.offset.fl_allocations ); next_item_opal_list_t( proc, p_info, &position->opal_list_t_pos, &active_allocation ); DEBUG(VERBOSE_LISTS,("active_allocation 0x%llx header_space %d\n", (long long)active_allocation, (int)position->header_space)); @@ -954,7 +957,7 @@ static int ompi_free_list_t_init_parser( mqs_process *proc, mpi_process_info *p_ /** * Handle alignment issues... */ - active_allocation += i_info->ompi_free_list_item_t.size; + active_allocation += i_info->opal_free_list_item_t.size; active_allocation = OPAL_ALIGN( active_allocation, position->fl_frag_alignment, mqs_taddr_t ); /** @@ -968,15 +971,15 @@ static int ompi_free_list_t_init_parser( mqs_process *proc, mpi_process_info *p_ } position->current_item = active_allocation; - /*ompi_free_list_t_dump_position( position );*/ + /*opal_free_list_t_dump_position( position );*/ return mqs_ok; } /** * Return the current position and move the internal counter to the next element. */ -static int ompi_free_list_t_next_item( mqs_process *proc, mpi_process_info *p_info, - mqs_ompi_free_list_t_pos* position, mqs_taddr_t* active_item ) +static int opal_free_list_t_next_item( mqs_process *proc, mpi_process_info *p_info, + mqs_opal_free_list_t_pos* position, mqs_taddr_t* active_item ) { mqs_image * image = mqs_get_image (proc); mpi_image_info *i_info = (mpi_image_info *)mqs_get_image_info (image); @@ -988,7 +991,7 @@ static int ompi_free_list_t_next_item( mqs_process *proc, mpi_process_info *p_in position->current_item += position->header_space; if( position->current_item >= position->upper_bound ) { - DEBUG(VERBOSE_LISTS,("Reach the end of one of the ompi_free_list_t " + DEBUG(VERBOSE_LISTS,("Reach the end of one of the opal_free_list_t " "allocations. Go to the next one\n")); /* we should go to the next allocation */ next_item_opal_list_t( proc, p_info, @@ -1000,7 +1003,7 @@ static int ompi_free_list_t_next_item( mqs_process *proc, mpi_process_info *p_in /** * Handle alignment issues... */ - active_allocation += i_info->ompi_free_list_item_t.size; + active_allocation += i_info->opal_free_list_item_t.size; active_allocation = OPAL_ALIGN( active_allocation, position->fl_frag_alignment, mqs_taddr_t ); /** @@ -1012,7 +1015,7 @@ static int ompi_free_list_t_next_item( mqs_process *proc, mpi_process_info *p_in DEBUG(VERBOSE_LISTS,("there are more elements in the list " "active_allocation = %llx upper_bound = %llx\n", (long long)active_allocation, (long long)position->upper_bound)); - /*ompi_free_list_t_dump_position( position );*/ + /*opal_free_list_t_dump_position( position );*/ } DEBUG(VERBOSE_LISTS,("Free list actual position 0x%llx next element at 0x%llx\n", (long long)*active_item, (long long)position->current_item)); @@ -1079,7 +1082,7 @@ static int fetch_request( mqs_process *proc, mpi_process_info *p_info, /* If we get a PML request with an internal tag we will jump back here */ rescan_requests: while( 1 ) { - ompi_free_list_t_next_item( proc, p_info, + opal_free_list_t_next_item( proc, p_info, &extra->next_msg, ¤t_item ); if( 0 == current_item ) { DEBUG(VERBOSE_REQ,("no more items in the %s request queue\n", @@ -1239,12 +1242,12 @@ int mqs_setup_operation_iterator (mqs_process *proc, int op) switch (op) { case mqs_pending_sends: DEBUG(VERBOSE_REQ,("setup the send queue iterator\n")); - ompi_free_list_t_init_parser( proc, p_info, &extra->next_msg, extra->send_queue_base ); + opal_free_list_t_init_parser( proc, p_info, &extra->next_msg, extra->send_queue_base ); return mqs_ok; case mqs_pending_receives: DEBUG(VERBOSE_REQ,("setup the receive queue iterator\n")); - ompi_free_list_t_init_parser( proc, p_info, &extra->next_msg, extra->recv_queue_base ); + opal_free_list_t_init_parser( proc, p_info, &extra->next_msg, extra->recv_queue_base ); return mqs_ok; case mqs_unexpected_messages: /* TODO */ diff --git a/ompi/debuggers/ompi_msgq_dll_defs.h b/ompi/debuggers/ompi_msgq_dll_defs.h index e1642ccb68..d9513e8110 100644 --- a/ompi/debuggers/ompi_msgq_dll_defs.h +++ b/ompi/debuggers/ompi_msgq_dll_defs.h @@ -1,8 +1,11 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2007 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2004-2007 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -86,7 +89,7 @@ typedef struct { mqs_tword_t fl_num_per_alloc; /* size_t */ mqs_tword_t fl_num_allocated; /* size_t */ mqs_tword_t fl_num_initial_alloc; /* size_t */ -} mqs_ompi_free_list_t_pos; +} mqs_opal_free_list_t_pos; /* Information for a single process, a list of communicators, some @@ -112,7 +115,7 @@ typedef struct int world_proc_array_entries; mqs_taddr_t* world_proc_array; - mqs_ompi_free_list_t_pos next_msg; /* And state for the message iterator */ + mqs_opal_free_list_t_pos next_msg; /* And state for the message iterator */ mqs_op_class what; /* What queue are we looking on */ } mpi_process_info_extra; diff --git a/ompi/mca/bcol/bcol.h b/ompi/mca/bcol/bcol.h index 73acc5796f..c787606766 100644 --- a/ompi/mca/bcol/bcol.h +++ b/ompi/mca/bcol/bcol.h @@ -2,7 +2,7 @@ /* * Copyright (c) 2009-2012 Oak Ridge National Laboratory. All rights reserved. * Copyright (c) 2009-2012 Mellanox Technologies. All rights reserved. - * Copyright (c) 2013 Los Alamos National Security, LLC. All rights + * Copyright (c) 2013-2015 Los Alamos National Security, LLC. All rights * reserved. * $COPYRIGHT$ * @@ -767,7 +767,7 @@ typedef struct mca_bcol_base_function_t mca_bcol_base_function_t; struct mca_bcol_base_descriptor_t { - ompi_free_list_item_t super; + opal_free_list_item_t super; /* Vasily: will be described in the future */ }; typedef struct mca_bcol_base_descriptor_t mca_bcol_base_descriptor_t; diff --git a/ompi/mca/bcol/ptpcoll/bcol_ptpcoll.h b/ompi/mca/bcol/ptpcoll/bcol_ptpcoll.h index a4301ef178..6a6feda889 100644 --- a/ompi/mca/bcol/ptpcoll/bcol_ptpcoll.h +++ b/ompi/mca/bcol/ptpcoll/bcol_ptpcoll.h @@ -1,6 +1,9 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2009-2012 Oak Ridge National Laboratory. All rights reserved. * Copyright (c) 2009-2012 Mellanox Technologies. All rights reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -74,7 +77,7 @@ struct mca_bcol_ptpcoll_component_t { }; struct mca_bcol_ptpcoll_collreq_t { - ompi_free_list_item_t super; + opal_free_list_item_t super; int tag; int num_reqs; @@ -342,7 +345,7 @@ struct mca_bcol_ptpcoll_module_t { int **allgather_offsets; /* Free lists of outstanding collective operations */ - ompi_free_list_t collreqs_free; + opal_free_list_t collreqs_free; int log_group_size; struct iovec *alltoall_iovec; diff --git a/ompi/mca/bcol/ptpcoll/bcol_ptpcoll_barrier.c b/ompi/mca/bcol/ptpcoll/bcol_ptpcoll_barrier.c index 1baa5ee878..6ad04db6c6 100644 --- a/ompi/mca/bcol/ptpcoll/bcol_ptpcoll_barrier.c +++ b/ompi/mca/bcol/ptpcoll/bcol_ptpcoll_barrier.c @@ -1,9 +1,12 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2009-2012 Oak Ridge National Laboratory. All rights reserved. * Copyright (c) 2009-2012 Mellanox Technologies. All rights reserved. * Copyright (c) 2013 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -51,11 +54,11 @@ static int bcol_ptpcoll_barrier_recurs_knomial_new( **rank_exchanges = my_exchange_node->rank_exchanges; ompi_request_t **requests; - ompi_free_list_item_t *item; + opal_free_list_item_t *item; mca_bcol_ptpcoll_collreq_t *collreq; - OMPI_FREE_LIST_WAIT_MT(&ptpcoll_module->collreqs_free, item); + item = opal_free_list_wait (&ptpcoll_module->collreqs_free); if (OPAL_UNLIKELY(NULL == item)) { PTPCOLL_ERROR(("Free list waiting failed.")); return OMPI_ERR_OUT_OF_RESOURCE; @@ -213,7 +216,7 @@ static int bcol_ptpcoll_barrier_recurs_knomial_new( } } - OMPI_FREE_LIST_RETURN_MT(&ptpcoll_module->collreqs_free, (ompi_free_list_item_t *) collreq); + opal_free_list_return (&ptpcoll_module->collreqs_free, (opal_free_list_item_t *) collreq); return BCOL_FN_COMPLETE; } @@ -382,11 +385,11 @@ static int bcol_ptpcoll_barrier_recurs_knomial_extra_new( int *extra_sources_array = my_exchange_node->rank_extra_sources_array; ompi_request_t **requests; - ompi_free_list_item_t *item; + opal_free_list_item_t *item; mca_bcol_ptpcoll_collreq_t *collreq; - OMPI_FREE_LIST_WAIT_MT(&ptpcoll_module->collreqs_free, item); + item = opal_free_list_wait (&ptpcoll_module->collreqs_free); if (OPAL_UNLIKELY(NULL == item)) { PTPCOLL_ERROR(("Free list waiting failed.")); return OMPI_ERR_OUT_OF_RESOURCE; @@ -440,7 +443,7 @@ static int bcol_ptpcoll_barrier_recurs_knomial_extra_new( return BCOL_FN_STARTED; } - OMPI_FREE_LIST_RETURN_MT(&ptpcoll_module->collreqs_free, (ompi_free_list_item_t *) collreq); + opal_free_list_return (&ptpcoll_module->collreqs_free, (opal_free_list_item_t *) collreq); return BCOL_FN_COMPLETE; } @@ -464,11 +467,11 @@ static int bcol_ptpcoll_barrier_recurs_dbl_new( n_exchange = ptp_module->super.sbgp_partner_module->n_levels_pow2; ompi_request_t **requests; - ompi_free_list_item_t *item; + opal_free_list_item_t *item; mca_bcol_ptpcoll_collreq_t *collreq; - OMPI_FREE_LIST_WAIT_MT(&ptp_module->collreqs_free, item); + item = opal_free_list_wait (&ptp_module->collreqs_free); if (OPAL_UNLIKELY(NULL == item)) { PTPCOLL_ERROR(("Free list waiting failed.")); return OMPI_ERR_OUT_OF_RESOURCE; @@ -618,7 +621,7 @@ static int bcol_ptpcoll_barrier_recurs_dbl_new( } } - OMPI_FREE_LIST_RETURN_MT(&ptp_module->collreqs_free, (ompi_free_list_item_t *) collreq); + opal_free_list_return (&ptp_module->collreqs_free, (opal_free_list_item_t *) collreq); return BCOL_FN_COMPLETE; } @@ -765,7 +768,7 @@ static int bcol_ptpcoll_barrier_recurs_dbl_extra_new( tag, my_extra_partner_comm_rank; ompi_request_t **requests; - ompi_free_list_item_t *item; + opal_free_list_item_t *item; mca_bcol_ptpcoll_collreq_t *collreq; @@ -773,7 +776,7 @@ static int bcol_ptpcoll_barrier_recurs_dbl_extra_new( (mca_bcol_ptpcoll_module_t *) const_args->bcol_module; ompi_communicator_t *comm = ptp_module->super.sbgp_partner_module->group_comm; - OMPI_FREE_LIST_WAIT_MT(&ptp_module->collreqs_free, item); + item = opal_free_list_wait (&ptp_module->collreqs_free); if (OPAL_UNLIKELY(NULL == item)) { PTPCOLL_ERROR(("Free list waiting failed.")); return OMPI_ERR_OUT_OF_RESOURCE; @@ -829,7 +832,7 @@ static int bcol_ptpcoll_barrier_recurs_dbl_extra_new( return BCOL_FN_STARTED; } - OMPI_FREE_LIST_RETURN_MT(&ptp_module->collreqs_free, (ompi_free_list_item_t *) collreq); + opal_free_list_return (&ptp_module->collreqs_free, (opal_free_list_item_t *) collreq); return BCOL_FN_COMPLETE; } diff --git a/ompi/mca/bcol/ptpcoll/bcol_ptpcoll_component.c b/ompi/mca/bcol/ptpcoll/bcol_ptpcoll_component.c index 147adb9d9a..4a7a0ec8ea 100644 --- a/ompi/mca/bcol/ptpcoll/bcol_ptpcoll_component.c +++ b/ompi/mca/bcol/ptpcoll/bcol_ptpcoll_component.c @@ -1,6 +1,9 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2009-2012 Oak Ridge National Laboratory. All rights reserved. * Copyright (c) 2009-2012 Mellanox Technologies. All rights reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -101,7 +104,7 @@ collreq_destruct(mca_bcol_ptpcoll_collreq_t *collreq) } OBJ_CLASS_INSTANCE(mca_bcol_ptpcoll_collreq_t, - ompi_free_list_item_t, + opal_free_list_item_t, collreq_construct, collreq_destruct); diff --git a/ompi/mca/bcol/ptpcoll/bcol_ptpcoll_module.c b/ompi/mca/bcol/ptpcoll/bcol_ptpcoll_module.c index f1d3b8d0c0..ad31bd8ba4 100644 --- a/ompi/mca/bcol/ptpcoll/bcol_ptpcoll_module.c +++ b/ompi/mca/bcol/ptpcoll/bcol_ptpcoll_module.c @@ -2,7 +2,7 @@ /* * Copyright (c) 2009-2013 Oak Ridge National Laboratory. All rights reserved. * Copyright (c) 2009-2012 Mellanox Technologies. All rights reserved. - * Copyright (c) 2012-2014 Los Alamos National Security, LLC. All rights + * Copyright (c) 2012-2015 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2014 Research Organization for Information Science * and Technology (RIST). All rights reserved. @@ -612,7 +612,7 @@ static int load_recursive_knomial_info(mca_bcol_ptpcoll_module_t *ptpcoll_module return rc; } -static void bcol_ptpcoll_collreq_init(ompi_free_list_item_t *item, void* ctx) +static int bcol_ptpcoll_collreq_init(opal_free_list_item_t *item, void* ctx) { mca_bcol_ptpcoll_module_t *ptpcoll_module= (mca_bcol_ptpcoll_module_t *) ctx; mca_bcol_ptpcoll_collreq_t *collreq = (mca_bcol_ptpcoll_collreq_t *) item; @@ -627,6 +627,12 @@ static void bcol_ptpcoll_collreq_init(ompi_free_list_item_t *item, void* ctx) calloc(2 * ptpcoll_module->k_nomial_radix, sizeof(ompi_request_t *)); break; } + + if (NULL == collreq->requests) { + return OPAL_ERR_OUT_OF_RESOURCE; + } + + return OPAL_SUCCESS; } /* query to see if the module is available for use on the given @@ -705,18 +711,18 @@ mca_bcol_base_module_t **mca_bcol_ptpcoll_comm_query(mca_sbgp_base_module_t *sbg } /* creating collfrag free list */ - OBJ_CONSTRUCT(&ptpcoll_module->collreqs_free, ompi_free_list_t); - rc = ompi_free_list_init_ex_new(&ptpcoll_module->collreqs_free, - sizeof(mca_bcol_ptpcoll_collreq_t), - BCOL_PTP_CACHE_LINE_SIZE, - OBJ_CLASS(mca_bcol_ptpcoll_collreq_t), - 0, BCOL_PTP_CACHE_LINE_SIZE, - 256 /* free_list_num */, - -1 /* free_list_max, -1 = infinite */, - 32 /* free_list_inc */, - NULL, - bcol_ptpcoll_collreq_init, - ptpcoll_module); + OBJ_CONSTRUCT(&ptpcoll_module->collreqs_free, opal_free_list_t); + rc = opal_free_list_init (&ptpcoll_module->collreqs_free, + sizeof(mca_bcol_ptpcoll_collreq_t), + BCOL_PTP_CACHE_LINE_SIZE, + OBJ_CLASS(mca_bcol_ptpcoll_collreq_t), + 0, BCOL_PTP_CACHE_LINE_SIZE, + 256 /* free_list_num */, + -1 /* free_list_max, -1 = infinite */, + 32 /* free_list_inc */, + NULL, 0, NULL, + bcol_ptpcoll_collreq_init, + ptpcoll_module); if (OMPI_SUCCESS != rc) { goto CLEANUP; } diff --git a/ompi/mca/coll/hcoll/coll_hcoll.h b/ompi/mca/coll/hcoll/coll_hcoll.h index e2215a4534..440895f22b 100644 --- a/ompi/mca/coll/hcoll/coll_hcoll.h +++ b/ompi/mca/coll/hcoll/coll_hcoll.h @@ -81,7 +81,7 @@ struct mca_coll_hcoll_component_t { /* FCA global stuff */ mca_coll_hcoll_ops_t hcoll_ops; - ompi_free_list_t requests; + opal_free_list_t requests; }; typedef struct mca_coll_hcoll_component_t mca_coll_hcoll_component_t; diff --git a/ompi/mca/coll/hcoll/coll_hcoll_rte.c b/ompi/mca/coll/hcoll/coll_hcoll_rte.c index cc768cfa6e..1866b405ec 100644 --- a/ompi/mca/coll/hcoll/coll_hcoll_rte.c +++ b/ompi/mca/coll/hcoll/coll_hcoll_rte.c @@ -1,9 +1,12 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2009-2012 Oak Ridge National Laboratory. All rights reserved. * Copyright (c) 2009-2012 Mellanox Technologies. All rights reserved. * Copyright (c) 2013 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -119,8 +122,8 @@ static void init_module_fns(void){ void hcoll_rte_fns_setup(void) { init_module_fns(); - OBJ_CONSTRUCT(&mca_coll_hcoll_component.requests, ompi_free_list_t); - ompi_free_list_init_ex_new( + OBJ_CONSTRUCT(&mca_coll_hcoll_component.requests, opal_free_list_t); + opal_free_list_init( &(mca_coll_hcoll_component.requests), sizeof(ompi_request_t), /* no special alignment needed */ @@ -132,7 +135,9 @@ void hcoll_rte_fns_setup(void) 10, -1, 10, - /* No Mpool */ + /* No Mpool or init function */ + NULL, + 0, NULL, NULL, NULL @@ -175,7 +180,7 @@ static int recv_nb(struct dte_data_representation_t data, int rc; size_t size; ompi_request_t *ompi_req; - ompi_free_list_item_t *item; + opal_free_list_item_t *item; if (!buffer && !HCOL_DTE_IS_ZERO(data)) { fprintf(stderr, "***Error in hcolrte_rml_recv_nb: buffer pointer is NULL" @@ -246,7 +251,6 @@ static int send_nb( dte_data_representation_t data, int rc; size_t size; ompi_request_t *ompi_req; - ompi_free_list_item_t *item; if (!buffer && !HCOL_DTE_IS_ZERO(data)) { fprintf(stderr, "***Error in hcolrte_rml_send_nb: buffer pointer is NULL" " for non DTE_ZERO INLINE data representation\n"); @@ -390,8 +394,8 @@ request_free(struct ompi_request_t **ompi_req) static void* get_coll_handle(void) { ompi_request_t *ompi_req; - ompi_free_list_item_t *item; - OMPI_FREE_LIST_WAIT_MT(&(mca_coll_hcoll_component.requests),item); + opal_free_list_item_t *item; + item = opal_free_list_wait (&(mca_coll_hcoll_component.requests)); if (OPAL_UNLIKELY(NULL == item)) { HCOL_ERROR("Wait for free list failed.\n"); return NULL; @@ -412,8 +416,8 @@ static int coll_handle_test(void* handle) static void coll_handle_free(void *handle){ ompi_request_t *ompi_req = (ompi_request_t *)handle; - OMPI_FREE_LIST_RETURN_MT(&mca_coll_hcoll_component.requests, - (ompi_free_list_item_t *)ompi_req); + opal_free_list_return (&mca_coll_hcoll_component.requests, + (opal_free_list_item_t *)ompi_req); } static void coll_handle_complete(void *handle) diff --git a/ompi/mca/coll/libnbc/coll_libnbc.h b/ompi/mca/coll/libnbc/coll_libnbc.h index 5dac2a9da0..a66e8aed7c 100644 --- a/ompi/mca/coll/libnbc/coll_libnbc.h +++ b/ompi/mca/coll/libnbc/coll_libnbc.h @@ -11,7 +11,7 @@ * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * Copyright (c) 2008 Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2013 Los Alamos National Security, LLC. All rights + * Copyright (c) 2013-2015 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2014 Research Organization for Information Science * and Technology (RIST). All rights reserved. @@ -69,7 +69,7 @@ BEGIN_C_DECLS struct ompi_coll_libnbc_component_t { mca_coll_base_component_2_0_0_t super; - ompi_free_list_t requests; + opal_free_list_t requests; opal_list_t active_requests; int32_t active_comms; opal_atomic_lock_t progress_lock; @@ -123,8 +123,8 @@ typedef ompi_coll_libnbc_request_t NBC_Handle; #define OMPI_COLL_LIBNBC_REQUEST_ALLOC(comm, req) \ do { \ - ompi_free_list_item_t *item; \ - OMPI_FREE_LIST_WAIT_MT(&mca_coll_libnbc_component.requests, item); \ + opal_free_list_item_t *item; \ + item = opal_free_list_wait (&mca_coll_libnbc_component.requests); \ req = (ompi_coll_libnbc_request_t*) item; \ OMPI_REQUEST_INIT(&req->super, false); \ req->super.req_mpi_object.comm = comm; \ @@ -135,8 +135,8 @@ typedef ompi_coll_libnbc_request_t NBC_Handle; #define OMPI_COLL_LIBNBC_REQUEST_RETURN(req) \ do { \ OMPI_REQUEST_FINI(&request->super); \ - OMPI_FREE_LIST_RETURN_MT(&mca_coll_libnbc_component.requests, \ - (ompi_free_list_item_t*) req); \ + opal_free_list_return (&mca_coll_libnbc_component.requests, \ + (opal_free_list_item_t*) req); \ } while (0) int ompi_coll_libnbc_progress(void); diff --git a/ompi/mca/coll/libnbc/coll_libnbc_component.c b/ompi/mca/coll/libnbc/coll_libnbc_component.c index 1a2a81a689..311e20a9d8 100644 --- a/ompi/mca/coll/libnbc/coll_libnbc_component.c +++ b/ompi/mca/coll/libnbc/coll_libnbc_component.c @@ -11,7 +11,7 @@ * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * Copyright (c) 2008 Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2013 Los Alamos National Security, LLC. All rights + * Copyright (c) 2013-2015 Los Alamos National Security, LLC. All rights * reserved. * $COPYRIGHT$ * @@ -87,14 +87,11 @@ libnbc_open(void) { int ret; - OBJ_CONSTRUCT(&mca_coll_libnbc_component.requests, ompi_free_list_t); - ret = ompi_free_list_init(&mca_coll_libnbc_component.requests, - sizeof(ompi_coll_libnbc_request_t), - OBJ_CLASS(ompi_coll_libnbc_request_t), - 0, - -1, - 8, - NULL); + OBJ_CONSTRUCT(&mca_coll_libnbc_component.requests, opal_free_list_t); + ret = opal_free_list_init (&mca_coll_libnbc_component.requests, + sizeof(ompi_coll_libnbc_request_t), 8, + OBJ_CLASS(ompi_coll_libnbc_request_t), + 0, 0, 0, -1, 8, NULL, 0, NULL, NULL, NULL); if (OMPI_SUCCESS != ret) return ret; OBJ_CONSTRUCT(&mca_coll_libnbc_component.active_requests, opal_list_t); diff --git a/ompi/mca/coll/ml/coll_ml.h b/ompi/mca/coll/ml/coll_ml.h index c31e2f2c7a..006b7539d0 100644 --- a/ompi/mca/coll/ml/coll_ml.h +++ b/ompi/mca/coll/ml/coll_ml.h @@ -2,7 +2,7 @@ /* * Copyright (c) 2009-2012 Oak Ridge National Laboratory. All rights reserved. * Copyright (c) 2009-2012 Mellanox Technologies. All rights reserved. - * Copyright (c) 2013 Los Alamos National Security, LLC. All rights + * Copyright (c) 2013-2015 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2014 Research Organization for Information Science * and Technology (RIST). All rights reserved. @@ -29,7 +29,7 @@ #include "ompi/mca/bcol/bcol.h" #include "ompi/mca/sbgp/sbgp.h" #include "ompi/op/op.h" -#include "opal/class/ompi_free_list.h" +#include "opal/class/opal_free_list.h" #include "coll_ml_lmngr.h" #include "coll_ml_functions.h" @@ -652,10 +652,10 @@ struct mca_coll_ml_module_t { int32_t collective_sequence_num; /** ompi free list of full message descriptors **/ - ompi_free_list_t message_descriptors; + opal_free_list_t message_descriptors; /** ompi free list of message fragment descriptors **/ - ompi_free_list_t fragment_descriptors; + opal_free_list_t fragment_descriptors; /** pointer to the payload memory block **/ struct mca_bcol_base_memory_block_desc_t *payload_block; @@ -672,7 +672,7 @@ struct mca_coll_ml_module_t { /** collective operation descriptor free list - used to manage a single * collective operation. */ - ompi_free_list_t coll_ml_collective_descriptors; + opal_free_list_t coll_ml_collective_descriptors; /** multiple function collective operation support */ /** broadcast */ diff --git a/ompi/mca/coll/ml/coll_ml_barrier.c b/ompi/mca/coll/ml/coll_ml_barrier.c index 86d9bc80e6..ce593be519 100644 --- a/ompi/mca/coll/ml/coll_ml_barrier.c +++ b/ompi/mca/coll/ml/coll_ml_barrier.c @@ -1,9 +1,12 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2009-2012 Oak Ridge National Laboratory. All rights reserved. * Copyright (c) 2009-2012 Mellanox Technologies. All rights reserved. * Copyright (c) 2013 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -35,7 +38,7 @@ static void mca_coll_ml_barrier_task_setup( static int mca_coll_ml_barrier_launch(mca_coll_ml_module_t *ml_module, ompi_request_t **req) { - ompi_free_list_item_t *item; + opal_free_list_item_t *item; mca_coll_ml_collective_operation_progress_t *coll_op; mca_bcol_base_payload_buffer_desc_t *src_buffer_desc = NULL; @@ -49,8 +52,7 @@ static int mca_coll_ml_barrier_launch(mca_coll_ml_module_t *ml_module, /* Blocking call on fragment allocation (Maybe we want to make it non blocking ?) */ - OMPI_FREE_LIST_WAIT_MT(&(ml_module->coll_ml_collective_descriptors), - item); + item = opal_free_list_wait (&(ml_module->coll_ml_collective_descriptors)); coll_op = (mca_coll_ml_collective_operation_progress_t *) item; assert(NULL != coll_op); diff --git a/ompi/mca/coll/ml/coll_ml_colls.h b/ompi/mca/coll/ml/coll_ml_colls.h index 0b8519ee20..35bb4da072 100644 --- a/ompi/mca/coll/ml/coll_ml_colls.h +++ b/ompi/mca/coll/ml/coll_ml_colls.h @@ -2,7 +2,7 @@ /* * Copyright (c) 2009-2012 Oak Ridge National Laboratory. All rights reserved. * Copyright (c) 2009-2012 Mellanox Technologies. All rights reserved. - * Copyright (c) 2014 Los Alamos National Security, LLC. All rights + * Copyright (c) 2014-2015 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2014 Research Organization for Information Science * and Technology (RIST). All rights reserved. @@ -417,10 +417,10 @@ do { struct ompi_communicator_t *comm = GET_COMM(op); \ bool is_coll_sync = IS_COLL_SYNCMEM(op); \ ML_VERBOSE(10, ("Releasing %p", op)); \ - OMPI_REQUEST_FINI(&(op)->full_message.super); \ - OMPI_FREE_LIST_RETURN_MT(&(((mca_coll_ml_module_t *)(op)->coll_module)-> \ - coll_ml_collective_descriptors), \ - (ompi_free_list_item_t *)op); \ + OMPI_REQUEST_FINI(&(op)->full_message.super); \ + opal_free_list_return (&(((mca_coll_ml_module_t *)(op)->coll_module)-> \ + coll_ml_collective_descriptors), \ + (opal_free_list_item_t *)op); \ /* Special check for memory synchronization completion */ \ /* We have to return it first to free list, since the communicator */ \ /* release potentially may trigger ML module distraction and having */ \ diff --git a/ompi/mca/coll/ml/coll_ml_hier_algorithms.c b/ompi/mca/coll/ml/coll_ml_hier_algorithms.c index a5cdbd9b47..efbb9fac36 100644 --- a/ompi/mca/coll/ml/coll_ml_hier_algorithms.c +++ b/ompi/mca/coll/ml/coll_ml_hier_algorithms.c @@ -2,7 +2,7 @@ /* * Copyright (c) 2009-2012 Oak Ridge National Laboratory. All rights reserved. * Copyright (c) 2009-2012 Mellanox Technologies. All rights reserved. - * Copyright (c) 2014 Los Alamos National Security, LLC. All rights + * Copyright (c) 2014-2015 Los Alamos National Security, LLC. All rights * reserved. * $COPYRIGHT$ * @@ -17,10 +17,10 @@ #include "ompi/mca/coll/ml/coll_ml_allocation.h" /* collective managment descriptor initialization - called right after - * the constructor by ompi_free_list code + * the constructor by opal_free_list code */ static void mca_coll_ml_collective_operation_progress_init - (ompi_free_list_item_t* item, void* ctx) + (opal_free_list_item_t* item, void* ctx) { int i; int max_dag_size = ((struct coll_desc_init *)ctx)->max_dag_size; @@ -161,7 +161,7 @@ int ml_coll_schedule_setup(mca_coll_ml_module_t *ml_module) ml_module->coll_desc_init_data.bcol_base_module=(mca_coll_base_module_t *) ml_module; - ret = ompi_free_list_init_ex_new( + ret = opal_free_list_init ( &(ml_module->coll_ml_collective_descriptors), sizeof(mca_coll_ml_collective_operation_progress_t), /* no special alignment needed */ @@ -174,7 +174,7 @@ int ml_coll_schedule_setup(mca_coll_ml_module_t *ml_module) cm->free_list_max_size, cm->free_list_grow_size, /* No Mpool */ - NULL, + NULL, 0, NULL, mca_coll_ml_collective_operation_progress_init, (void *)&(ml_module->coll_desc_init_data) ); diff --git a/ompi/mca/coll/ml/coll_ml_inlines.h b/ompi/mca/coll/ml/coll_ml_inlines.h index d0a71d599a..ea32650899 100644 --- a/ompi/mca/coll/ml/coll_ml_inlines.h +++ b/ompi/mca/coll/ml/coll_ml_inlines.h @@ -5,6 +5,8 @@ * Copyright (c) 2013 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -468,13 +470,12 @@ mca_coll_ml_alloc_op_prog_single_frag_dag( size_t offset_into_user_buffer ) { - ompi_free_list_item_t *item; + opal_free_list_item_t *item; mca_coll_ml_collective_operation_progress_t *coll_op = NULL; ompi_request_t *req; /* Blocking call on fragment allocation (Maybe we want to make it non blocking ?) */ - OMPI_FREE_LIST_WAIT_MT(&(ml_module->coll_ml_collective_descriptors), - item); + item = opal_free_list_wait (&(ml_module->coll_ml_collective_descriptors)); coll_op = (mca_coll_ml_collective_operation_progress_t *) item; ML_VERBOSE(10, (">>> Allocating coll op %p", coll_op)); @@ -529,12 +530,11 @@ static inline __opal_attribute_always_inline__ mca_coll_ml_collective_operation_ size_t offset_into_user_buffer ) { - ompi_free_list_item_t *item; + opal_free_list_item_t *item; mca_coll_ml_collective_operation_progress_t *coll_op = NULL; /* Blocking call on fragment allocation (Maybe we want to make it non blocking ?) */ - OMPI_FREE_LIST_WAIT_MT(&(ml_module->coll_ml_collective_descriptors), - item); + item = opal_free_list_wait (&(ml_module->coll_ml_collective_descriptors)); coll_op = (mca_coll_ml_collective_operation_progress_t *) item; diff --git a/ompi/mca/coll/ml/coll_ml_module.c b/ompi/mca/coll/ml/coll_ml_module.c index 408560523b..c671cc044e 100644 --- a/ompi/mca/coll/ml/coll_ml_module.c +++ b/ompi/mca/coll/ml/coll_ml_module.c @@ -2,7 +2,7 @@ /* * Copyright (c) 2009-2013 Oak Ridge National Laboratory. All rights reserved. * Copyright (c) 2009-2012 Mellanox Technologies. All rights reserved. - * Copyright (c) 2012-2014 Los Alamos National Security, LLC. All rights + * Copyright (c) 2012-2015 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2013-2014 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2014 Research Organization for Information Science @@ -120,9 +120,9 @@ mca_coll_ml_module_construct(mca_coll_ml_module_t *module) OBJ_CONSTRUCT(&module->active_bcols_list, opal_list_t); OBJ_CONSTRUCT(&module->waiting_for_memory_list, opal_list_t); - OBJ_CONSTRUCT(&module->fragment_descriptors, ompi_free_list_t); - OBJ_CONSTRUCT(&module->message_descriptors, ompi_free_list_t); - OBJ_CONSTRUCT(&module->coll_ml_collective_descriptors, ompi_free_list_t); + OBJ_CONSTRUCT(&module->fragment_descriptors, opal_free_list_t); + OBJ_CONSTRUCT(&module->message_descriptors, opal_free_list_t); + OBJ_CONSTRUCT(&module->coll_ml_collective_descriptors, opal_free_list_t); memset (&module->fallback, 0, sizeof (module->fallback)); } @@ -260,8 +260,8 @@ static int mca_coll_ml_request_free(ompi_request_t** request) ML_VERBOSE(10, ("Releasing Master %p", ml_request)); /* Mark the request as invalid */ OMPI_REQUEST_FINI(&ml_request->full_message.super); - OMPI_FREE_LIST_RETURN_MT(&(ml_module->coll_ml_collective_descriptors), - (ompi_free_list_item_t *)ml_request); + opal_free_list_return (&(ml_module->coll_ml_collective_descriptors), + (opal_free_list_item_t *)ml_request); /* MPI needs to return with the request object set to MPI_REQUEST_NULL */ @@ -326,20 +326,20 @@ static void mca_coll_ml_collective_operation_progress_destruct /* initialize the full message descriptor - can pass in module specific * initialization data */ -static void init_ml_fragment_desc(ompi_free_list_item_t *desc , void* ctx); -static void init_ml_message_desc(ompi_free_list_item_t *desc , void* ctx) +static void init_ml_fragment_desc(opal_free_list_item_t *desc , void* ctx); +static void init_ml_message_desc(opal_free_list_item_t *desc , void* ctx) { mca_coll_ml_module_t *module= (mca_coll_ml_module_t *) ctx; mca_coll_ml_descriptor_t *msg_desc = (mca_coll_ml_descriptor_t *) desc; /* finish setting up the fragment descriptor */ - init_ml_fragment_desc((ompi_free_list_item_t*)&(msg_desc->fragment),module); + init_ml_fragment_desc((opal_free_list_item_t*)&(msg_desc->fragment),module); } /* initialize the fragment descriptor - can pass in module specific * initialization data */ -static void init_ml_fragment_desc(ompi_free_list_item_t *desc , void* ctx) +static void init_ml_fragment_desc(opal_free_list_item_t *desc , void* ctx) { mca_coll_ml_module_t *module= (mca_coll_ml_module_t *) ctx; mca_coll_ml_fragment_t *frag_desc = (mca_coll_ml_fragment_t *) desc; @@ -2614,14 +2614,14 @@ static int init_lists(mca_coll_ml_module_t *ml_module) /* no data associated with the message descriptor */ length = sizeof(mca_coll_ml_descriptor_t); - ret = ompi_free_list_init_ex_new(&(ml_module->message_descriptors), length, - opal_cache_line_size, OBJ_CLASS(mca_coll_ml_descriptor_t), - length_payload, 0, - num_elements, max_elements, elements_per_alloc, - NULL, - init_ml_message_desc, ml_module); + ret = opal_free_list_init(&(ml_module->message_descriptors), length, + opal_cache_line_size, OBJ_CLASS(mca_coll_ml_descriptor_t), + length_payload, 0, + num_elements, max_elements, elements_per_alloc, + NULL, 0, NULL, + init_ml_message_desc, ml_module); if (OPAL_UNLIKELY(OMPI_SUCCESS != ret)) { - ML_ERROR(("ompi_free_list_init_ex_new exit with error")); + ML_ERROR(("opal_free_list_init exit with error")); return ret; } @@ -2632,14 +2632,14 @@ static int init_lists(mca_coll_ml_module_t *ml_module) /* create a free list of fragment descriptors */ /*length_payload=sizeof(something);*/ length = sizeof(mca_coll_ml_fragment_t); - ret = ompi_free_list_init_ex_new(&(ml_module->fragment_descriptors), length, - opal_cache_line_size, OBJ_CLASS(mca_coll_ml_fragment_t), - length_payload, 0, - num_elements, max_elements, elements_per_alloc, - NULL, - init_ml_fragment_desc, ml_module); + ret = opal_free_list_init (&(ml_module->fragment_descriptors), length, + opal_cache_line_size, OBJ_CLASS(mca_coll_ml_fragment_t), + length_payload, 0, + num_elements, max_elements, elements_per_alloc, + NULL, 0, NULL, + init_ml_fragment_desc, ml_module); if (OMPI_SUCCESS != ret) { - ML_ERROR(("ompi_free_list_init_ex_new exit with error")); + ML_ERROR(("opal_free_list_init exit with error")); return ret; } diff --git a/ompi/mca/coll/portals4/coll_portals4.h b/ompi/mca/coll/portals4/coll_portals4.h index 1195f94d57..efbe83037b 100644 --- a/ompi/mca/coll/portals4/coll_portals4.h +++ b/ompi/mca/coll/portals4/coll_portals4.h @@ -1,5 +1,8 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2013 Sandia National Laboratories. All rights reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -42,7 +45,7 @@ struct mca_coll_portals4_component_t { ptl_handle_md_t md_h; #endif - ompi_free_list_t requests; /* request free list for the i collectives */ + opal_free_list_t requests; /* request free list for the i collectives */ }; typedef struct mca_coll_portals4_component_t mca_coll_portals4_component_t; OMPI_MODULE_DECLSPEC extern mca_coll_portals4_component_t mca_coll_portals4_component; diff --git a/ompi/mca/coll/portals4/coll_portals4_component.c b/ompi/mca/coll/portals4/coll_portals4_component.c index 33068c37c9..6f5eda776d 100644 --- a/ompi/mca/coll/portals4/coll_portals4_component.c +++ b/ompi/mca/coll/portals4/coll_portals4_component.c @@ -1,3 +1,4 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana * University Research and Technology @@ -11,6 +12,8 @@ * All rights reserved. * Copyright (c) 2008 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2013 Sandia National Laboratories. All rights reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -110,17 +113,14 @@ portals4_open(void) mca_coll_portals4_component.md_h = PTL_INVALID_HANDLE; #endif - OBJ_CONSTRUCT(&mca_coll_portals4_component.requests, ompi_free_list_t); - ret = ompi_free_list_init(&mca_coll_portals4_component.requests, - sizeof(ompi_coll_portals4_request_t), - OBJ_CLASS(ompi_coll_portals4_request_t), - 8, - 0, - 8, - NULL); + OBJ_CONSTRUCT(&mca_coll_portals4_component.requests, opal_free_list_t); + ret = opal_free_list_init (&mca_coll_portals4_component.requests, + sizeof(ompi_coll_portals4_request_t), + OBJ_CLASS(ompi_coll_portals4_request_t), + 0, 0, 8, 0, 8, NULL, 0, NULL, NULL, NULL); if (OMPI_SUCCESS != ret) { opal_output_verbose(1, ompi_coll_base_framework.framework_output, - "%s:%d: ompi_free_list_init failed: %d\n", + "%s:%d: opal_free_list_init failed: %d\n", __FILE__, __LINE__, ret); return ret; } diff --git a/ompi/mca/coll/portals4/coll_portals4_request.h b/ompi/mca/coll/portals4/coll_portals4_request.h index ff5d3abc4c..e9b887d3dc 100644 --- a/ompi/mca/coll/portals4/coll_portals4_request.h +++ b/ompi/mca/coll/portals4/coll_portals4_request.h @@ -1,5 +1,8 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2013 Sandia National Laboratories. All rights reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -29,9 +32,8 @@ OBJ_CLASS_DECLARATION(ompi_coll_portals4_request_t); #define OMPI_COLL_PORTALS4_REQUEST_ALLOC(comm, req) \ do { \ - ompi_free_list_item_t *item; \ - OMPI_FREE_LIST_GET_MT(&mca_coll_portals4_component.requests, \ - item); \ + opal_free_list_item_t *item; \ + item = opal_free_list_get (&mca_coll_portals4_component.requests); \ req = (ompi_coll_portals4_request_t*) item; \ OMPI_REQUEST_INIT(&req->super, false); \ req->super.req_mpi_object.comm = comm; \ @@ -42,8 +44,8 @@ OBJ_CLASS_DECLARATION(ompi_coll_portals4_request_t); #define OMPI_COLL_PORTALS4_REQUEST_RETURN(req) \ do { \ OMPI_REQUEST_FINI(&request->super); \ - OMPI_FREE_LIST_RETURN_MT(&mca_coll_portals4_component.requests, \ - (ompi_free_list_item_t*) req); \ + opal_free_list_return (&mca_coll_portals4_component.requests, \ + (opal_free_list_item_t*) req); \ } while (0) diff --git a/ompi/mca/crcp/base/crcp_base_fns.c b/ompi/mca/crcp/base/crcp_base_fns.c index c64fc1266b..61980f1809 100644 --- a/ompi/mca/crcp/base/crcp_base_fns.c +++ b/ompi/mca/crcp/base/crcp_base_fns.c @@ -1,3 +1,4 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2004-2010 The Trustees of Indiana University. * All rights reserved. @@ -7,6 +8,8 @@ * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -50,13 +53,13 @@ * Object stuff ******************/ OBJ_CLASS_INSTANCE(ompi_crcp_base_pml_state_t, - ompi_free_list_item_t, + opal_free_list_item_t, NULL, NULL ); OBJ_CLASS_INSTANCE(ompi_crcp_base_btl_state_t, - ompi_free_list_item_t, + opal_free_list_item_t, NULL, NULL ); diff --git a/ompi/mca/crcp/bkmrk/crcp_bkmrk_pml.c b/ompi/mca/crcp/bkmrk/crcp_bkmrk_pml.c index 31138705cb..dbf5381e08 100644 --- a/ompi/mca/crcp/bkmrk/crcp_bkmrk_pml.c +++ b/ompi/mca/crcp/bkmrk/crcp_bkmrk_pml.c @@ -1,3 +1,4 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2004-2011 The Trustees of Indiana University. * All rights reserved. @@ -5,8 +6,8 @@ * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2010-2012 Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012 Los Alamos National Security, LLC. - * All rights reserved. + * Copyright (c) 2012-2015 Los Alamos National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -41,7 +42,7 @@ #include "ompi/mca/crcp/crcp.h" #include "ompi/mca/crcp/base/base.h" -#include "opal/class/ompi_free_list.h" +#include "opal/class/opal_free_list.h" #include "ompi/runtime/ompi_cr.h" #include "orte/runtime/orte_wait.h" @@ -106,12 +107,12 @@ opal_list_t drained_msg_ack_list; /* * Free lists */ -ompi_free_list_t coord_state_free_list; -ompi_free_list_t content_ref_free_list; -ompi_free_list_t peer_ref_free_list; -ompi_free_list_t traffic_msg_ref_free_list; -ompi_free_list_t drain_msg_ref_free_list; -ompi_free_list_t drain_ack_msg_ref_free_list; +opal_free_list_t coord_state_free_list; +opal_free_list_t content_ref_free_list; +opal_free_list_t peer_ref_free_list; +opal_free_list_t traffic_msg_ref_free_list; +opal_free_list_t drain_msg_ref_free_list; +opal_free_list_t drain_ack_msg_ref_free_list; /* * Quiescence requests to wait on @@ -618,74 +619,69 @@ static void traffic_message_dump_drain_msg_indv(ompi_crcp_bkmrk_pml_drain_messag */ #define HOKE_PEER_REF_ALLOC(peer_ref) \ do { \ - ompi_free_list_item_t* item; \ - OMPI_FREE_LIST_WAIT_MT(&peer_ref_free_list, item); \ - peer_ref = (ompi_crcp_bkmrk_pml_peer_ref_t*)item; \ -} while(0); + peer_ref = (ompi_crcp_bkmrk_pml_peer_ref_t *) \ + opal_free_list_wait (&peer_ref_free_list); \ +} while(0) -#define HOKE_PEER_REF_RETURN(peer_ref) \ -do { \ - OMPI_FREE_LIST_RETURN_MT(&peer_ref_free_list, \ - (ompi_free_list_item_t*)peer_ref); \ -} while(0); +#define HOKE_PEER_REF_RETURN(peer_ref) \ +do { \ + opal_free_list_return (&peer_ref_free_list, \ + (opal_free_list_item_t*)peer_ref); \ +} while(0) #define HOKE_CONTENT_REF_ALLOC(content_ref) \ do { \ - ompi_free_list_item_t* item; \ - OMPI_FREE_LIST_WAIT_MT(&content_ref_free_list, item); \ - content_ref = (ompi_crcp_bkmrk_pml_message_content_ref_t*)item; \ - content_ref->msg_id = content_ref_seq_num; \ - content_ref_seq_num++;\ -} while(0); + content_ref = (ompi_crcp_bkmrk_pml_message_content_ref_t*) \ + opal_free_list_wait (&content_ref_free_list); \ + content_ref->msg_id = content_ref_seq_num; \ + content_ref_seq_num++; \ +} while(0) -#define HOKE_CONTENT_REF_RETURN(content_ref) \ -do { \ - OMPI_FREE_LIST_RETURN_MT(&content_ref_free_list, \ - (ompi_free_list_item_t*)content_ref); \ -} while(0); +#define HOKE_CONTENT_REF_RETURN(content_ref) \ +do { \ + opal_free_list_return (&content_ref_free_list, \ + (opal_free_list_item_t*)content_ref); \ +} while(0) #define HOKE_TRAFFIC_MSG_REF_ALLOC(msg_ref) \ do { \ - ompi_free_list_item_t* item; \ - OMPI_FREE_LIST_WAIT_MT(&traffic_msg_ref_free_list, item); \ - msg_ref = (ompi_crcp_bkmrk_pml_traffic_message_ref_t*)item; \ -} while(0); + msg_ref = (ompi_crcp_bkmrk_pml_traffic_message_ref_t*) \ + opal_free_list_wait (&traffic_msg_ref_free_list); \ +} while(0) -#define HOKE_TRAFFIC_MSG_REF_RETURN(msg_ref) \ -do { \ - OMPI_FREE_LIST_RETURN_MT(&traffic_msg_ref_free_list, \ - (ompi_free_list_item_t*)msg_ref); \ -} while(0); +#define HOKE_TRAFFIC_MSG_REF_RETURN(msg_ref) \ +do { \ + opal_free_list_return (&traffic_msg_ref_free_list, \ + (opal_free_list_item_t*)msg_ref); \ +} while(0) -#define HOKE_DRAIN_MSG_REF_ALLOC(msg_ref) \ -do { \ - ompi_free_list_item_t* item; \ - OMPI_FREE_LIST_WAIT_MT(&drain_msg_ref_free_list, item); \ - msg_ref = (ompi_crcp_bkmrk_pml_drain_message_ref_t*)item; \ -} while(0); +#define HOKE_DRAIN_MSG_REF_ALLOC(msg_ref) \ +do { \ + msg_ref = (ompi_crcp_bkmrk_pml_drain_message_ref_t *) \ + opal_free_list_wait (&drain_msg_ref_free_list); \ +} while(0) -#define HOKE_DRAIN_MSG_REF_RETURN(msg_ref) \ -do { \ - OMPI_FREE_LIST_RETURN_MT(&drain_msg_ref_free_list, \ - (ompi_free_list_item_t*)msg_ref); \ -} while(0); +#define HOKE_DRAIN_MSG_REF_RETURN(msg_ref) \ +do { \ + opal_free_list_return (&drain_msg_ref_free_list, \ + (opal_free_list_item_t*)msg_ref); \ +} while(0) #define HOKE_DRAIN_ACK_MSG_REF_ALLOC(msg_ref) \ do { \ - ompi_free_list_item_t* item; \ - OMPI_FREE_LIST_WAIT_MT(&drain_ack_msg_ref_free_list, item); \ - msg_ref = (ompi_crcp_bkmrk_pml_drain_message_ack_ref_t*)item; \ -} while(0); + msg_ref = (ompi_crcp_bkmrk_pml_drain_message_ack_ref_t *) \ + opal_free_list_wait (&drain_ack_msg_ref_free_list); \ +} while(0) -#define HOKE_DRAIN_ACK_MSG_REF_RETURN(msg_ref) \ -do { \ - OMPI_FREE_LIST_RETURN_MT(&drain_ack_msg_ref_free_list, \ - (ompi_free_list_item_t*)msg_ref); \ -} while(0); +#define HOKE_DRAIN_ACK_MSG_REF_RETURN(msg_ref) \ +do { \ + opal_free_list_return (&drain_ack_msg_ref_free_list, \ + (opal_free_list_item_t*)msg_ref); \ +} while(0) /* @@ -967,18 +963,17 @@ OBJ_CLASS_INSTANCE(ompi_crcp_bkmrk_pml_state_t, /************************************ * Some Macro shortcuts ************************************/ -#define CRCP_COORD_STATE_ALLOC(state_ref) \ -do { \ - ompi_free_list_item_t* item; \ - OMPI_FREE_LIST_WAIT_MT(&coord_state_free_list, item); \ - state_ref = (ompi_crcp_bkmrk_pml_state_t*)item; \ -} while(0); +#define CRCP_COORD_STATE_ALLOC(state_ref) \ +do { \ + state_ref = (ompi_crcp_bkmrk_pml_state_t *) \ + opal_free_list_wait (&coord_state_free_list); \ +} while(0) -#define CRCP_COORD_STATE_RETURN(state_ref) \ -do { \ - OMPI_FREE_LIST_RETURN_MT(&coord_state_free_list, \ - (ompi_free_list_item_t*)state_ref); \ -} while(0); +#define CRCP_COORD_STATE_RETURN(state_ref) \ +do { \ + opal_free_list_return (&coord_state_free_list, \ + (opal_free_list_item_t *)state_ref); \ +} while(0) #define CREATE_COORD_STATE(coord_state, pml_state, v_peer_ref, v_msg_ref) \ { \ @@ -1100,71 +1095,71 @@ int ompi_crcp_bkmrk_pml_init(void) { * - Drain ACK Messsage Refs * - Message Contents? */ - OBJ_CONSTRUCT(&coord_state_free_list, ompi_free_list_t); - ompi_free_list_init_new( &coord_state_free_list, - sizeof(ompi_crcp_bkmrk_pml_state_t), - opal_cache_line_size, - OBJ_CLASS(ompi_crcp_bkmrk_pml_state_t), - 0,opal_cache_line_size, - 4, /* Initial number */ - -1, /* Max = Unlimited */ - 4, /* Increment by */ - NULL); + OBJ_CONSTRUCT(&coord_state_free_list, opal_free_list_t); + opal_free_list_init (&coord_state_free_list, + sizeof(ompi_crcp_bkmrk_pml_state_t), + opal_cache_line_size, + OBJ_CLASS(ompi_crcp_bkmrk_pml_state_t), + 0,opal_cache_line_size, + 4, /* Initial number */ + -1, /* Max = Unlimited */ + 4, /* Increment by */ + NULL, 0, NULL, NULL, NULL); - OBJ_CONSTRUCT(&content_ref_free_list, ompi_free_list_t); - ompi_free_list_init_new( &content_ref_free_list, - sizeof(ompi_crcp_bkmrk_pml_message_content_ref_t), - opal_cache_line_size, - OBJ_CLASS(ompi_crcp_bkmrk_pml_message_content_ref_t), - 0,opal_cache_line_size, - 80, /* Initial number */ - -1, /* Max = Unlimited */ - 32, /* Increment by */ - NULL); + OBJ_CONSTRUCT(&content_ref_free_list, opal_free_list_t); + opal_free_list_init (&content_ref_free_list, + sizeof(ompi_crcp_bkmrk_pml_message_content_ref_t), + opal_cache_line_size, + OBJ_CLASS(ompi_crcp_bkmrk_pml_message_content_ref_t), + 0,opal_cache_line_size, + 80, /* Initial number */ + -1, /* Max = Unlimited */ + 32, /* Increment by */ + NULL, 0, NULL, NULL, NULL); - OBJ_CONSTRUCT(&peer_ref_free_list, ompi_free_list_t); - ompi_free_list_init_new( &peer_ref_free_list, - sizeof(ompi_crcp_bkmrk_pml_peer_ref_t), - opal_cache_line_size, - OBJ_CLASS(ompi_crcp_bkmrk_pml_peer_ref_t), - 0,opal_cache_line_size, - 16, /* Initial number */ - -1, /* Max = Unlimited */ - 16, /* Increment by */ - NULL); + OBJ_CONSTRUCT(&peer_ref_free_list, opal_free_list_t); + opal_free_list_init (&peer_ref_free_list, + sizeof(ompi_crcp_bkmrk_pml_peer_ref_t), + opal_cache_line_size, + OBJ_CLASS(ompi_crcp_bkmrk_pml_peer_ref_t), + 0,opal_cache_line_size, + 16, /* Initial number */ + -1, /* Max = Unlimited */ + 16, /* Increment by */ + NULL, 0, NULL, NULL, NULL); - OBJ_CONSTRUCT(&traffic_msg_ref_free_list, ompi_free_list_t); - ompi_free_list_init_new( &traffic_msg_ref_free_list, - sizeof(ompi_crcp_bkmrk_pml_traffic_message_ref_t), - opal_cache_line_size, - OBJ_CLASS(ompi_crcp_bkmrk_pml_traffic_message_ref_t), - 0,opal_cache_line_size, - 32, /* Initial number */ - -1, /* Max = Unlimited */ - 64, /* Increment by */ - NULL); + OBJ_CONSTRUCT(&traffic_msg_ref_free_list, opal_free_list_t); + opal_free_list_init (&traffic_msg_ref_free_list, + sizeof(ompi_crcp_bkmrk_pml_traffic_message_ref_t), + opal_cache_line_size, + OBJ_CLASS(ompi_crcp_bkmrk_pml_traffic_message_ref_t), + 0,opal_cache_line_size, + 32, /* Initial number */ + -1, /* Max = Unlimited */ + 64, /* Increment by */ + NULL, 0, NULL, NULL, NULL); - OBJ_CONSTRUCT(&drain_msg_ref_free_list, ompi_free_list_t); - ompi_free_list_init_new( &drain_msg_ref_free_list, - sizeof(ompi_crcp_bkmrk_pml_drain_message_ref_t), - opal_cache_line_size, - OBJ_CLASS(ompi_crcp_bkmrk_pml_drain_message_ref_t), - 0,opal_cache_line_size, - 32, /* Initial number */ - -1, /* Max = Unlimited */ - 64, /* Increment by */ - NULL); + OBJ_CONSTRUCT(&drain_msg_ref_free_list, opal_free_list_t); + opal_free_list_init (&drain_msg_ref_free_list, + sizeof(ompi_crcp_bkmrk_pml_drain_message_ref_t), + opal_cache_line_size, + OBJ_CLASS(ompi_crcp_bkmrk_pml_drain_message_ref_t), + 0,opal_cache_line_size, + 32, /* Initial number */ + -1, /* Max = Unlimited */ + 64, /* Increment by */ + NULL, 0, NULL, NULL, NULL); - OBJ_CONSTRUCT(&drain_ack_msg_ref_free_list, ompi_free_list_t); - ompi_free_list_init_new( &drain_ack_msg_ref_free_list, - sizeof(ompi_crcp_bkmrk_pml_drain_message_ack_ref_t), - opal_cache_line_size, - OBJ_CLASS(ompi_crcp_bkmrk_pml_drain_message_ack_ref_t), - 0,opal_cache_line_size, - 16, /* Initial number */ - -1, /* Max = Unlimited */ - 16, /* Increment by */ - NULL); + OBJ_CONSTRUCT(&drain_ack_msg_ref_free_list, opal_free_list_t); + opal_free_list_init (&drain_ack_msg_ref_free_list, + sizeof(ompi_crcp_bkmrk_pml_drain_message_ack_ref_t), + opal_cache_line_size, + OBJ_CLASS(ompi_crcp_bkmrk_pml_drain_message_ack_ref_t), + 0,opal_cache_line_size, + 16, /* Initial number */ + -1, /* Max = Unlimited */ + 16, /* Increment by */ + NULL, 0, NULL, NULL, NULL); clear_timers(); diff --git a/ompi/mca/crcp/crcp.h b/ompi/mca/crcp/crcp.h index 4a51949a55..21fba5f180 100644 --- a/ompi/mca/crcp/crcp.h +++ b/ompi/mca/crcp/crcp.h @@ -1,3 +1,4 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2004-2010 The Trustees of Indiana University and Indiana * University Research and Technology @@ -9,6 +10,8 @@ * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -34,7 +37,7 @@ #include "opal/mca/crs/base/base.h" #include "opal/mca/btl/btl.h" #include "opal/mca/btl/base/base.h" -#include "opal/class/ompi_free_list.h" +#include "opal/class/opal_free_list.h" #include "ompi/datatype/ompi_datatype.h" #include "ompi/request/request.h" @@ -91,7 +94,7 @@ enum ompi_crcp_base_pml_states_t { typedef enum ompi_crcp_base_pml_states_t ompi_crcp_base_pml_states_t; struct ompi_crcp_base_pml_state_t { - ompi_free_list_item_t super; + opal_free_list_item_t super; ompi_crcp_base_pml_states_t state; int error_code; mca_pml_base_component_t *wrapped_pml_component; @@ -183,7 +186,7 @@ enum ompi_crcp_base_btl_states_t { typedef enum ompi_crcp_base_btl_states_t ompi_crcp_base_btl_states_t; struct ompi_crcp_base_btl_state_t { - ompi_free_list_item_t super; + opal_free_list_item_t super; ompi_crcp_base_btl_states_t state; int error_code; mca_btl_base_descriptor_t* des; diff --git a/ompi/mca/fbtl/base/fbtl_base_frame.c b/ompi/mca/fbtl/base/fbtl_base_frame.c index 8e6efbed80..94ff8e6eb4 100644 --- a/ompi/mca/fbtl/base/fbtl_base_frame.c +++ b/ompi/mca/fbtl/base/fbtl_base_frame.c @@ -1,3 +1,4 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology @@ -10,6 +11,8 @@ * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * Copyright (c) 2008-2011 University of Houston. All rights reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -21,7 +24,6 @@ #include "ompi_config.h" #include -#include "opal/class/ompi_free_list.h" #include "opal/mca/mca.h" #include "opal/mca/base/base.h" diff --git a/ompi/mca/fcoll/base/fcoll_base_frame.c b/ompi/mca/fcoll/base/fcoll_base_frame.c index 817bce90d9..940c5e8e80 100644 --- a/ompi/mca/fcoll/base/fcoll_base_frame.c +++ b/ompi/mca/fcoll/base/fcoll_base_frame.c @@ -1,3 +1,4 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology @@ -10,6 +11,8 @@ * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * Copyright (c) 2008-2011 University of Houston. All rights reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -21,7 +24,6 @@ #include "ompi_config.h" #include -#include "opal/class/ompi_free_list.h" #include "opal/mca/mca.h" #include "opal/mca/base/base.h" diff --git a/ompi/mca/mtl/mxm/mtl_mxm.c b/ompi/mca/mtl/mxm/mtl_mxm.c index 5bc03986a1..428d1b7fbb 100644 --- a/ompi/mca/mtl/mxm/mtl_mxm.c +++ b/ompi/mca/mtl/mxm/mtl_mxm.c @@ -1,8 +1,11 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (C) 2001-2011 Mellanox Technologies Ltd. ALL RIGHTS RESERVED. * Copyright (c) 2013-2014 Intel, Inc. All rights reserved * Copyright (c) 2014 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -657,6 +660,6 @@ static void ompi_mtl_mxm_mem_release_cb(void *buf, size_t length, OBJ_CLASS_INSTANCE( ompi_mtl_mxm_message_t, - ompi_free_list_item_t, + opal_free_list_item_t, NULL, NULL); diff --git a/ompi/mca/mtl/mxm/mtl_mxm.h b/ompi/mca/mtl/mxm/mtl_mxm.h index 3f57bf95d4..f849244694 100644 --- a/ompi/mca/mtl/mxm/mtl_mxm.h +++ b/ompi/mca/mtl/mxm/mtl_mxm.h @@ -1,5 +1,8 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (C) Mellanox Technologies Ltd. 2001-2011. ALL RIGHTS RESERVED. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -30,7 +33,7 @@ #include "ompi/mca/pml/pml.h" #include "ompi/mca/mtl/mtl.h" #include "ompi/mca/mtl/base/base.h" -#include "opal/class/ompi_free_list.h" +#include "opal/class/opal_free_list.h" #include "opal/util/output.h" #include "opal/util/show_help.h" @@ -96,7 +99,7 @@ extern int ompi_mtl_mxm_finalize(struct mca_mtl_base_module_t* mtl); int ompi_mtl_mxm_module_init(void); struct ompi_mtl_mxm_message_t { - ompi_free_list_item_t super; + opal_free_list_item_t super; mxm_mq_h mq; mxm_conn_h conn; diff --git a/ompi/mca/mtl/mxm/mtl_mxm_component.c b/ompi/mca/mtl/mxm/mtl_mxm_component.c index b8acc91ba7..bec3028409 100644 --- a/ompi/mca/mtl/mxm/mtl_mxm_component.c +++ b/ompi/mca/mtl/mxm/mtl_mxm_component.c @@ -1,3 +1,4 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (C) Mellanox Technologies Ltd. 2001-2011. ALL RIGHTS RESERVED. * Copyright (c) 2015 Los Alamos National Security, LLC. All rights @@ -240,16 +241,16 @@ static int ompi_mtl_mxm_component_open(void) return OPAL_ERR_NOT_AVAILABLE; } - OBJ_CONSTRUCT(&mca_mtl_mxm_component.mxm_messages, ompi_free_list_t); - rc = ompi_free_list_init_new(&mca_mtl_mxm_component.mxm_messages, - sizeof(ompi_mtl_mxm_message_t), - opal_cache_line_size, - OBJ_CLASS(ompi_mtl_mxm_message_t), - 0, opal_cache_line_size, - 32 /* free list num */, - -1 /* free list max */, - 32 /* free list inc */, - NULL); + OBJ_CONSTRUCT(&mca_mtl_mxm_component.mxm_messages, opal_free_list_t); + rc = opal_free_list_init (&mca_mtl_mxm_component.mxm_messages, + sizeof(ompi_mtl_mxm_message_t), + opal_cache_line_size, + OBJ_CLASS(ompi_mtl_mxm_message_t), + 0, opal_cache_line_size, + 32 /* free list num */, + -1 /* free list max */, + 32 /* free list inc */, + NULL, 0, NULL, NULL, NULL); if (OMPI_SUCCESS != rc) { opal_show_help("help-mtl-mxm.txt", "mxm init", true, mxm_error_string(err)); diff --git a/ompi/mca/mtl/mxm/mtl_mxm_probe.c b/ompi/mca/mtl/mxm/mtl_mxm_probe.c index 726fbeca03..814dc9c6d9 100644 --- a/ompi/mca/mtl/mxm/mtl_mxm_probe.c +++ b/ompi/mca/mtl/mxm/mtl_mxm_probe.c @@ -1,8 +1,11 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (C) Mellanox Technologies Ltd. 2001-2011. ALL RIGHTS RESERVED. * Copyright (c) 2013 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -57,10 +60,10 @@ int ompi_mtl_mxm_improbe(struct mca_mtl_base_module_t *mtl, mxm_error_t err; mxm_recv_req_t req; - ompi_free_list_item_t *item; + opal_free_list_item_t *item; ompi_mtl_mxm_message_t *msgp; - OMPI_FREE_LIST_WAIT_MT(&mca_mtl_mxm_component.mxm_messages, item); + item = opal_free_list_wait (&mca_mtl_mxm_component.mxm_messages); if (OPAL_UNLIKELY(NULL == item)) { return OMPI_ERR_OUT_OF_RESOURCE; } diff --git a/ompi/mca/mtl/mxm/mtl_mxm_recv.c b/ompi/mca/mtl/mxm/mtl_mxm_recv.c index 563444c3ad..9819106a0b 100644 --- a/ompi/mca/mtl/mxm/mtl_mxm_recv.c +++ b/ompi/mca/mtl/mxm/mtl_mxm_recv.c @@ -1,5 +1,8 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (C) Mellanox Technologies Ltd. 2001-2011. ALL RIGHTS RESERVED. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -185,8 +188,8 @@ int ompi_mtl_mxm_imrecv(struct mca_mtl_base_module_t* mtl, return OMPI_ERROR; } - OMPI_FREE_LIST_RETURN_MT(&mca_mtl_mxm_component.mxm_messages, - (ompi_free_list_item_t *) msgp); + opal_free_list_wait (&mca_mtl_mxm_component.mxm_messages, + (opal_free_list_item_t *) msgp); ompi_message_return(*message); (*message) = MPI_MESSAGE_NULL; diff --git a/ompi/mca/mtl/mxm/mtl_mxm_types.h b/ompi/mca/mtl/mxm/mtl_mxm_types.h index 3095d35f3c..6e5749c733 100644 --- a/ompi/mca/mtl/mxm/mtl_mxm_types.h +++ b/ompi/mca/mtl/mxm/mtl_mxm_types.h @@ -1,5 +1,8 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (C) Mellanox Technologies Ltd. 2001-2011. ALL RIGHTS RESERVED. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -54,7 +57,7 @@ extern mca_mtl_mxm_module_t ompi_mtl_mxm; typedef struct mca_mtl_mxm_component_t { mca_mtl_base_component_2_0_0_t super; /**< base MTL component */ - ompi_free_list_t mxm_messages; /* will be used for MPI_Mprobe and MPI_Mrecv calls */ + opal_free_list_t mxm_messages; /* will be used for MPI_Mprobe and MPI_Mrecv calls */ } mca_mtl_mxm_component_t; diff --git a/ompi/mca/mtl/ofi/mtl_ofi_component.c b/ompi/mca/mtl/ofi/mtl_ofi_component.c index c4b7cf8217..84334fdc4c 100644 --- a/ompi/mca/mtl/ofi/mtl_ofi_component.c +++ b/ompi/mca/mtl/ofi/mtl_ofi_component.c @@ -92,7 +92,7 @@ ompi_mtl_ofi_component_open(void) OBJ_CONSTRUCT(&ompi_mtl_ofi.free_messages, opal_free_list_t); opal_free_list_init(&ompi_mtl_ofi.free_messages, - sizeof(ompi_mtl_ofi_message_t), + sizeof(ompi_mtl_ofi_message_t), 8, OBJ_CLASS(ompi_mtl_ofi_message_t), 0, 0, 1, -1, 1, NULL, 0, NULL, NULL, NULL); diff --git a/ompi/mca/osc/portals4/osc_portals4.h b/ompi/mca/osc/portals4/osc_portals4.h index 10aeb7d4ac..61fb04541f 100644 --- a/ompi/mca/osc/portals4/osc_portals4.h +++ b/ompi/mca/osc/portals4/osc_portals4.h @@ -1,5 +1,8 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2011-2013 Sandia National Laboratories. All rights reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -45,7 +48,7 @@ struct ompi_osc_portals4_component_t { ptl_size_t matching_fetch_atomic_max; ptl_size_t matching_atomic_ordered_size; - ompi_free_list_t requests; /* request free list for the r* communication variants */ + opal_free_list_t requests; /* request free list for the r* communication variants */ }; typedef struct ompi_osc_portals4_component_t ompi_osc_portals4_component_t; OMPI_DECLSPEC extern ompi_osc_portals4_component_t mca_osc_portals4_component; diff --git a/ompi/mca/osc/portals4/osc_portals4_component.c b/ompi/mca/osc/portals4/osc_portals4_component.c index af27adc28e..0ffd9ddbf5 100644 --- a/ompi/mca/osc/portals4/osc_portals4_component.c +++ b/ompi/mca/osc/portals4/osc_portals4_component.c @@ -1,5 +1,8 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2011-2013 Sandia National Laboratories. All rights reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -314,17 +317,14 @@ component_init(bool enable_progress_threads, bool enable_mpi_threads) return ret; } - OBJ_CONSTRUCT(&mca_osc_portals4_component.requests, ompi_free_list_t); - ret = ompi_free_list_init(&mca_osc_portals4_component.requests, - sizeof(ompi_osc_portals4_request_t), - OBJ_CLASS(ompi_osc_portals4_request_t), - 8, - 0, - 8, - NULL); + OBJ_CONSTRUCT(&mca_osc_portals4_component.requests, opal_free_list_t); + ret = opal_free_list_init (&mca_osc_portals4_component.requests, + sizeof(ompi_osc_portals4_request_t), + OBJ_CLASS(ompi_osc_portals4_request_t), + 0, 0, 8, 0, 8, NULL, 0, NULL, NULL, NULL); if (OMPI_SUCCESS != ret) { opal_output_verbose(1, ompi_osc_base_framework.framework_output, - "%s:%d: ompi_free_list_init failed: %d\n", + "%s:%d: opal_free_list_init failed: %d\n", __FILE__, __LINE__, ret); return ret; } diff --git a/ompi/mca/osc/portals4/osc_portals4_request.h b/ompi/mca/osc/portals4/osc_portals4_request.h index c2a5c3b9fc..0b7a9945fe 100644 --- a/ompi/mca/osc/portals4/osc_portals4_request.h +++ b/ompi/mca/osc/portals4/osc_portals4_request.h @@ -1,5 +1,8 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2011-2013 Sandia National Laboratories. All rights reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -21,11 +24,10 @@ typedef struct ompi_osc_portals4_request_t ompi_osc_portals4_request_t; OBJ_CLASS_DECLARATION(ompi_osc_portals4_request_t); -#define OMPI_OSC_PORTALS4_REQUEST_ALLOC(win, req) \ +#define OMPI_OSC_PORTALS4_REQUEST_ALLOC(win, req) \ do { \ - ompi_free_list_item_t *item; \ - OMPI_FREE_LIST_WAIT_MT(&mca_osc_portals4_component.requests, \ - item); \ + opal_free_list_item_t *item; \ + item = opal_free_list_wait(&mca_osc_portals4_component.requests); \ req = (ompi_osc_portals4_request_t*) item; \ OMPI_REQUEST_INIT(&req->super, false); \ req->super.req_mpi_object.win = win; \ @@ -38,8 +40,8 @@ OBJ_CLASS_DECLARATION(ompi_osc_portals4_request_t); #define OMPI_OSC_PORTALS4_REQUEST_RETURN(req) \ do { \ OMPI_REQUEST_FINI(&request->super); \ - OMPI_FREE_LIST_RETURN_MT(&mca_osc_portals4_component.requests, \ - (ompi_free_list_item_t*) req); \ + opal_free_list_return (&mca_osc_portals4_component.requests, \ + (opal_free_list_item_t*) req); \ } while (0) diff --git a/ompi/mca/osc/pt2pt/osc_pt2pt.h b/ompi/mca/osc/pt2pt/osc_pt2pt.h index 70b6fab7b8..faee09d3ac 100644 --- a/ompi/mca/osc/pt2pt/osc_pt2pt.h +++ b/ompi/mca/osc/pt2pt/osc_pt2pt.h @@ -8,7 +8,7 @@ * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. - * Copyright (c) 2007-2014 Los Alamos National Security, LLC. All rights + * Copyright (c) 2007-2015 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2010 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2012-2013 Sandia National Laboratories. All rights reserved. @@ -59,10 +59,10 @@ struct ompi_osc_pt2pt_component_t { int module_count; /** free list of ompi_osc_pt2pt_frag_t structures */ - ompi_free_list_t frags; + opal_free_list_t frags; /** Free list of requests */ - ompi_free_list_t requests; + opal_free_list_t requests; /** PT2PT component buffer size */ unsigned int buffer_size; diff --git a/ompi/mca/osc/pt2pt/osc_pt2pt_component.c b/ompi/mca/osc/pt2pt/osc_pt2pt_component.c index 351a5f2190..441d6be013 100644 --- a/ompi/mca/osc/pt2pt/osc_pt2pt_component.c +++ b/ompi/mca/osc/pt2pt/osc_pt2pt_component.c @@ -9,7 +9,7 @@ * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. - * Copyright (c) 2007-2014 Los Alamos National Security, LLC. All rights + * Copyright (c) 2007-2015 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2006-2008 University of Houston. All rights reserved. * Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved. @@ -254,28 +254,28 @@ component_init(bool enable_progress_threads, mca_osc_pt2pt_component.progress_enable = false; mca_osc_pt2pt_component.module_count = 0; - OBJ_CONSTRUCT(&mca_osc_pt2pt_component.frags, ompi_free_list_t); - ret = ompi_free_list_init_new (&mca_osc_pt2pt_component.frags, - sizeof(ompi_osc_pt2pt_frag_t), 8, - OBJ_CLASS(ompi_osc_pt2pt_frag_t), - mca_osc_pt2pt_component.buffer_size + - sizeof (ompi_osc_pt2pt_frag_header_t), - 8, 1, -1, 1, 0); + OBJ_CONSTRUCT(&mca_osc_pt2pt_component.frags, opal_free_list_t); + ret = opal_free_list_init (&mca_osc_pt2pt_component.frags, + sizeof(ompi_osc_pt2pt_frag_t), 8, + OBJ_CLASS(ompi_osc_pt2pt_frag_t), + mca_osc_pt2pt_component.buffer_size + + sizeof (ompi_osc_pt2pt_frag_header_t), + 8, 1, -1, 1, NULL, 0, NULL, NULL, NULL); if (OMPI_SUCCESS != ret) { opal_output_verbose(1, ompi_osc_base_framework.framework_output, - "%s:%d: ompi_free_list_init failed: %d", + "%s:%d: opal_free_list_init failed: %d", __FILE__, __LINE__, ret); return ret; } - OBJ_CONSTRUCT(&mca_osc_pt2pt_component.requests, ompi_free_list_t); - ret = ompi_free_list_init(&mca_osc_pt2pt_component.requests, - sizeof(ompi_osc_pt2pt_request_t), - OBJ_CLASS(ompi_osc_pt2pt_request_t), - 0, -1, 32, NULL); + OBJ_CONSTRUCT(&mca_osc_pt2pt_component.requests, opal_free_list_t); + ret = opal_free_list_init (&mca_osc_pt2pt_component.requests, + sizeof(ompi_osc_pt2pt_request_t), 8, + OBJ_CLASS(ompi_osc_pt2pt_request_t), + 0, 0, 0, -1, 32, NULL, 0, NULL, NULL, NULL); if (OMPI_SUCCESS != ret) { opal_output_verbose(1, ompi_osc_base_framework.framework_output, - "%s:%d: ompi_free_list_init failed: %d\n", + "%s:%d: opal_free_list_init failed: %d\n", __FILE__, __LINE__, ret); return ret; } diff --git a/ompi/mca/osc/pt2pt/osc_pt2pt_frag.c b/ompi/mca/osc/pt2pt/osc_pt2pt_frag.c index f3ac412148..64838500a7 100644 --- a/ompi/mca/osc/pt2pt/osc_pt2pt_frag.c +++ b/ompi/mca/osc/pt2pt/osc_pt2pt_frag.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2012-2013 Sandia National Laboratories. All rights reserved. - * Copyright (c) 2014 Los Alamos National Security, LLC. All rights + * Copyright (c) 2014-2015 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. @@ -26,7 +26,7 @@ static void ompi_osc_pt2pt_frag_constructor (ompi_osc_pt2pt_frag_t *frag){ frag->buffer = frag->super.ptr; } -OBJ_CLASS_INSTANCE(ompi_osc_pt2pt_frag_t, ompi_free_list_item_t, +OBJ_CLASS_INSTANCE(ompi_osc_pt2pt_frag_t, opal_free_list_item_t, ompi_osc_pt2pt_frag_constructor, NULL); static int frag_send_cb (ompi_request_t *request) @@ -40,7 +40,7 @@ static int frag_send_cb (ompi_request_t *request) frag->target, (void *) frag, (void *) request)); mark_outgoing_completion(module); - OMPI_FREE_LIST_RETURN_MT(&mca_osc_pt2pt_component.frags, &frag->super); + opal_free_list_return (&mca_osc_pt2pt_component.frags, &frag->super); /* put this request on the garbage colletion list */ diff --git a/ompi/mca/osc/pt2pt/osc_pt2pt_frag.h b/ompi/mca/osc/pt2pt/osc_pt2pt_frag.h index 7ce966f215..6487ac237a 100644 --- a/ompi/mca/osc/pt2pt/osc_pt2pt_frag.h +++ b/ompi/mca/osc/pt2pt/osc_pt2pt_frag.h @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2012 Sandia National Laboratories. All rights reserved. - * Copyright (c) 2014 Los Alamos National Security, LLC. All rights + * Copyright (c) 2014-2015 Los Alamos National Security, LLC. All rights * reserved. * $COPYRIGHT$ * @@ -21,7 +21,7 @@ /** Communication buffer for packing messages */ struct ompi_osc_pt2pt_frag_t { - ompi_free_list_item_t super; + opal_free_list_item_t super; /* target rank of buffer */ int target; unsigned char *buffer; @@ -66,7 +66,7 @@ static inline int ompi_osc_pt2pt_frag_alloc(ompi_osc_pt2pt_module_t *module, int OPAL_THREAD_LOCK(&module->lock); if (NULL == curr || curr->remain_len < request_len) { - ompi_free_list_item_t *item = NULL; + opal_free_list_item_t *item = NULL; if (NULL != curr) { curr->remain_len = 0; @@ -83,7 +83,7 @@ static inline int ompi_osc_pt2pt_frag_alloc(ompi_osc_pt2pt_module_t *module, int } } - OMPI_FREE_LIST_GET_MT(&mca_osc_pt2pt_component.frags, item); + item = opal_free_list_get (&mca_osc_pt2pt_component.frags); if (OPAL_UNLIKELY(NULL == item)) { return OMPI_ERR_OUT_OF_RESOURCE; } diff --git a/ompi/mca/osc/pt2pt/osc_pt2pt_request.h b/ompi/mca/osc/pt2pt/osc_pt2pt_request.h index 25b0cba6bf..1c0db9e123 100644 --- a/ompi/mca/osc/pt2pt/osc_pt2pt_request.h +++ b/ompi/mca/osc/pt2pt/osc_pt2pt_request.h @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2012 Sandia National Laboratories. All rights reserved. - * Copyright (c) 2014 Los Alamos National Security, LLC. All rights + * Copyright (c) 2014-2015 Los Alamos National Security, LLC. All rights * reserved. * $COPYRIGHT$ * @@ -34,16 +34,16 @@ OBJ_CLASS_DECLARATION(ompi_osc_pt2pt_request_t); /* REQUEST_ALLOC is only called from "top-level" functions (pt2pt_rput, pt2pt_rget, etc.), so it's ok to spin here... */ -#define OMPI_OSC_PT2PT_REQUEST_ALLOC(win, req) \ +#define OMPI_OSC_PT2PT_REQUEST_ALLOC(win, req) \ do { \ - ompi_free_list_item_t *item; \ + opal_free_list_item_t *item; \ do { \ - OMPI_FREE_LIST_GET_MT(&mca_osc_pt2pt_component.requests, item); \ + item = opal_free_list_get (&mca_osc_pt2pt_component.requests); \ if (NULL == item) { \ opal_progress(); \ } \ } while (NULL == item); \ - req = (ompi_osc_pt2pt_request_t*) item; \ + req = (ompi_osc_pt2pt_request_t*) item; \ OMPI_REQUEST_INIT(&req->super, false); \ req->super.req_mpi_object.win = win; \ req->super.req_complete = false; \ @@ -52,11 +52,11 @@ OBJ_CLASS_DECLARATION(ompi_osc_pt2pt_request_t); req->internal = false; \ } while (0) -#define OMPI_OSC_PT2PT_REQUEST_RETURN(req) \ +#define OMPI_OSC_PT2PT_REQUEST_RETURN(req) \ do { \ OMPI_REQUEST_FINI(&(req)->super); \ - OMPI_FREE_LIST_RETURN_MT(&mca_osc_pt2pt_component.requests, \ - (ompi_free_list_item_t *) (req)); \ + opal_free_list_return (&mca_osc_pt2pt_component.requests, \ + (opal_free_list_item_t *) (req)); \ } while (0) static inline void ompi_osc_pt2pt_request_complete (ompi_osc_pt2pt_request_t *request, int mpi_error) diff --git a/ompi/mca/osc/sm/osc_sm.h b/ompi/mca/osc/sm/osc_sm.h index 830cc63910..2e5e254f4c 100644 --- a/ompi/mca/osc/sm/osc_sm.h +++ b/ompi/mca/osc/sm/osc_sm.h @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2012 Sandia National Laboratories. All rights reserved. - * Copyright (c) 2014 Los Alamos National Security, LLC. All rights + * Copyright (c) 2014-2015 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. @@ -15,7 +15,6 @@ #ifndef OSC_SM_SM_H #define OSC_SM_SM_H -#include "opal/class/ompi_free_list.h" #include "opal/mca/shmem/base/base.h" /* data shared across all peers */ diff --git a/ompi/mca/osc/sm/osc_sm_component.c b/ompi/mca/osc/sm/osc_sm_component.c index 103783d97f..4c473e54fb 100644 --- a/ompi/mca/osc/sm/osc_sm_component.c +++ b/ompi/mca/osc/sm/osc_sm_component.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2012 Sandia National Laboratories. All rights reserved. - * Copyright (c) 2014 Los Alamos National Security, LLC. All rights + * Copyright (c) 2014-2015 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2014 Intel, Inc. All rights reserved. * Copyright (c) 2015 Cisco Systems, Inc. All rights reserved. @@ -18,7 +18,6 @@ #include "ompi/mca/osc/base/base.h" #include "ompi/mca/osc/base/osc_base_obj_convert.h" #include "ompi/request/request.h" -#include "opal/class/ompi_free_list.h" #include "opal/util/sys_limits.h" #include "osc_sm.h" diff --git a/ompi/mca/pml/base/pml_base_frame.c b/ompi/mca/pml/base/pml_base_frame.c index 71d8a9e610..f7a05b0f9e 100644 --- a/ompi/mca/pml/base/pml_base_frame.c +++ b/ompi/mca/pml/base/pml_base_frame.c @@ -1,4 +1,4 @@ -/* -*- Mode: C; c-basic-offset:4 ; -*- */ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2004-2010 The Trustees of Indiana University and Indiana * University Research and Technology @@ -11,7 +11,8 @@ * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * Copyright (c) 2009 Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2013 Los Alamos National Security, LLC. All rights reserved. + * Copyright (c) 2013-2015 Los Alamos National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -137,7 +138,7 @@ static int mca_pml_base_close(void) anymore) */ /** - * Destruct the send and receive queues. The ompi_free_list_t destructor + * Destruct the send and receive queues. The opal_free_list_t destructor * will return the memory to the mpool, so this has to be done before the * mpool get released by the PML close function. */ @@ -172,8 +173,8 @@ static int mca_pml_base_open(mca_base_open_flag_t flags) * their content, they should get constructed as soon as possible once the MPI * process is started. */ - OBJ_CONSTRUCT(&mca_pml_base_send_requests, ompi_free_list_t); - OBJ_CONSTRUCT(&mca_pml_base_recv_requests, ompi_free_list_t); + OBJ_CONSTRUCT(&mca_pml_base_send_requests, opal_free_list_t); + OBJ_CONSTRUCT(&mca_pml_base_recv_requests, opal_free_list_t); OBJ_CONSTRUCT(&mca_pml_base_pml, opal_pointer_array_t); diff --git a/ompi/mca/pml/base/pml_base_request.c b/ompi/mca/pml/base/pml_base_request.c index c808b56416..c1794c3b48 100644 --- a/ompi/mca/pml/base/pml_base_request.c +++ b/ompi/mca/pml/base/pml_base_request.c @@ -1,3 +1,4 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology @@ -9,6 +10,8 @@ * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -24,8 +27,8 @@ * If you wonder why these 2 freelists are declared here read the comment * in the pml_base_request.h file. */ -ompi_free_list_t mca_pml_base_send_requests = {{{0}}}; -ompi_free_list_t mca_pml_base_recv_requests = {{{0}}}; +opal_free_list_t mca_pml_base_send_requests = {{{0}}}; +opal_free_list_t mca_pml_base_recv_requests = {{{0}}}; static void mca_pml_base_request_construct(mca_pml_base_request_t* req) { diff --git a/ompi/mca/pml/base/pml_base_request.h b/ompi/mca/pml/base/pml_base_request.h index d63c1b3959..1530723957 100644 --- a/ompi/mca/pml/base/pml_base_request.h +++ b/ompi/mca/pml/base/pml_base_request.h @@ -1,4 +1,4 @@ -/* -*- Mode: C; c-basic-offset:4 ; -*- */ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology @@ -11,6 +11,8 @@ * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -24,7 +26,7 @@ #define MCA_PML_BASE_REQUEST_H #include "ompi_config.h" -#include "opal/class/ompi_free_list.h" +#include "opal/class/opal_free_list.h" #include "ompi/communicator/communicator.h" #include "ompi/request/request.h" #include "opal/datatype/opal_convertor.h" @@ -37,8 +39,8 @@ BEGIN_C_DECLS * the list. Beware these free lists have to be initialized * directly by the PML who win the PML election. */ -OMPI_DECLSPEC extern ompi_free_list_t mca_pml_base_send_requests; -OMPI_DECLSPEC extern ompi_free_list_t mca_pml_base_recv_requests; +OMPI_DECLSPEC extern opal_free_list_t mca_pml_base_send_requests; +OMPI_DECLSPEC extern opal_free_list_t mca_pml_base_recv_requests; /** * Type of request. diff --git a/ompi/mca/pml/cm/pml_cm.c b/ompi/mca/pml/cm/pml_cm.c index 5a9e0663f4..a7322e4c33 100644 --- a/ompi/mca/pml/cm/pml_cm.c +++ b/ompi/mca/pml/cm/pml_cm.c @@ -1,3 +1,4 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2006-2007 The Trustees of Indiana University and Indiana * University Research and Technology @@ -8,6 +9,8 @@ * Copyright (c) 2004-2006 The Regents of the University of California. * All rights reserved. * Copyright (c) 2011 Sandia National Laboratories. All rights reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -60,25 +63,25 @@ mca_pml_cm_enable(bool enable) { /* BWB - FIX ME - need to have this actually do something, maybe? */ - ompi_free_list_init_new(&mca_pml_base_send_requests, - sizeof(mca_pml_cm_hvy_send_request_t) + ompi_mtl->mtl_request_size, - opal_cache_line_size, - OBJ_CLASS(mca_pml_cm_hvy_send_request_t), - 0,opal_cache_line_size, - ompi_pml_cm.free_list_num, - ompi_pml_cm.free_list_max, - ompi_pml_cm.free_list_inc, - NULL); + opal_free_list_init (&mca_pml_base_send_requests, + sizeof(mca_pml_cm_hvy_send_request_t) + ompi_mtl->mtl_request_size, + opal_cache_line_size, + OBJ_CLASS(mca_pml_cm_hvy_send_request_t), + 0,opal_cache_line_size, + ompi_pml_cm.free_list_num, + ompi_pml_cm.free_list_max, + ompi_pml_cm.free_list_inc, + NULL, 0, NULL, NULL, NULL); - ompi_free_list_init_new(&mca_pml_base_recv_requests, - sizeof(mca_pml_cm_hvy_recv_request_t) + ompi_mtl->mtl_request_size, - opal_cache_line_size, - OBJ_CLASS(mca_pml_cm_hvy_recv_request_t), - 0,opal_cache_line_size, - ompi_pml_cm.free_list_num, - ompi_pml_cm.free_list_max, - ompi_pml_cm.free_list_inc, - NULL); + opal_free_list_init (&mca_pml_base_recv_requests, + sizeof(mca_pml_cm_hvy_recv_request_t) + ompi_mtl->mtl_request_size, + opal_cache_line_size, + OBJ_CLASS(mca_pml_cm_hvy_recv_request_t), + 0,opal_cache_line_size, + ompi_pml_cm.free_list_num, + ompi_pml_cm.free_list_max, + ompi_pml_cm.free_list_inc, + NULL, 0, NULL, NULL, NULL); return OMPI_SUCCESS; } diff --git a/ompi/mca/pml/cm/pml_cm_recvreq.h b/ompi/mca/pml/cm/pml_cm_recvreq.h index 904f69c671..1279e9e42a 100644 --- a/ompi/mca/pml/cm/pml_cm_recvreq.h +++ b/ompi/mca/pml/cm/pml_cm_recvreq.h @@ -1,3 +1,4 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology @@ -10,6 +11,8 @@ * Copyright (c) 2004-2006 The Regents of the University of California. * All rights reserved. * Copyright (c) 2012 Sandia National Laboratories. All rights reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -53,10 +56,9 @@ OBJ_CLASS_DECLARATION(mca_pml_cm_hvy_recv_request_t); * @return Receive request. */ #define MCA_PML_CM_THIN_RECV_REQUEST_ALLOC(recvreq) \ - do { \ - ompi_free_list_item_t*item; \ - OMPI_FREE_LIST_GET_MT(&mca_pml_base_recv_requests, item); \ - recvreq = (mca_pml_cm_thin_recv_request_t*) item; \ +do { \ + recvreq = (mca_pml_cm_thin_recv_request_t*) \ + opal_free_list_get (&mca_pml_base_recv_requests); \ recvreq->req_base.req_pml_type = MCA_PML_CM_REQUEST_RECV_THIN; \ recvreq->req_mtl.ompi_req = (ompi_request_t*) recvreq; \ recvreq->req_mtl.completion_callback = mca_pml_cm_recv_request_completion; \ @@ -64,9 +66,8 @@ OBJ_CLASS_DECLARATION(mca_pml_cm_hvy_recv_request_t); #define MCA_PML_CM_HVY_RECV_REQUEST_ALLOC(recvreq) \ do { \ - ompi_free_list_item_t*item; \ - OMPI_FREE_LIST_GET_MT(&mca_pml_base_recv_requests, item); \ - recvreq = (mca_pml_cm_hvy_recv_request_t*) item; \ + recvreq = (mca_pml_cm_hvy_recv_request_t*) \ + opal_free_list_get (&mca_pml_base_recv_requests); \ recvreq->req_base.req_pml_type = MCA_PML_CM_REQUEST_RECV_HEAVY; \ recvreq->req_mtl.ompi_req = (ompi_request_t*) recvreq; \ recvreq->req_mtl.completion_callback = mca_pml_cm_recv_request_completion; \ @@ -296,8 +297,8 @@ do { \ OBJ_RELEASE((recvreq)->req_base.req_datatype); \ OMPI_REQUEST_FINI(&(recvreq)->req_base.req_ompi); \ opal_convertor_cleanup( &((recvreq)->req_base.req_convertor) ); \ - OMPI_FREE_LIST_RETURN_MT( &mca_pml_base_recv_requests, \ - (ompi_free_list_item_t*)(recvreq)); \ + opal_free_list_return ( &mca_pml_base_recv_requests, \ + (opal_free_list_item_t*)(recvreq)); \ } /** @@ -309,8 +310,8 @@ do { \ OBJ_RELEASE((recvreq)->req_base.req_datatype); \ OMPI_REQUEST_FINI(&(recvreq)->req_base.req_ompi); \ opal_convertor_cleanup( &((recvreq)->req_base.req_convertor) ); \ - OMPI_FREE_LIST_RETURN_MT( &mca_pml_base_recv_requests, \ - (ompi_free_list_item_t*)(recvreq)); \ + opal_free_list_return ( &mca_pml_base_recv_requests, \ + (opal_free_list_item_t*)(recvreq)); \ } extern void mca_pml_cm_recv_request_completion(struct mca_mtl_request_t *mtl_request); diff --git a/ompi/mca/pml/cm/pml_cm_sendreq.h b/ompi/mca/pml/cm/pml_cm_sendreq.h index 125eb57ee3..a16ea9c50f 100644 --- a/ompi/mca/pml/cm/pml_cm_sendreq.h +++ b/ompi/mca/pml/cm/pml_cm_sendreq.h @@ -1,3 +1,4 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology @@ -9,6 +10,8 @@ * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2006 The Regents of the University of California. * All rights reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -59,14 +62,13 @@ OBJ_CLASS_DECLARATION(mca_pml_cm_hvy_send_request_t); #define MCA_PML_CM_THIN_SEND_REQUEST_ALLOC(sendreq, comm, dst, \ ompi_proc) \ do { \ - ompi_free_list_item_t* item; \ ompi_proc = ompi_comm_peer_lookup( comm, dst ); \ \ if(OPAL_UNLIKELY(NULL == ompi_proc)) { \ sendreq = NULL; \ } else { \ - OMPI_FREE_LIST_WAIT_MT(&mca_pml_base_send_requests, item); \ - sendreq = (mca_pml_cm_thin_send_request_t*)item; \ + sendreq = (mca_pml_cm_thin_send_request_t*) \ + opal_free_list_wait (&mca_pml_base_send_requests); \ sendreq->req_send.req_base.req_pml_type = MCA_PML_CM_REQUEST_SEND_THIN; \ sendreq->req_mtl.ompi_req = (ompi_request_t*) sendreq; \ sendreq->req_mtl.completion_callback = mca_pml_cm_send_request_completion; \ @@ -77,13 +79,12 @@ do { \ #define MCA_PML_CM_HVY_SEND_REQUEST_ALLOC(sendreq, comm, dst, \ ompi_proc) \ { \ - ompi_free_list_item_t* item; \ ompi_proc = ompi_comm_peer_lookup( comm, dst ); \ if(OPAL_UNLIKELY(NULL == ompi_proc)) { \ sendreq = NULL; \ } else { \ - OMPI_FREE_LIST_WAIT_MT(&mca_pml_base_send_requests, item); \ - sendreq = (mca_pml_cm_hvy_send_request_t*)item; \ + sendreq = (mca_pml_cm_hvy_send_request_t*) \ + opal_free_list_wait (&mca_pml_base_send_requests); \ sendreq->req_send.req_base.req_pml_type = MCA_PML_CM_REQUEST_SEND_HEAVY; \ sendreq->req_mtl.ompi_req = (ompi_request_t*) sendreq; \ sendreq->req_mtl.completion_callback = mca_pml_cm_send_request_completion; \ @@ -307,8 +308,8 @@ do { OBJ_RELEASE(sendreq->req_send.req_base.req_comm); \ OMPI_REQUEST_FINI(&sendreq->req_send.req_base.req_ompi); \ opal_convertor_cleanup( &(sendreq->req_send.req_base.req_convertor) ); \ - OMPI_FREE_LIST_RETURN_MT( &mca_pml_base_send_requests, \ - (ompi_free_list_item_t*)sendreq); \ + opal_free_list_return ( &mca_pml_base_send_requests, \ + (opal_free_list_item_t*)sendreq); \ } /* @@ -346,8 +347,8 @@ do { \ OBJ_RELEASE(sendreq->req_send.req_base.req_comm); \ OMPI_REQUEST_FINI(&sendreq->req_send.req_base.req_ompi); \ opal_convertor_cleanup( &(sendreq->req_send.req_base.req_convertor) ); \ - OMPI_FREE_LIST_RETURN_MT( &mca_pml_base_send_requests, \ - (ompi_free_list_item_t*)sendreq); \ + opal_free_list_return ( &mca_pml_base_send_requests, \ + (opal_free_list_item_t*)sendreq); \ } extern void diff --git a/ompi/mca/pml/crcpw/pml_crcpw.h b/ompi/mca/pml/crcpw/pml_crcpw.h index d102303344..5f6b800836 100644 --- a/ompi/mca/pml/crcpw/pml_crcpw.h +++ b/ompi/mca/pml/crcpw/pml_crcpw.h @@ -1,4 +1,4 @@ -/* -*- Mode: C; c-basic-offset:4 ; -*- */ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2004-2009 The Trustees of Indiana University and Indiana * University Research and Technology @@ -10,6 +10,8 @@ * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2006 The Regents of the University of California. * All rights reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -25,7 +27,7 @@ #include "ompi_config.h" -#include "opal/class/ompi_free_list.h" +#include "opal/class/opal_free_list.h" #include "ompi/request/request.h" #include "ompi/mca/pml/pml.h" #include "ompi/mca/pml/base/pml_base_request.h" @@ -59,7 +61,7 @@ BEGIN_C_DECLS extern mca_pml_crcpw_module_t mca_pml_crcpw_module; /* Free list of PML states */ - OMPI_MODULE_DECLSPEC extern ompi_free_list_t pml_state_list; + OMPI_MODULE_DECLSPEC extern opal_free_list_t pml_state_list; OMPI_MODULE_DECLSPEC extern bool pml_crcpw_is_finalized; /* diff --git a/ompi/mca/pml/crcpw/pml_crcpw_component.c b/ompi/mca/pml/crcpw/pml_crcpw_component.c index d0d0c38dfb..51d9b8ce2c 100644 --- a/ompi/mca/pml/crcpw/pml_crcpw_component.c +++ b/ompi/mca/pml/crcpw/pml_crcpw_component.c @@ -1,3 +1,4 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2004-2009 The Trustees of Indiana University and Indiana * University Research and Technology @@ -10,6 +11,8 @@ * Copyright (c) 2004-2006 The Regents of the University of California. * All rights reserved. * Copyright (c) 2010 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -64,7 +67,7 @@ mca_pml_crcpw_component_t mca_pml_crcpw_component = { false }; -ompi_free_list_t pml_state_list; +opal_free_list_t pml_state_list; bool pml_crcpw_is_finalized = false; static int mca_pml_crcpw_component_register(void) @@ -148,8 +151,8 @@ mca_pml_base_module_t* mca_pml_crcpw_component_init(int* priority, opal_output_verbose( 20, mca_pml_crcpw_component.output_handle, "pml:crcpw: component_init: Initalize Wrapper"); - OBJ_CONSTRUCT(&pml_state_list, ompi_free_list_t); - ompi_free_list_init_new( &pml_state_list, + OBJ_CONSTRUCT(&pml_state_list, opal_free_list_t); + opal_free_list_init (&pml_state_list, sizeof(ompi_crcp_base_pml_state_t), opal_cache_line_size, OBJ_CLASS(ompi_crcp_base_pml_state_t), @@ -157,7 +160,7 @@ mca_pml_base_module_t* mca_pml_crcpw_component_init(int* priority, 5, /* Initial number */ -1, /* Max = Unlimited */ 64, /* Increment by */ - NULL); + NULL, 0, NULL, NULL, NULL); } else { opal_output_verbose( 20, mca_pml_crcpw_component.output_handle, diff --git a/ompi/mca/pml/crcpw/pml_crcpw_module.c b/ompi/mca/pml/crcpw/pml_crcpw_module.c index 0460a67eb0..51ed444221 100644 --- a/ompi/mca/pml/crcpw/pml_crcpw_module.c +++ b/ompi/mca/pml/crcpw/pml_crcpw_module.c @@ -1,3 +1,4 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2004-2009 The Trustees of Indiana University and Indiana * University Research and Technology @@ -10,6 +11,8 @@ * Copyright (c) 2004-2006 The Regents of the University of California. * All rights reserved. * Copyright (c) 2011 Sandia National Laboratories. All rights reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -27,7 +30,7 @@ #include "ompi/mca/pml/crcpw/pml_crcpw.h" #include "ompi/mca/bml/base/base.h" -#include "opal/class/ompi_free_list.h" +#include "opal/class/opal_free_list.h" mca_pml_crcpw_module_t mca_pml_crcpw_module = { { @@ -61,17 +64,16 @@ mca_pml_crcpw_module_t mca_pml_crcpw_module = { #define PML_CRCP_STATE_ALLOC(pml_state) \ do { \ if( !pml_crcpw_is_finalized ) { \ - ompi_free_list_item_t* item; \ - OMPI_FREE_LIST_WAIT_MT(&pml_state_list, item); \ - pml_state = (ompi_crcp_base_pml_state_t*)item; \ + pml_state = (ompi_crcp_base_pml_state_t*) \ + opal_free_list_wait (&pml_state_list); \ } \ } while(0); #define PML_CRCP_STATE_RETURN(pml_state) \ do { \ if( !pml_crcpw_is_finalized ) { \ - OMPI_FREE_LIST_RETURN_MT(&pml_state_list, \ - (ompi_free_list_item_t*)pml_state); \ + opal_free_list_return (&pml_state_list, \ + (opal_free_list_item_t*)pml_state); \ } \ } while(0); diff --git a/ompi/mca/pml/ob1/pml_ob1.c b/ompi/mca/pml/ob1/pml_ob1.c index eac927c489..c7eaef5d85 100644 --- a/ompi/mca/pml/ob1/pml_ob1.c +++ b/ompi/mca/pml/ob1/pml_ob1.c @@ -98,53 +98,53 @@ int mca_pml_ob1_enable(bool enable) OBJ_CONSTRUCT(&mca_pml_ob1.lock, opal_mutex_t); /* fragments */ - OBJ_CONSTRUCT(&mca_pml_ob1.rdma_frags, ompi_free_list_t); - ompi_free_list_init_new( &mca_pml_ob1.rdma_frags, - sizeof(mca_pml_ob1_rdma_frag_t), - opal_cache_line_size, - OBJ_CLASS(mca_pml_ob1_rdma_frag_t), - 0,opal_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.rdma_frags, opal_free_list_t); + opal_free_list_init ( &mca_pml_ob1.rdma_frags, + sizeof(mca_pml_ob1_rdma_frag_t), + opal_cache_line_size, + OBJ_CLASS(mca_pml_ob1_rdma_frag_t), + 0,opal_cache_line_size, + mca_pml_ob1.free_list_num, + mca_pml_ob1.free_list_max, + mca_pml_ob1.free_list_inc, + NULL, 0, NULL, NULL, NULL); - OBJ_CONSTRUCT(&mca_pml_ob1.recv_frags, ompi_free_list_t); + OBJ_CONSTRUCT(&mca_pml_ob1.recv_frags, opal_free_list_t); - ompi_free_list_init_new( &mca_pml_ob1.recv_frags, - sizeof(mca_pml_ob1_recv_frag_t) + mca_pml_ob1.unexpected_limit, - opal_cache_line_size, - OBJ_CLASS(mca_pml_ob1_recv_frag_t), - 0,opal_cache_line_size, - mca_pml_ob1.free_list_num, - mca_pml_ob1.free_list_max, - mca_pml_ob1.free_list_inc, - NULL ); + opal_free_list_init ( &mca_pml_ob1.recv_frags, + sizeof(mca_pml_ob1_recv_frag_t) + mca_pml_ob1.unexpected_limit, + opal_cache_line_size, + OBJ_CLASS(mca_pml_ob1_recv_frag_t), + 0,opal_cache_line_size, + mca_pml_ob1.free_list_num, + mca_pml_ob1.free_list_max, + mca_pml_ob1.free_list_inc, + NULL, 0, NULL, NULL, NULL); - OBJ_CONSTRUCT(&mca_pml_ob1.pending_pckts, ompi_free_list_t); - ompi_free_list_init_new( &mca_pml_ob1.pending_pckts, - sizeof(mca_pml_ob1_pckt_pending_t), - opal_cache_line_size, - OBJ_CLASS(mca_pml_ob1_pckt_pending_t), - 0,opal_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, opal_free_list_t); + opal_free_list_init ( &mca_pml_ob1.pending_pckts, + sizeof(mca_pml_ob1_pckt_pending_t), + opal_cache_line_size, + OBJ_CLASS(mca_pml_ob1_pckt_pending_t), + 0,opal_cache_line_size, + mca_pml_ob1.free_list_num, + mca_pml_ob1.free_list_max, + mca_pml_ob1.free_list_inc, + NULL, 0, NULL, NULL, NULL); - 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_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), - opal_cache_line_size, - OBJ_CLASS(mca_pml_ob1_send_range_t), - 0,opal_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.buffers, opal_free_list_t); + OBJ_CONSTRUCT(&mca_pml_ob1.send_ranges, opal_free_list_t); + opal_free_list_init ( &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), + opal_cache_line_size, + OBJ_CLASS(mca_pml_ob1_send_range_t), + 0,opal_cache_line_size, + mca_pml_ob1.free_list_num, + mca_pml_ob1.free_list_max, + mca_pml_ob1.free_list_inc, + NULL, 0, NULL, NULL, NULL); /* pending operations */ OBJ_CONSTRUCT(&mca_pml_ob1.send_pending, opal_list_t); @@ -160,29 +160,29 @@ 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_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), - opal_cache_line_size, - OBJ_CLASS(mca_pml_ob1_send_request_t), - 0,opal_cache_line_size, - mca_pml_ob1.free_list_num, - mca_pml_ob1.free_list_max, - mca_pml_ob1.free_list_inc, - NULL ); + opal_free_list_init ( &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), + opal_cache_line_size, + OBJ_CLASS(mca_pml_ob1_send_request_t), + 0,opal_cache_line_size, + mca_pml_ob1.free_list_num, + mca_pml_ob1.free_list_max, + mca_pml_ob1.free_list_inc, + NULL, 0, NULL, NULL, NULL); - 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), - opal_cache_line_size, - OBJ_CLASS(mca_pml_ob1_recv_request_t), - 0,opal_cache_line_size, - mca_pml_ob1.free_list_num, - mca_pml_ob1.free_list_max, - mca_pml_ob1.free_list_inc, - NULL ); + opal_free_list_init ( &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), + opal_cache_line_size, + OBJ_CLASS(mca_pml_ob1_recv_request_t), + 0,opal_cache_line_size, + mca_pml_ob1.free_list_num, + mca_pml_ob1.free_list_max, + mca_pml_ob1.free_list_inc, + NULL, 0, NULL, NULL, NULL); mca_pml_ob1.enabled = true; return OMPI_SUCCESS; diff --git a/ompi/mca/pml/ob1/pml_ob1.h b/ompi/mca/pml/ob1/pml_ob1.h index 924d3258f8..bc066202eb 100644 --- a/ompi/mca/pml/ob1/pml_ob1.h +++ b/ompi/mca/pml/ob1/pml_ob1.h @@ -28,7 +28,7 @@ #define MCA_PML_OB1_H #include "ompi_config.h" -#include "opal/class/ompi_free_list.h" +#include "opal/class/opal_free_list.h" #include "ompi/request/request.h" #include "ompi/mca/pml/pml.h" #include "ompi/mca/pml/base/pml_base_request.h" @@ -65,11 +65,11 @@ struct mca_pml_ob1_t { opal_mutex_t lock; /* free lists */ - ompi_free_list_t rdma_frags; - ompi_free_list_t recv_frags; - ompi_free_list_t pending_pckts; - ompi_free_list_t buffers; - ompi_free_list_t send_ranges; + opal_free_list_t rdma_frags; + opal_free_list_t recv_frags; + opal_free_list_t pending_pckts; + opal_free_list_t buffers; + opal_free_list_t send_ranges; /* list of pending operations */ opal_list_t pckt_pending; @@ -211,7 +211,7 @@ extern int mca_pml_ob1_ft_event( int state ); END_C_DECLS struct mca_pml_ob1_pckt_pending_t { - ompi_free_list_item_t super; + opal_free_list_item_t super; ompi_proc_t* proc; mca_pml_ob1_hdr_t hdr; struct mca_bml_base_btl_t *bml_btl; @@ -223,16 +223,15 @@ OBJ_CLASS_DECLARATION(mca_pml_ob1_pckt_pending_t); #define MCA_PML_OB1_PCKT_PENDING_ALLOC(pckt) \ do { \ - ompi_free_list_item_t* item; \ - OMPI_FREE_LIST_WAIT_MT(&mca_pml_ob1.pending_pckts, item); \ - pckt = (mca_pml_ob1_pckt_pending_t*)item; \ + pckt = (mca_pml_ob1_pckt_pending_t *) \ + opal_free_list_get (&mca_pml_ob1.pending_pckts); \ } while (0) #define MCA_PML_OB1_PCKT_PENDING_RETURN(pckt) \ do { \ /* return packet */ \ - OMPI_FREE_LIST_RETURN_MT(&mca_pml_ob1.pending_pckts, \ - (ompi_free_list_item_t*)pckt); \ + opal_free_list_return (&mca_pml_ob1.pending_pckts, \ + (opal_free_list_item_t*)pckt); \ } while(0) #define MCA_PML_OB1_ADD_FIN_TO_PENDING(P, D, Sz, B, O, S) \ diff --git a/ompi/mca/pml/ob1/pml_ob1_component.c b/ompi/mca/pml/ob1/pml_ob1_component.c index ca5831366a..13444cd660 100644 --- a/ompi/mca/pml/ob1/pml_ob1_component.c +++ b/ompi/mca/pml/ob1/pml_ob1_component.c @@ -12,7 +12,7 @@ * All rights reserved. * Copyright (c) 2007-2010 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved - * Copyright (c) 2013 Los Alamos National Security, LLC. All rights + * Copyright (c) 2013-2015 Los Alamos National Security, LLC. All rights * reserved. * $COPYRIGHT$ * @@ -40,7 +40,7 @@ #include "opal/runtime/opal_params.h" OBJ_CLASS_INSTANCE( mca_pml_ob1_pckt_pending_t, - ompi_free_list_item_t, + opal_free_list_item_t, NULL, NULL ); diff --git a/ompi/mca/pml/ob1/pml_ob1_rdmafrag.c b/ompi/mca/pml/ob1/pml_ob1_rdmafrag.c index cc13628eb4..a50859ed0b 100644 --- a/ompi/mca/pml/ob1/pml_ob1_rdmafrag.c +++ b/ompi/mca/pml/ob1/pml_ob1_rdmafrag.c @@ -31,6 +31,6 @@ static void mca_pml_ob1_rdma_frag_constructor (mca_pml_ob1_rdma_frag_t *frag) OBJ_CLASS_INSTANCE( mca_pml_ob1_rdma_frag_t, - ompi_free_list_item_t, + opal_free_list_item_t, mca_pml_ob1_rdma_frag_constructor, NULL); diff --git a/ompi/mca/pml/ob1/pml_ob1_rdmafrag.h b/ompi/mca/pml/ob1/pml_ob1_rdmafrag.h index 132c962833..ea15b67300 100644 --- a/ompi/mca/pml/ob1/pml_ob1_rdmafrag.h +++ b/ompi/mca/pml/ob1/pml_ob1_rdmafrag.h @@ -10,7 +10,7 @@ * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. - * Copyright (c) 2014 Los Alamos National Security, LLC. All rights + * Copyright (c) 2014-2015 Los Alamos National Security, LLC. All rights * reserved. * $COPYRIGHT$ * @@ -42,7 +42,7 @@ typedef void (*mca_pml_ob1_rdma_frag_callback_t)(struct mca_pml_ob1_rdma_frag_t * Used to keep track of local and remote RDMA operations. */ struct mca_pml_ob1_rdma_frag_t { - ompi_free_list_item_t super; + opal_free_list_item_t super; mca_bml_base_btl_t *rdma_bml; mca_pml_ob1_hdr_t rdma_hdr; mca_pml_ob1_rdma_state_t rdma_state; @@ -65,10 +65,9 @@ OBJ_CLASS_DECLARATION(mca_pml_ob1_rdma_frag_t); #define MCA_PML_OB1_RDMA_FRAG_ALLOC(frag) \ do { \ - ompi_free_list_item_t* item; \ - OMPI_FREE_LIST_WAIT_MT(&mca_pml_ob1.rdma_frags, item); \ - frag = (mca_pml_ob1_rdma_frag_t*)item; \ -} while(0) + frag = (mca_pml_ob1_rdma_frag_t *) \ + opal_free_list_wait (&mca_pml_ob1.rdma_frags); \ + } while(0) #define MCA_PML_OB1_RDMA_FRAG_RETURN(frag) \ do { \ @@ -77,8 +76,8 @@ OBJ_CLASS_DECLARATION(mca_pml_ob1_rdma_frag_t); mca_bml_base_deregister_mem (frag->rdma_bml, frag->local_handle); \ frag->local_handle = NULL; \ } \ - OMPI_FREE_LIST_RETURN_MT(&mca_pml_ob1.rdma_frags, \ - (ompi_free_list_item_t*)frag); \ + opal_free_list_return (&mca_pml_ob1.rdma_frags, \ + (opal_free_list_item_t*)frag); \ } while (0) END_C_DECLS diff --git a/ompi/mca/pml/ob1/pml_ob1_recvfrag.c b/ompi/mca/pml/ob1/pml_ob1_recvfrag.c index e37e1e7144..14930c1d8a 100644 --- a/ompi/mca/pml/ob1/pml_ob1_recvfrag.c +++ b/ompi/mca/pml/ob1/pml_ob1_recvfrag.c @@ -50,7 +50,7 @@ #endif /* OPAL_CUDA_SUPPORT */ OBJ_CLASS_INSTANCE( mca_pml_ob1_buffer_t, - ompi_free_list_item_t, + opal_free_list_item_t, NULL, NULL ); diff --git a/ompi/mca/pml/ob1/pml_ob1_recvfrag.h b/ompi/mca/pml/ob1/pml_ob1_recvfrag.h index c8f2c5bc49..82f90b29f0 100644 --- a/ompi/mca/pml/ob1/pml_ob1_recvfrag.h +++ b/ompi/mca/pml/ob1/pml_ob1_recvfrag.h @@ -12,7 +12,7 @@ * All rights reserved. * Copyright (c) 2008 UT-Battelle, LLC. All rights reserved. * Copyright (c) 2011 Sandia National Laboratories. All rights reserved. - * Copyright (c) 2012 Los Alamos National Security, LLC. All rights + * Copyright (c) 2012-2015 Los Alamos National Security, LLC. All rights * reserved. * $COPYRIGHT$ * @@ -39,7 +39,7 @@ typedef struct mca_pml_ob1_buffer_t mca_pml_ob1_buffer_t; struct mca_pml_ob1_recv_frag_t { - ompi_free_list_item_t super; + opal_free_list_item_t super; mca_pml_ob1_hdr_t hdr; size_t num_segments; mca_btl_base_module_t* btl; @@ -54,9 +54,8 @@ OBJ_CLASS_DECLARATION(mca_pml_ob1_recv_frag_t); #define MCA_PML_OB1_RECV_FRAG_ALLOC(frag) \ do { \ - ompi_free_list_item_t* item; \ - OMPI_FREE_LIST_WAIT_MT(&mca_pml_ob1.recv_frags, item); \ - frag = (mca_pml_ob1_recv_frag_t*)item; \ + frag = (mca_pml_ob1_recv_frag_t *) \ + opal_free_list_wait (&mca_pml_ob1.recv_frags); \ } while(0) @@ -104,8 +103,8 @@ do { \ frag->num_segments = 0; \ \ /* return recv_frag */ \ - OMPI_FREE_LIST_RETURN_MT(&mca_pml_ob1.recv_frags, \ - (ompi_free_list_item_t*)frag); \ + opal_free_list_return (&mca_pml_ob1.recv_frags, \ + (opal_free_list_item_t*)frag); \ } while(0) diff --git a/ompi/mca/pml/ob1/pml_ob1_recvreq.h b/ompi/mca/pml/ob1/pml_ob1_recvreq.h index 4340ade3f3..25da474f52 100644 --- a/ompi/mca/pml/ob1/pml_ob1_recvreq.h +++ b/ompi/mca/pml/ob1/pml_ob1_recvreq.h @@ -11,7 +11,7 @@ * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * Copyright (c) 2008 UT-Battelle, LLC. All rights reserved. - * Copyright (c) 2011-2014 Los Alamos National Security, LLC. All rights + * Copyright (c) 2011-2015 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2014 Research Organization for Information Science * and Technology (RIST). All rights reserved. @@ -79,9 +79,8 @@ static inline bool unlock_recv_request(mca_pml_ob1_recv_request_t *recvreq) */ #define MCA_PML_OB1_RECV_REQUEST_ALLOC(recvreq) \ do { \ - ompi_free_list_item_t* item; \ - OMPI_FREE_LIST_GET_MT(&mca_pml_base_recv_requests, item); \ - recvreq = (mca_pml_ob1_recv_request_t*)item; \ + recvreq = (mca_pml_ob1_recv_request_t *) \ + opal_free_list_get (&mca_pml_base_recv_requests); \ } while(0) @@ -138,8 +137,8 @@ do { \ mca_bml_base_deregister_mem ((recvreq)->rdma_bml, (recvreq)->local_handle); \ (recvreq)->local_handle = NULL; \ } \ - OMPI_FREE_LIST_RETURN_MT( &mca_pml_base_recv_requests, \ - (ompi_free_list_item_t*)(recvreq)); \ + opal_free_list_return (&mca_pml_base_recv_requests, \ + (opal_free_list_item_t*)(recvreq)); \ } /** diff --git a/ompi/mca/pml/ob1/pml_ob1_sendreq.c b/ompi/mca/pml/ob1/pml_ob1_sendreq.c index b9c6dedc1b..9973a356ea 100644 --- a/ompi/mca/pml/ob1/pml_ob1_sendreq.c +++ b/ompi/mca/pml/ob1/pml_ob1_sendreq.c @@ -36,7 +36,7 @@ #include "ompi/mca/bml/base/base.h" #include "ompi/memchecker.h" -OBJ_CLASS_INSTANCE(mca_pml_ob1_send_range_t, ompi_free_list_item_t, +OBJ_CLASS_INSTANCE(mca_pml_ob1_send_range_t, opal_free_list_item_t, NULL, NULL); void mca_pml_ob1_send_request_process_pending(mca_bml_base_btl_t *bml_btl) @@ -830,7 +830,7 @@ void mca_pml_ob1_send_request_copy_in_out( mca_pml_ob1_send_request_t *sendreq, uint64_t send_length ) { mca_pml_ob1_send_range_t *sr; - ompi_free_list_item_t *i; + opal_free_list_item_t *i; mca_bml_base_endpoint_t* bml_endpoint = sendreq->req_endpoint; int num_btls = mca_bml_base_btl_array_get_size(&bml_endpoint->btl_send); int n; @@ -839,7 +839,7 @@ void mca_pml_ob1_send_request_copy_in_out( mca_pml_ob1_send_request_t *sendreq, if( OPAL_UNLIKELY(0 == send_length) ) return; - OMPI_FREE_LIST_WAIT_MT(&mca_pml_ob1.send_ranges, i); + i = opal_free_list_wait (&mca_pml_ob1.send_ranges); sr = (mca_pml_ob1_send_range_t*)i; @@ -893,7 +893,7 @@ get_next_send_range(mca_pml_ob1_send_request_t* sendreq, { OPAL_THREAD_LOCK(&sendreq->req_send_range_lock); opal_list_remove_item(&sendreq->req_send_ranges, (opal_list_item_t *)range); - OMPI_FREE_LIST_RETURN_MT(&mca_pml_ob1.send_ranges, &range->base); + opal_free_list_return (&mca_pml_ob1.send_ranges, &range->base); range = get_send_range_nolock(sendreq); OPAL_THREAD_UNLOCK(&sendreq->req_send_range_lock); diff --git a/ompi/mca/pml/ob1/pml_ob1_sendreq.h b/ompi/mca/pml/ob1/pml_ob1_sendreq.h index d78845538f..b062f68746 100644 --- a/ompi/mca/pml/ob1/pml_ob1_sendreq.h +++ b/ompi/mca/pml/ob1/pml_ob1_sendreq.h @@ -12,7 +12,7 @@ * All rights reserved. * Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved. * Copyright (c) 2011-2012 NVIDIA Corporation. All rights reserved. - * Copyright (c) 2011-2014 Los Alamos National Security, LLC. All rights + * Copyright (c) 2011-2015 Los Alamos National Security, LLC. All rights * reserved. * $COPYRIGHT$ * @@ -62,7 +62,7 @@ typedef struct mca_pml_ob1_send_request_t mca_pml_ob1_send_request_t; OBJ_CLASS_DECLARATION(mca_pml_ob1_send_request_t); struct mca_pml_ob1_send_range_t { - ompi_free_list_item_t base; + opal_free_list_item_t base; uint64_t range_send_offset; uint64_t range_send_length; int range_btl_idx; @@ -121,11 +121,10 @@ get_request_from_send_pending(mca_pml_ob1_send_pending_t *type) sendreq) \ { \ ompi_proc_t *proc = ompi_comm_peer_lookup( comm, dst ); \ - ompi_free_list_item_t* item; \ \ if( OPAL_LIKELY(NULL != proc) ) { \ - OMPI_FREE_LIST_WAIT_MT(&mca_pml_base_send_requests, item); \ - sendreq = (mca_pml_ob1_send_request_t*)item; \ + sendreq = (mca_pml_ob1_send_request_t*) \ + opal_free_list_wait (&mca_pml_base_send_requests); \ sendreq->req_send.req_base.req_proc = proc; \ } \ } @@ -226,8 +225,8 @@ do { MCA_PML_OB1_RDMA_FRAG_RETURN (sendreq->rdma_frag); \ sendreq->rdma_frag = NULL; \ } \ - OMPI_FREE_LIST_RETURN_MT( &mca_pml_base_send_requests, \ - (ompi_free_list_item_t*)sendreq); \ + opal_free_list_return ( &mca_pml_base_send_requests, \ + (opal_free_list_item_t*)sendreq); \ } while(0) diff --git a/ompi/mca/pml/yalla/pml_yalla_datatype.c b/ompi/mca/pml/yalla/pml_yalla_datatype.c index f2378d4b5c..aaf871e6d1 100644 --- a/ompi/mca/pml/yalla/pml_yalla_datatype.c +++ b/ompi/mca/pml/yalla/pml_yalla_datatype.c @@ -1,5 +1,8 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (C) Mellanox Technologies Ltd. 2001-2011. ALL RIGHTS RESERVED. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -157,7 +160,7 @@ void mca_pml_yalla_init_datatype(void) } OBJ_CLASS_INSTANCE(mca_pml_yalla_convertor_t, - ompi_free_list_item_t, + opal_free_list_item_t, mca_pml_yalla_convertor_construct, mca_pml_yalla_convertor_destruct); diff --git a/ompi/mca/pml/yalla/pml_yalla_datatype.h b/ompi/mca/pml/yalla/pml_yalla_datatype.h index 3756935aca..2493897323 100644 --- a/ompi/mca/pml/yalla/pml_yalla_datatype.h +++ b/ompi/mca/pml/yalla/pml_yalla_datatype.h @@ -1,5 +1,8 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (C) Mellanox Technologies Ltd. 2001-2011. ALL RIGHTS RESERVED. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -13,7 +16,7 @@ #include "pml_yalla.h" struct pml_yalla_convertor { - ompi_free_list_item_t super; + opal_free_list_item_t super; ompi_datatype_t *datatype; opal_convertor_t convertor; }; diff --git a/ompi/mca/pml/yalla/pml_yalla_request.c b/ompi/mca/pml/yalla/pml_yalla_request.c index 9bc083f1bc..314ae8beb8 100644 --- a/ompi/mca/pml/yalla/pml_yalla_request.c +++ b/ompi/mca/pml/yalla/pml_yalla_request.c @@ -1,5 +1,8 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (C) Mellanox Technologies Ltd. 2001-2011. ALL RIGHTS RESERVED. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -272,7 +275,7 @@ OBJ_CLASS_INSTANCE(mca_pml_yalla_send_request_t, mca_pml_yalla_send_request_destruct); OBJ_CLASS_INSTANCE(mca_pml_yalla_bsend_request_t, - ompi_free_list_item_t, + opal_free_list_item_t, mca_pml_yalla_bsend_request_construct, NULL); diff --git a/ompi/mca/pml/yalla/pml_yalla_request.h b/ompi/mca/pml/yalla/pml_yalla_request.h index 463d704a77..bfe7aab5e2 100644 --- a/ompi/mca/pml/yalla/pml_yalla_request.h +++ b/ompi/mca/pml/yalla/pml_yalla_request.h @@ -1,5 +1,8 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (C) Mellanox Technologies Ltd. 2001-2011. ALL RIGHTS RESERVED. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -31,7 +34,7 @@ struct pml_yalla_send_request { }; struct pml_yalla_bsend_request { - ompi_free_list_item_t super; + opal_free_list_item_t super; mxm_send_req_t mxm; }; diff --git a/ompi/mca/vprotocol/base/vprotocol_base_request.c b/ompi/mca/vprotocol/base/vprotocol_base_request.c index 7063f87ced..5a672d5240 100644 --- a/ompi/mca/vprotocol/base/vprotocol_base_request.c +++ b/ompi/mca/vprotocol/base/vprotocol_base_request.c @@ -1,6 +1,9 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2004-2007 The Trustees of the University of Tennessee. * All rights reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -18,7 +21,7 @@ int mca_vprotocol_base_request_parasite(void) if(mca_vprotocol.req_recv_class) { - ompi_free_list_t pml_fl_save = mca_pml_base_recv_requests; + opal_free_list_t pml_fl_save = mca_pml_base_recv_requests; mca_pml_v.host_pml_req_recv_size = pml_fl_save.fl_frag_class->cls_sizeof; V_OUTPUT_VERBOSE(300, "req_rebuild: recv\tsize %lu+%lu\talignment=%lu", (unsigned long) mca_pml_v.host_pml_req_recv_size, (unsigned long) mca_vprotocol.req_recv_class->cls_sizeof, (unsigned long) pml_fl_save.fl_frag_alignment); @@ -28,24 +31,26 @@ int mca_vprotocol_base_request_parasite(void) pml_fl_save.fl_frag_class->cls_sizeof; /* rebuild the requests free list with the right size */ OBJ_DESTRUCT(&mca_pml_base_recv_requests); - OBJ_CONSTRUCT(&mca_pml_base_recv_requests, ompi_free_list_t); - ret = ompi_free_list_init_ex_new(&mca_pml_base_recv_requests, - mca_vprotocol.req_recv_class->cls_sizeof, - pml_fl_save.fl_frag_alignment, - mca_vprotocol.req_recv_class, - pml_fl_save.fl_payload_buffer_size, - pml_fl_save.fl_payload_buffer_alignment, - pml_fl_save.fl_num_allocated, - pml_fl_save.fl_max_to_alloc, - pml_fl_save.fl_num_per_alloc, - pml_fl_save.fl_mpool, - pml_fl_save.item_init, - pml_fl_save.ctx); + OBJ_CONSTRUCT(&mca_pml_base_recv_requests, opal_free_list_t); + ret = opal_free_list_init (&mca_pml_base_recv_requests, + mca_vprotocol.req_recv_class->cls_sizeof, + pml_fl_save.fl_frag_alignment, + mca_vprotocol.req_recv_class, + pml_fl_save.fl_payload_buffer_size, + pml_fl_save.fl_payload_buffer_alignment, + pml_fl_save.fl_num_allocated, + pml_fl_save.fl_max_to_alloc, + pml_fl_save.fl_num_per_alloc, + pml_fl_save.fl_mpool, + pml_fl_save.fl_mpool_reg_flags, + 0, + pml_fl_save.item_init, + pml_fl_save.ctx); if(OMPI_SUCCESS != ret) return ret; } if(mca_vprotocol.req_send_class) { - ompi_free_list_t pml_fl_save = mca_pml_base_send_requests; + opal_free_list_t pml_fl_save = mca_pml_base_send_requests; mca_pml_v.host_pml_req_send_size = pml_fl_save.fl_frag_class->cls_sizeof; V_OUTPUT_VERBOSE(300, "req_rebuild: send\tsize %lu+%lu\talignment=%lu", (unsigned long) mca_pml_v.host_pml_req_send_size, (unsigned long) mca_vprotocol.req_send_class->cls_sizeof, (unsigned long) pml_fl_save.fl_frag_alignment); @@ -55,19 +60,21 @@ int mca_vprotocol_base_request_parasite(void) pml_fl_save.fl_frag_class->cls_sizeof; /* rebuild the requests free list with the right size */ OBJ_DESTRUCT(&mca_pml_base_send_requests); - OBJ_CONSTRUCT(&mca_pml_base_send_requests, ompi_free_list_t); - ret = ompi_free_list_init_ex_new(&mca_pml_base_send_requests, - mca_vprotocol.req_send_class->cls_sizeof, - pml_fl_save.fl_frag_alignment, - mca_vprotocol.req_send_class, - pml_fl_save.fl_payload_buffer_size, - pml_fl_save.fl_payload_buffer_alignment, - pml_fl_save.fl_num_allocated, - pml_fl_save.fl_max_to_alloc, - pml_fl_save.fl_num_per_alloc, - pml_fl_save.fl_mpool, - pml_fl_save.item_init, - pml_fl_save.ctx); + OBJ_CONSTRUCT(&mca_pml_base_send_requests, opal_free_list_t); + ret = opal_free_list_init (&mca_pml_base_send_requests, + mca_vprotocol.req_send_class->cls_sizeof, + pml_fl_save.fl_frag_alignment, + mca_vprotocol.req_send_class, + pml_fl_save.fl_payload_buffer_size, + pml_fl_save.fl_payload_buffer_alignment, + pml_fl_save.fl_num_allocated, + pml_fl_save.fl_max_to_alloc, + pml_fl_save.fl_num_per_alloc, + pml_fl_save.fl_mpool, + pml_fl_save.fl_mpool_reg_flags, + 0, + pml_fl_save.item_init, + pml_fl_save.ctx); if(OMPI_SUCCESS != ret) return ret; } return OMPI_SUCCESS; diff --git a/ompi/mca/vprotocol/pessimist/vprotocol_pessimist.h b/ompi/mca/vprotocol/pessimist/vprotocol_pessimist.h index b7c3f4d884..1d5e72bfd8 100644 --- a/ompi/mca/vprotocol/pessimist/vprotocol_pessimist.h +++ b/ompi/mca/vprotocol/pessimist/vprotocol_pessimist.h @@ -1,6 +1,9 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2004-2007 The Trustees of the University of Tennessee. * All rights reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -37,7 +40,7 @@ typedef struct mca_vprotocol_pessimist_module_t { size_t event_buffer_max_length; /* space for allocating events */ - ompi_free_list_t events_pool; + opal_free_list_t events_pool; /* Sender Based repository */ vprotocol_pessimist_sender_based_t sender_based; diff --git a/ompi/mca/vprotocol/pessimist/vprotocol_pessimist_component.c b/ompi/mca/vprotocol/pessimist/vprotocol_pessimist_component.c index 6ffeddd929..8a6d322ec1 100644 --- a/ompi/mca/vprotocol/pessimist/vprotocol_pessimist_component.c +++ b/ompi/mca/vprotocol/pessimist/vprotocol_pessimist_component.c @@ -1,6 +1,9 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2004-2007 The Trustees of the University of Tennessee. * All rights reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -127,16 +130,16 @@ static mca_vprotocol_base_module_t *mca_vprotocol_pessimist_component_init( int* mca_vprotocol_pessimist.replay = false; 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_new(&mca_vprotocol_pessimist.events_pool, - sizeof(mca_vprotocol_pessimist_event_t), - opal_cache_line_size, - OBJ_CLASS(mca_vprotocol_pessimist_event_t), - 0,opal_cache_line_size, - _free_list_num, - _free_list_max, - _free_list_inc, - NULL); + OBJ_CONSTRUCT(&mca_vprotocol_pessimist.events_pool, opal_free_list_t); + opal_free_list_init (&mca_vprotocol_pessimist.events_pool, + sizeof(mca_vprotocol_pessimist_event_t), + opal_cache_line_size, + OBJ_CLASS(mca_vprotocol_pessimist_event_t), + 0,opal_cache_line_size, + _free_list_num, + _free_list_max, + _free_list_inc, + NULL, 0, NULL, NULL, NULL); mca_vprotocol_pessimist.event_buffer_max_length = _event_buffer_size / sizeof(vprotocol_pessimist_mem_event_t); mca_vprotocol_pessimist.event_buffer_length = 0; diff --git a/ompi/mca/vprotocol/pessimist/vprotocol_pessimist_event.h b/ompi/mca/vprotocol/pessimist/vprotocol_pessimist_event.h index 10e0d74038..830838e963 100644 --- a/ompi/mca/vprotocol/pessimist/vprotocol_pessimist_event.h +++ b/ompi/mca/vprotocol/pessimist/vprotocol_pessimist_event.h @@ -1,6 +1,9 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2004-2013 The Trustees of the University of Tennessee. * All rights reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -42,7 +45,7 @@ typedef union vprotocol_pessimist_mem_event_t { } vprotocol_pessimist_mem_event_t; typedef struct mca_vprotocol_pessimist_event_t { - ompi_free_list_item_t super; + opal_free_list_item_t super; vprotocol_pessimist_event_type_t type; mca_pml_base_request_t *req; vprotocol_pessimist_mem_event_t u_event; @@ -53,8 +56,8 @@ OMPI_DECLSPEC OBJ_CLASS_DECLARATION(mca_vprotocol_pessimist_event_t); #define VPESSIMIST_MATCHING_EVENT_NEW(event) \ do { \ - ompi_free_list_item_t *item; \ - OMPI_FREE_LIST_WAIT_MT(&mca_vprotocol_pessimist.events_pool, item); \ + opal_free_list_item_t *item; \ + item = opal_free_list_wait (&mca_vprotocol_pessimist.events_pool); \ event = (mca_vprotocol_pessimist_event_t *) item; \ event->type = VPROTOCOL_PESSIMIST_EVENT_TYPE_MATCHING; \ event->u_event.e_matching.src = -1; \ @@ -62,15 +65,15 @@ OMPI_DECLSPEC OBJ_CLASS_DECLARATION(mca_vprotocol_pessimist_event_t); #define VPESSIMIST_DELIVERY_EVENT_NEW(event) \ do { \ - ompi_free_list_item_t *item; \ - OMPI_FREE_LIST_WAIT_MT(&mca_vprotocol_pessimist.events_pool, item); \ + opal_free_list_item_t *item; \ + item = opal_free_list_wait (&mca_vprotocol_pessimist.events_pool); \ event = (mca_vprotocol_pessimist_event_t *) item; \ event->type = VPROTOCOL_PESSIMIST_EVENT_TYPE_DELIVERY; \ } while(0) #define VPESSIMIST_EVENT_RETURN(event) \ - OMPI_FREE_LIST_RETURN_MT(&mca_vprotocol_pessimist.events_pool, \ - (ompi_free_list_item_t *) event) + opal_free_list_return (&mca_vprotocol_pessimist.events_pool, \ + (opal_free_list_item_t *) event) END_C_DECLS diff --git a/ompi/message/message.c b/ompi/message/message.c index 484951d963..80a4f8179b 100644 --- a/ompi/message/message.c +++ b/ompi/message/message.c @@ -46,7 +46,7 @@ ompi_message_init(void) OBJ_CONSTRUCT(&ompi_message_free_list, opal_free_list_t); rc = opal_free_list_init(&ompi_message_free_list, - sizeof(ompi_message_t), + sizeof(ompi_message_t), 8, OBJ_CLASS(ompi_message_t), 0, 0, 8, -1, 8, NULL, 0, NULL, NULL, NULL); diff --git a/ompi/request/request.c b/ompi/request/request.c index 454ced48cc..aafd39ac0a 100644 --- a/ompi/request/request.c +++ b/ompi/request/request.c @@ -1,4 +1,4 @@ -/* -*- Mode: C; c-basic-offset:4 ; -*- */ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology @@ -13,6 +13,8 @@ * Copyright (c) 2006-2013 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved. * Copyright (c) 2012 Oak Ridge National Labs. All rights reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -98,7 +100,7 @@ int ompi_request_persistent_proc_null_free(ompi_request_t** request) OBJ_CLASS_INSTANCE( ompi_request_t, - ompi_free_list_item_t, + opal_free_list_item_t, ompi_request_construct, ompi_request_destruct); diff --git a/ompi/request/request.h b/ompi/request/request.h index 8cd7bd2e63..df58a7e1b9 100644 --- a/ompi/request/request.h +++ b/ompi/request/request.h @@ -1,4 +1,4 @@ -/* -*- Mode: C; c-basic-offset:4 ; -*- */ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology @@ -13,6 +13,8 @@ * Copyright (c) 2006-2012 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2009-2012 Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012 Oak Ridge National Labs. All rights reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -30,7 +32,7 @@ #include "ompi_config.h" #include "mpi.h" -#include "opal/class/ompi_free_list.h" +#include "opal/class/opal_free_list.h" #include "opal/class/opal_pointer_array.h" #include "opal/threads/condition.h" #include "ompi/constants.h" @@ -97,7 +99,7 @@ typedef union ompi_mpi_object_t { * Main top-level request struct definition */ struct ompi_request_t { - ompi_free_list_item_t super; /**< Base type */ + opal_free_list_item_t super; /**< Base type */ ompi_request_type_t req_type; /**< Enum indicating the type of the request */ ompi_status_public_t req_status; /**< Completion status */ volatile bool req_complete; /**< Flag indicating wether request has completed */ diff --git a/opal/class/opal_rb_tree.c b/opal/class/opal_rb_tree.c index 5e9b3c4bdf..eef78e03d4 100644 --- a/opal/class/opal_rb_tree.c +++ b/opal/class/opal_rb_tree.c @@ -1,3 +1,4 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology @@ -9,6 +10,8 @@ * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -49,11 +52,10 @@ static void opal_rb_tree_construct(opal_object_t * object) { opal_rb_tree_t * tree = (opal_rb_tree_t *) object; tree->root_ptr = NULL; - OBJ_CONSTRUCT(&(tree->free_list), ompi_free_list_t); - ompi_free_list_init_new(&(tree->free_list), sizeof(opal_rb_tree_node_t), + OBJ_CONSTRUCT(&(tree->free_list), opal_free_list_t); + opal_free_list_init (&(tree->free_list), sizeof(opal_rb_tree_node_t), opal_cache_line_size, OBJ_CLASS(opal_rb_tree_node_t), - 0,opal_cache_line_size, - 0, -1 , 128, NULL); + 0,opal_cache_line_size, 0, -1 , 128, NULL, 0, NULL, NULL, NULL); } /** @@ -71,7 +73,7 @@ static void opal_rb_tree_destruct(opal_object_t * object) } /* declare the instance of the classes */ -OBJ_CLASS_INSTANCE(opal_rb_tree_node_t, ompi_free_list_item_t, NULL, NULL); +OBJ_CLASS_INSTANCE(opal_rb_tree_node_t, opal_free_list_item_t, NULL, NULL); OBJ_CLASS_INSTANCE(opal_rb_tree_t, opal_object_t, opal_rb_tree_construct, opal_rb_tree_destruct); @@ -79,17 +81,17 @@ OBJ_CLASS_INSTANCE(opal_rb_tree_t, opal_object_t, opal_rb_tree_construct, int opal_rb_tree_init(opal_rb_tree_t * tree, opal_rb_tree_comp_fn_t comp) { - ompi_free_list_item_t * node; + opal_free_list_item_t * node; /* we need to get memory for the root pointer from the free list */ - OMPI_FREE_LIST_GET_MT(&(tree->free_list), node); + node = opal_free_list_get (&(tree->free_list)); tree->root_ptr = (opal_rb_tree_node_t *) node; if (NULL == node) { return OPAL_ERR_OUT_OF_RESOURCE; } - OMPI_FREE_LIST_GET_MT(&(tree->free_list), node); + node = opal_free_list_get (&(tree->free_list)); if (NULL == node) { - OMPI_FREE_LIST_RETURN_MT(&(tree->free_list), (ompi_free_list_item_t*)tree->root_ptr); + opal_free_list_return (&tree->free_list, (opal_free_list_item_t*)tree->root_ptr); return OPAL_ERR_OUT_OF_RESOURCE; } tree->nill = (opal_rb_tree_node_t *) node; @@ -119,10 +121,10 @@ int opal_rb_tree_insert(opal_rb_tree_t *tree, void * key, void * value) { opal_rb_tree_node_t * y; opal_rb_tree_node_t * node; - ompi_free_list_item_t * item; + opal_free_list_item_t * item; /* get the memory for a node */ - OMPI_FREE_LIST_GET_MT(&(tree->free_list), item); + item = opal_free_list_get (&tree->free_list); if (NULL == item) { return OPAL_ERR_OUT_OF_RESOURCE; } @@ -226,7 +228,7 @@ int opal_rb_tree_delete(opal_rb_tree_t *tree, void *key) opal_rb_tree_node_t * p; opal_rb_tree_node_t * todelete; opal_rb_tree_node_t * y; - ompi_free_list_item_t * item; + opal_free_list_item_t * item; p = opal_rb_tree_find_node(tree, key); if (NULL == p) { @@ -264,8 +266,8 @@ int opal_rb_tree_delete(opal_rb_tree_t *tree, void *key) if (todelete->color == BLACK) { btree_delete_fixup(tree, y); } - item = (ompi_free_list_item_t *) todelete; - OMPI_FREE_LIST_RETURN_MT(&(tree->free_list), item); + item = (opal_free_list_item_t *) todelete; + opal_free_list_return (&(tree->free_list), item); --tree->tree_size; return OPAL_SUCCESS; } @@ -274,18 +276,18 @@ int opal_rb_tree_delete(opal_rb_tree_t *tree, void *key) /* Destroy the hashmap */ int opal_rb_tree_destroy(opal_rb_tree_t *tree) { - ompi_free_list_item_t * item; + opal_free_list_item_t * item; /* Recursive inorder traversal for delete */ inorder_destroy(tree, tree->root_ptr); /* Now free the root -- root does not get free'd in the above * inorder destroy */ - item = (ompi_free_list_item_t *) tree->root_ptr; - OMPI_FREE_LIST_RETURN_MT(&(tree->free_list), item); + item = (opal_free_list_item_t *) tree->root_ptr; + opal_free_list_return(&(tree->free_list), item); /* free the tree->nill node */ - item = (ompi_free_list_item_t *) tree->nill; - OMPI_FREE_LIST_RETURN_MT(&(tree->free_list), item); + item = (opal_free_list_item_t *) tree->nill; + opal_free_list_return (&(tree->free_list), item); return OPAL_SUCCESS; } @@ -419,7 +421,7 @@ static void btree_delete_fixup(opal_rb_tree_t *tree, opal_rb_tree_node_t * x) static void inorder_destroy(opal_rb_tree_t *tree, opal_rb_tree_node_t * node) { - ompi_free_list_item_t * item; + opal_free_list_item_t * item; if (node == tree->nill) { return; @@ -428,16 +430,16 @@ inorder_destroy(opal_rb_tree_t *tree, opal_rb_tree_node_t * node) inorder_destroy(tree, node->left); if (node->left != tree->nill) { - item = (ompi_free_list_item_t *) node->left; + item = (opal_free_list_item_t *) node->left; --tree->tree_size; - OMPI_FREE_LIST_RETURN_MT(&(tree->free_list), item); + opal_free_list_return (&tree->free_list, item); } inorder_destroy(tree, node->right); if (node->right != tree->nill) { - item = (ompi_free_list_item_t *) node->right; + item = (opal_free_list_item_t *) node->right; --tree->tree_size; - OMPI_FREE_LIST_RETURN_MT(&(tree->free_list), item); + opal_free_list_return (&tree->free_list, item); } } diff --git a/opal/class/opal_rb_tree.h b/opal/class/opal_rb_tree.h index c4a174e179..1c7cf9e849 100644 --- a/opal/class/opal_rb_tree.h +++ b/opal/class/opal_rb_tree.h @@ -1,3 +1,4 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology @@ -9,6 +10,8 @@ * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -29,7 +32,7 @@ #include #include "opal/constants.h" #include "opal/class/opal_object.h" -#include "opal/class/ompi_free_list.h" +#include "opal/class/opal_free_list.h" BEGIN_C_DECLS /* @@ -46,7 +49,7 @@ typedef enum {RED, BLACK} opal_rb_tree_nodecolor_t; */ struct opal_rb_tree_node_t { - ompi_free_list_item_t super; /**< the parent class */ + opal_free_list_item_t super; /**< the parent class */ opal_rb_tree_nodecolor_t color; /**< the node color */ struct opal_rb_tree_node_t * parent;/**< the parent node, can be NULL */ struct opal_rb_tree_node_t * left; /**< the left child - can be nill */ @@ -72,7 +75,7 @@ struct opal_rb_tree_t { opal_rb_tree_node_t * root_ptr; /**< a pointer to the root of the tree */ opal_rb_tree_node_t * nill; /**< the nill sentinal node */ opal_rb_tree_comp_fn_t comp; /**< the compare function */ - ompi_free_list_t free_list; /**< the free list to get the memory from */ + opal_free_list_t free_list; /**< the free list to get the memory from */ size_t tree_size; /**< the size of the tree */ }; typedef struct opal_rb_tree_t opal_rb_tree_t; diff --git a/opal/mca/allocator/basic/allocator_basic.c b/opal/mca/allocator/basic/allocator_basic.c index 6dbd7d0297..c212ac7483 100644 --- a/opal/mca/allocator/basic/allocator_basic.c +++ b/opal/mca/allocator/basic/allocator_basic.c @@ -1,3 +1,4 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana * University Research and Technology @@ -12,6 +13,8 @@ * Copyright (c) 2006 Sun Microsystems, Inc. All rights reserved. * Copyright (c) 2008 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2011 NVIDIA Corporation. All rights reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -50,7 +53,7 @@ mca_allocator_base_component_t mca_allocator_basic_component = { OBJ_CLASS_INSTANCE( mca_allocator_basic_segment_t, - ompi_free_list_item_t, + opal_free_list_item_t, NULL, NULL); @@ -93,9 +96,9 @@ mca_allocator_base_module_t* mca_allocator_basic_component_init( module->seg_free = segment_free; OBJ_CONSTRUCT(&module->seg_list, opal_list_t); OBJ_CONSTRUCT(&module->seg_lock, opal_mutex_t); - OBJ_CONSTRUCT(&module->seg_descriptors, ompi_free_list_t); + OBJ_CONSTRUCT(&module->seg_descriptors, opal_free_list_t); - ompi_free_list_init_new(&module->seg_descriptors, + opal_free_list_init (&module->seg_descriptors, sizeof(mca_allocator_basic_segment_t), opal_cache_line_size, OBJ_CLASS(mca_allocator_basic_segment_t), @@ -103,7 +106,7 @@ mca_allocator_base_module_t* mca_allocator_basic_component_init( 0, /* initial size */ -1, /* maximum size */ 16, /* increment to grow by */ - NULL); + NULL, 0, NULL, NULL, NULL); return &module->super; } @@ -122,7 +125,7 @@ static void mca_allocator_basic_combine_prev( if(prev->seg_addr + prev->seg_size == seg->seg_addr) { prev->seg_size += seg->seg_size; opal_list_remove_item(&module->seg_list, &seg->seg_item.super); - OMPI_FREE_LIST_RETURN_MT(&module->seg_descriptors, &seg->seg_item); + opal_free_list_return (&module->seg_descriptors, &seg->seg_item); return; } } @@ -139,7 +142,7 @@ static void mca_allocator_basic_combine_next( next->seg_addr = seg->seg_addr; next->seg_size += seg->seg_size; opal_list_remove_item(&module->seg_list, &seg->seg_item.super); - OMPI_FREE_LIST_RETURN_MT(&module->seg_descriptors, &seg->seg_item); + opal_free_list_return (&module->seg_descriptors, &seg->seg_item); return; } } @@ -165,7 +168,6 @@ void *mca_allocator_basic_alloc( { mca_allocator_basic_module_t* module = (mca_allocator_basic_module_t*)base; mca_allocator_basic_segment_t* seg; - ompi_free_list_item_t* item; unsigned char* addr; size_t allocated_size; OPAL_THREAD_LOCK(&module->seg_lock); @@ -175,11 +177,7 @@ void *mca_allocator_basic_alloc( /* normalize size so we don't end up with seg_addr on an odd boundary */ size += sizeof(size_t) - (size & (sizeof(size_t) - 1)); /* search the list for a segment of the required size */ - for(item = (ompi_free_list_item_t*) opal_list_get_first(&module->seg_list); - item != (ompi_free_list_item_t*) opal_list_get_end(&module->seg_list); - item = (ompi_free_list_item_t*) opal_list_get_next(&item->super)) { - seg = (mca_allocator_basic_segment_t*)item; - + OPAL_LIST_FOREACH(seg, &module->seg_list, mca_allocator_basic_segment_t) { /* split the segment */ if(seg->seg_size > size) { addr = seg->seg_addr; @@ -190,8 +188,8 @@ void *mca_allocator_basic_alloc( return addr+sizeof(size_t); } else if (seg->seg_size == size) { addr = seg->seg_addr; - opal_list_remove_item(&module->seg_list, &item->super); - OMPI_FREE_LIST_RETURN_MT(&module->seg_descriptors, item); + opal_list_remove_item(&module->seg_list, (opal_list_item_t *) seg); + opal_free_list_return (&module->seg_descriptors, (opal_free_list_item_t *) seg); OPAL_THREAD_UNLOCK(&module->seg_lock); *(size_t*)addr = size; return addr+sizeof(size_t); @@ -207,15 +205,14 @@ void *mca_allocator_basic_alloc( /* create a segment for any extra allocation */ if(allocated_size > size) { - OMPI_FREE_LIST_GET_MT(&module->seg_descriptors, item); - if(NULL == item) { + seg = (mca_allocator_basic_segment_t *) opal_free_list_get (&module->seg_descriptors); + if (NULL == seg) { OPAL_THREAD_UNLOCK(&module->seg_lock); return NULL; } - seg = (mca_allocator_basic_segment_t*)item; seg->seg_addr = addr + size; seg->seg_size = allocated_size - size; - opal_list_append(&module->seg_list, &item->super); + opal_list_append (&module->seg_list, (opal_list_item_t *) seg); } *(size_t*)addr = size; @@ -274,17 +271,12 @@ void mca_allocator_basic_free( { mca_allocator_basic_module_t* module = (mca_allocator_basic_module_t*)base; mca_allocator_basic_segment_t* seg; - ompi_free_list_item_t *item; unsigned char* addr = (unsigned char*)ptr - sizeof(size_t); size_t size = *(size_t*)addr; OPAL_THREAD_LOCK(&module->seg_lock); /* maintain the free list in sorted order by address */ - for(item = (ompi_free_list_item_t*) opal_list_get_first(&module->seg_list); - item != (ompi_free_list_item_t*) opal_list_get_end(&module->seg_list); - item = (ompi_free_list_item_t*) opal_list_get_next((&item->super))) { - seg = (mca_allocator_basic_segment_t*)item; - + OPAL_LIST_FOREACH(seg, &module->seg_list, mca_allocator_basic_segment_t) { if (seg->seg_addr < addr) { /* can we grow the current entry */ @@ -309,15 +301,15 @@ void mca_allocator_basic_free( /* insert before larger entry */ } else { mca_allocator_basic_segment_t* new_seg; - OMPI_FREE_LIST_GET_MT(&module->seg_descriptors, item); - if(NULL == item) { + new_seg = (mca_allocator_basic_segment_t *) + opal_free_list_get (&module->seg_descriptors); + if(NULL == new_seg) { OPAL_THREAD_UNLOCK(&module->seg_lock); return; } - new_seg = (mca_allocator_basic_segment_t*)item; new_seg->seg_addr = addr; new_seg->seg_size = size; - opal_list_insert_pos(&module->seg_list, &seg->seg_item.super, &item->super); + opal_list_insert_pos(&module->seg_list, &seg->seg_item.super, (opal_list_item_t *) new_seg); OPAL_THREAD_UNLOCK(&module->seg_lock); return; } @@ -325,15 +317,14 @@ void mca_allocator_basic_free( } /* append to the end of the list */ - OMPI_FREE_LIST_GET_MT(&module->seg_descriptors, item); - if(NULL == item) { + seg = (mca_allocator_basic_segment_t *) opal_free_list_get (&module->seg_descriptors); + if(NULL == seg) { OPAL_THREAD_UNLOCK(&module->seg_lock); return; } - seg = (mca_allocator_basic_segment_t*)item; seg->seg_addr = addr; seg->seg_size = size; - opal_list_append(&module->seg_list, &item->super); + opal_list_append(&module->seg_list, (opal_list_item_t *) seg); OPAL_THREAD_UNLOCK(&module->seg_lock); } diff --git a/opal/mca/allocator/basic/allocator_basic.h b/opal/mca/allocator/basic/allocator_basic.h index 9220b78864..9b4fa93c1c 100644 --- a/opal/mca/allocator/basic/allocator_basic.h +++ b/opal/mca/allocator/basic/allocator_basic.h @@ -1,4 +1,5 @@ -/** +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ +/* * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. @@ -9,6 +10,8 @@ * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -27,7 +30,7 @@ #include #include #include "opal/threads/mutex.h" -#include "opal/class/ompi_free_list.h" +#include "opal/class/opal_free_list.h" #include "opal/mca/allocator/allocator.h" @@ -36,7 +39,7 @@ */ struct mca_allocator_basic_segment_t { - ompi_free_list_item_t seg_item; + opal_free_list_item_t seg_item; unsigned char* seg_addr; size_t seg_size; }; @@ -53,7 +56,7 @@ struct mca_allocator_basic_module_t { mca_allocator_base_component_segment_free_fn_t seg_free; opal_list_t seg_list; opal_mutex_t seg_lock; - ompi_free_list_t seg_descriptors; + opal_free_list_t seg_descriptors; }; typedef struct mca_allocator_basic_module_t mca_allocator_basic_module_t; diff --git a/opal/mca/btl/btl.h b/opal/mca/btl/btl.h index bdd267c6f5..a52dcc863b 100644 --- a/opal/mca/btl/btl.h +++ b/opal/mca/btl/btl.h @@ -380,7 +380,7 @@ typedef struct mca_btl_base_segment_t mca_btl_base_segment_t; */ struct mca_btl_base_descriptor_t { - ompi_free_list_item_t super; + opal_free_list_item_t super; mca_btl_base_segment_t *des_segments; /**< local segments */ size_t des_segment_count; /**< number of local segments */ mca_btl_base_completion_fn_t des_cbfunc; /**< local callback function */ diff --git a/opal/mca/btl/openib/btl_openib.c b/opal/mca/btl/openib/btl_openib.c index 338cef48e3..ffb43b4d96 100644 --- a/opal/mca/btl/openib/btl_openib.c +++ b/opal/mca/btl/openib/btl_openib.c @@ -12,7 +12,7 @@ * All rights reserved. * Copyright (c) 2007-2013 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2006-2009 Mellanox Technologies. All rights reserved. - * Copyright (c) 2006-2014 Los Alamos National Security, LLC. All rights + * Copyright (c) 2006-2015 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2006-2007 Voltaire All rights reserved. * Copyright (c) 2008-2012 Oracle and/or its affiliates. All rights reserved. @@ -636,8 +636,8 @@ static int prepare_device_for_use (mca_btl_openib_device_t *device) } for (int qp_index = 0 ; qp_index < mca_btl_openib_component.num_qps ; qp_index++) { - OBJ_CONSTRUCT(&device->qps[qp_index].send_free, ompi_free_list_t); - OBJ_CONSTRUCT(&device->qps[qp_index].recv_free, ompi_free_list_t); + OBJ_CONSTRUCT(&device->qps[qp_index].send_free, opal_free_list_t); + OBJ_CONSTRUCT(&device->qps[qp_index].recv_free, opal_free_list_t); } if(mca_btl_openib_component.use_async_event_thread) { @@ -726,13 +726,13 @@ static int prepare_device_for_use (mca_btl_openib_device_t *device) init_data->order = MCA_BTL_NO_ORDER; init_data->list = &device->send_free_control; - rc = ompi_free_list_init_ex_new(&device->send_free_control, + rc = opal_free_list_init(&device->send_free_control, sizeof(mca_btl_openib_send_control_frag_t), opal_cache_line_size, OBJ_CLASS(mca_btl_openib_send_control_frag_t), length, mca_btl_openib_component.buffer_alignment, mca_btl_openib_component.ib_free_list_num, -1, mca_btl_openib_component.ib_free_list_inc, - device->mpool, mca_btl_openib_frag_init, + device->mpool, 0, NULL, mca_btl_openib_frag_init, init_data); if (OPAL_SUCCESS != rc) { /* If we're "out of memory", this usually means that we ran @@ -741,7 +741,7 @@ static int prepare_device_for_use (mca_btl_openib_device_t *device) OPAL_ERR_TEMP_OUT_OF_RESOURCE == rc) { errno = ENOMEM; mca_btl_openib_show_init_error(__FILE__, __LINE__, - "ompi_free_list_init_ex_new", + "opal_free_list_init", ibv_get_device_name(device->ib_dev)); } return rc; @@ -765,15 +765,15 @@ static int prepare_device_for_use (mca_btl_openib_device_t *device) init_data->order = qp; init_data->list = &device->qps[qp].send_free; - rc = ompi_free_list_init_ex_new(init_data->list, + rc = opal_free_list_init (init_data->list, sizeof(mca_btl_openib_send_frag_t), opal_cache_line_size, OBJ_CLASS(mca_btl_openib_send_frag_t), length, mca_btl_openib_component.buffer_alignment, mca_btl_openib_component.ib_free_list_num, mca_btl_openib_component.ib_free_list_max, mca_btl_openib_component.ib_free_list_inc, - device->mpool, mca_btl_openib_frag_init, - init_data); + device->mpool, 0, NULL, mca_btl_openib_frag_init, + init_data); if (OPAL_SUCCESS != rc) { /* If we're "out of memory", this usually means that we ran out of registered memory, so show that error @@ -782,7 +782,7 @@ static int prepare_device_for_use (mca_btl_openib_device_t *device) OPAL_ERR_TEMP_OUT_OF_RESOURCE == rc) { errno = ENOMEM; mca_btl_openib_show_init_error(__FILE__, __LINE__, - "ompi_free_list_init_ex_new", + "opal_free_list_init", ibv_get_device_name(device->ib_dev)); } return OPAL_ERROR; @@ -798,14 +798,14 @@ static int prepare_device_for_use (mca_btl_openib_device_t *device) init_data->order = qp; init_data->list = &device->qps[qp].recv_free; - if(OPAL_SUCCESS != ompi_free_list_init_ex_new(init_data->list, + if(OPAL_SUCCESS != opal_free_list_init (init_data->list, sizeof(mca_btl_openib_recv_frag_t), opal_cache_line_size, OBJ_CLASS(mca_btl_openib_recv_frag_t), length, mca_btl_openib_component.buffer_alignment, mca_btl_openib_component.ib_free_list_num, mca_btl_openib_component.ib_free_list_max, mca_btl_openib_component.ib_free_list_inc, - device->mpool, mca_btl_openib_frag_init, + device->mpool, 0, NULL, mca_btl_openib_frag_init, init_data)) { return OPAL_ERROR; } @@ -1117,11 +1117,11 @@ ib_frag_alloc(mca_btl_openib_module_t *btl, size_t size, uint8_t order, uint32_t flags) { int qp; - ompi_free_list_item_t* item = NULL; + opal_free_list_item_t* item = NULL; for(qp = 0; qp < mca_btl_openib_component.num_qps; qp++) { if(mca_btl_openib_component.qp_infos[qp].size >= size) { - OMPI_FREE_LIST_GET_MT(&btl->device->qps[qp].send_free, item); + item = opal_free_list_get (&btl->device->qps[qp].send_free); if(item) break; } @@ -1547,7 +1547,7 @@ int mca_btl_openib_sendi( struct mca_btl_base_module_t* btl, prio = flags & MCA_BTL_DES_FLAGS_PRIORITY, ib_rc; bool do_rdma = false; - ompi_free_list_item_t* item = NULL; + opal_free_list_item_t* item = NULL; mca_btl_openib_frag_t *frag; mca_btl_openib_header_t *hdr; int send_signaled; @@ -1577,7 +1577,7 @@ int mca_btl_openib_sendi( struct mca_btl_base_module_t* btl, } /* Allocate fragment */ - OMPI_FREE_LIST_GET_MT(&obtl->device->qps[qp].send_free, item); + item = opal_free_list_get (&obtl->device->qps[qp].send_free); if(OPAL_UNLIKELY(NULL == item)) { /* we don't return NULL because maybe later we will try to coalesce */ goto cant_send_wqe; diff --git a/opal/mca/btl/openib/btl_openib.h b/opal/mca/btl/openib/btl_openib.h index 1282e8bc23..9415fda217 100644 --- a/opal/mca/btl/openib/btl_openib.h +++ b/opal/mca/btl/openib/btl_openib.h @@ -38,7 +38,6 @@ #include /* Open MPI includes */ -#include "opal/class/ompi_free_list.h" #include "opal/class/opal_pointer_array.h" #include "opal/class/opal_hash_table.h" #include "opal/util/output.h" @@ -285,11 +284,11 @@ struct mca_btl_openib_component_t { int credits_qp; /* qp used for software flow control */ bool cpc_explicitly_defined; /**< free list of frags only; used for pining user memory */ - ompi_free_list_t send_user_free; + opal_free_list_t send_user_free; /**< free list of frags only; used for pining user memory */ - ompi_free_list_t recv_user_free; + opal_free_list_t recv_user_free; /**< frags for coalesced massages */ - ompi_free_list_t send_free_coalesced; + opal_free_list_t send_free_coalesced; /** Default receive queues */ char* default_recv_qps; /** GID index to use */ @@ -358,8 +357,8 @@ typedef struct mca_btl_openib_modex_message_t { } while (0) typedef struct mca_btl_openib_device_qp_t { - ompi_free_list_t send_free; /**< free lists of send buffer descriptors */ - ompi_free_list_t recv_free; /**< free lists of receive buffer descriptors */ + opal_free_list_t send_free; /**< free lists of send buffer descriptors */ + opal_free_list_t recv_free; /**< free lists of receive buffer descriptors */ } mca_btl_openib_device_qp_t; struct mca_btl_base_endpoint_t; @@ -403,7 +402,7 @@ typedef struct mca_btl_openib_device_t { int32_t eager_rdma_buffers_count; struct mca_btl_base_endpoint_t **eager_rdma_buffers; /**< frags for control massages */ - ompi_free_list_t send_free_control; + opal_free_list_t send_free_control; /* QP types and attributes that will be used on this device */ mca_btl_openib_device_qp_t *qps; /* Maximum value supported by this device for max_inline_data */ diff --git a/opal/mca/btl/openib/btl_openib_component.c b/opal/mca/btl/openib/btl_openib_component.c index 5a3d75b594..50f737ba8f 100644 --- a/opal/mca/btl/openib/btl_openib_component.c +++ b/opal/mca/btl/openib/btl_openib_component.c @@ -12,7 +12,7 @@ * All rights reserved. * Copyright (c) 2006-2014 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2006-2009 Mellanox Technologies. All rights reserved. - * Copyright (c) 2006-2014 Los Alamos National Security, LLC. All rights + * Copyright (c) 2006-2015 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2006-2007 Voltaire All rights reserved. * Copyright (c) 2009-2012 Oracle and/or its affiliates. All rights reserved. @@ -919,7 +919,7 @@ static void device_construct(mca_btl_openib_device_t *device) mca_btl_openib_component.async_comp_pipe[0] = mca_btl_openib_component.async_comp_pipe[1] = -1; OBJ_CONSTRUCT(&device->device_lock, opal_mutex_t); - OBJ_CONSTRUCT(&device->send_free_control, ompi_free_list_t); + OBJ_CONSTRUCT(&device->send_free_control, opal_free_list_t); device->max_inline_data = 0; device->ready_for_use = false; } @@ -2566,9 +2566,9 @@ btl_openib_component_init(int *num_btl_modules, } } - OBJ_CONSTRUCT(&mca_btl_openib_component.send_free_coalesced, ompi_free_list_t); - OBJ_CONSTRUCT(&mca_btl_openib_component.send_user_free, ompi_free_list_t); - OBJ_CONSTRUCT(&mca_btl_openib_component.recv_user_free, ompi_free_list_t); + OBJ_CONSTRUCT(&mca_btl_openib_component.send_free_coalesced, opal_free_list_t); + OBJ_CONSTRUCT(&mca_btl_openib_component.send_user_free, opal_free_list_t); + OBJ_CONSTRUCT(&mca_btl_openib_component.recv_user_free, opal_free_list_t); init_data = (mca_btl_openib_frag_init_data_t *) malloc(sizeof(mca_btl_openib_frag_init_data_t)); if (NULL == init_data) { @@ -2583,7 +2583,7 @@ btl_openib_component_init(int *num_btl_modules, occur on some 32-bit platforms. Depending on the size of the fragment this will waste 2-6 bytes of space per frag. In most cases this shouldn't waste any space. */ - if (OPAL_SUCCESS != ompi_free_list_init_ex_new( + if (OPAL_SUCCESS != opal_free_list_init ( &mca_btl_openib_component.send_user_free, sizeof(mca_btl_openib_put_frag_t), 8, OBJ_CLASS(mca_btl_openib_put_frag_t), @@ -2591,7 +2591,7 @@ btl_openib_component_init(int *num_btl_modules, mca_btl_openib_component.ib_free_list_num, mca_btl_openib_component.ib_free_list_max, mca_btl_openib_component.ib_free_list_inc, - NULL, mca_btl_openib_frag_init, init_data)) { + NULL, 0, NULL, mca_btl_openib_frag_init, init_data)) { goto no_btls; } @@ -2604,7 +2604,7 @@ btl_openib_component_init(int *num_btl_modules, init_data->order = mca_btl_openib_component.rdma_qp; init_data->list = &mca_btl_openib_component.recv_user_free; - if(OPAL_SUCCESS != ompi_free_list_init_ex_new( + if(OPAL_SUCCESS != opal_free_list_init ( &mca_btl_openib_component.recv_user_free, sizeof(mca_btl_openib_get_frag_t), 8, OBJ_CLASS(mca_btl_openib_get_frag_t), @@ -2612,7 +2612,7 @@ btl_openib_component_init(int *num_btl_modules, mca_btl_openib_component.ib_free_list_num, mca_btl_openib_component.ib_free_list_max, mca_btl_openib_component.ib_free_list_inc, - NULL, mca_btl_openib_frag_init, init_data)) { + NULL, 0, NULL, mca_btl_openib_frag_init, init_data)) { goto no_btls; } @@ -2625,13 +2625,13 @@ btl_openib_component_init(int *num_btl_modules, init_data->list = &mca_btl_openib_component.send_free_coalesced; - if(OPAL_SUCCESS != ompi_free_list_init_ex( + if(OPAL_SUCCESS != opal_free_list_init ( &mca_btl_openib_component.send_free_coalesced, length, 8, OBJ_CLASS(mca_btl_openib_coalesced_frag_t), - mca_btl_openib_component.ib_free_list_num, + 0, 0, mca_btl_openib_component.ib_free_list_num, mca_btl_openib_component.ib_free_list_max, mca_btl_openib_component.ib_free_list_inc, - NULL, mca_btl_openib_frag_init, init_data)) { + NULL, 0, NULL, mca_btl_openib_frag_init, init_data)) { goto no_btls; } @@ -3819,8 +3819,8 @@ int mca_btl_openib_post_srr(mca_btl_openib_module_t* openib_btl, const int qp) } for(i = 0; i < num_post; i++) { - ompi_free_list_item_t* item; - OMPI_FREE_LIST_WAIT_MT(&openib_btl->device->qps[qp].recv_free, item); + opal_free_list_item_t* item; + item = opal_free_list_wait (&openib_btl->device->qps[qp].recv_free); to_base_frag(item)->base.order = qp; to_com_frag(item)->endpoint = NULL; if(NULL == wr) diff --git a/opal/mca/btl/openib/btl_openib_endpoint.c b/opal/mca/btl/openib/btl_openib_endpoint.c index 82a648e08d..dbb9613639 100644 --- a/opal/mca/btl/openib/btl_openib_endpoint.c +++ b/opal/mca/btl/openib/btl_openib_endpoint.c @@ -11,7 +11,7 @@ * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * Copyright (c) 2006-2013 Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2006-2014 Los Alamos National Security, LLC. All rights + * Copyright (c) 2006-2015 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2006-2007 Voltaire All rights reserved. * Copyright (c) 2006-2009 Mellanox Technologies, Inc. All rights reserved. @@ -43,7 +43,7 @@ #include "opal/util/output.h" #include "opal/util/proc.h" #include "opal/util/show_help.h" -#include "opal/class/ompi_free_list.h" +#include "opal/class/opal_free_list.h" #include "btl_openib_endpoint.h" #include "btl_openib_proc.h" @@ -908,11 +908,11 @@ void mca_btl_openib_endpoint_connect_eager_rdma( sizeof(mca_btl_openib_header_t); for(i = 0; i < mca_btl_openib_component.eager_rdma_num; i++) { - ompi_free_list_item_t *item; + opal_free_list_item_t *item; mca_btl_openib_recv_frag_t * frag; mca_btl_openib_frag_init_data_t init_data; - item = (ompi_free_list_item_t*)&headers_buf[i]; + item = (opal_free_list_item_t*)&headers_buf[i]; item->registration = (mca_mpool_base_registration_t *)endpoint->eager_rdma_local.reg; item->ptr = buf + i * openib_btl->eager_rdma_frag_size; OBJ_CONSTRUCT(item, mca_btl_openib_recv_frag_t); diff --git a/opal/mca/btl/openib/btl_openib_endpoint.h b/opal/mca/btl/openib/btl_openib_endpoint.h index 41096a6c62..610759f571 100644 --- a/opal/mca/btl/openib/btl_openib_endpoint.h +++ b/opal/mca/btl/openib/btl_openib_endpoint.h @@ -11,7 +11,7 @@ * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * Copyright (c) 2007-2009 Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2006-2014 Los Alamos National Security, LLC. All rights + * Copyright (c) 2006-2015 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2006-2007 Voltaire All rights reserved. * Copyright (c) 2007-2009 Mellanox Technologies. All rights reserved. @@ -369,8 +369,8 @@ static inline int post_recvs(mca_btl_base_endpoint_t *ep, const int qp, return OPAL_SUCCESS; for(i = 0; i < num_post; i++) { - ompi_free_list_item_t* item; - OMPI_FREE_LIST_WAIT_MT(&openib_btl->device->qps[qp].recv_free, item); + opal_free_list_item_t* item; + item = opal_free_list_wait (&openib_btl->device->qps[qp].recv_free); to_base_frag(item)->base.order = qp; to_com_frag(item)->endpoint = ep; if(NULL == wr) diff --git a/opal/mca/btl/openib/btl_openib_frag.c b/opal/mca/btl/openib/btl_openib_frag.c index 6768fcd76c..1cd4d93685 100644 --- a/opal/mca/btl/openib/btl_openib_frag.c +++ b/opal/mca/btl/openib/btl_openib_frag.c @@ -1,3 +1,4 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology @@ -9,7 +10,7 @@ * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. - * Copyright (c) 2006-2007 Los Alamos National Security, LLC. All rights + * Copyright (c) 2006-2015 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2006-2007 Voltaire All rights reserved. * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. @@ -24,7 +25,7 @@ #include "btl_openib_frag.h" #include "btl_openib_eager_rdma.h" -void mca_btl_openib_frag_init(ompi_free_list_item_t* item, void* ctx) +int mca_btl_openib_frag_init(opal_free_list_item_t* item, void* ctx) { mca_btl_openib_frag_init_data_t* init_data = (mca_btl_openib_frag_init_data_t *) ctx; mca_btl_openib_frag_t *frag = to_base_frag(item); @@ -42,6 +43,8 @@ void mca_btl_openib_frag_init(ompi_free_list_item_t* item, void* ctx) to_send_frag(frag)->qp_idx = init_data->order; frag->list = init_data->list; + + return OPAL_SUCCESS; } static void base_constructor(mca_btl_openib_frag_t *frag) diff --git a/opal/mca/btl/openib/btl_openib_frag.h b/opal/mca/btl/openib/btl_openib_frag.h index 0a5ad6bc4b..b61b900703 100644 --- a/opal/mca/btl/openib/btl_openib_frag.h +++ b/opal/mca/btl/openib/btl_openib_frag.h @@ -1,3 +1,4 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology @@ -10,7 +11,7 @@ * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * Copyright (c) 2009 IBM Corporation. All rights reserved. - * Copyright (c) 2006-2009 Los Alamos National Security, LLC. All rights + * Copyright (c) 2006-2015 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2006-2007 Voltaire All rights reserved. * Copyright (c) 2010-2012 Oracle and/or its affiliates. All rights reserved. @@ -294,7 +295,7 @@ typedef struct mca_btl_openib_frag_t { mca_btl_base_descriptor_t base; mca_btl_openib_segment_t segment; mca_btl_openib_frag_type_t type; - ompi_free_list_t* list; + opal_free_list_t* list; } mca_btl_openib_frag_t; OBJ_CLASS_DECLARATION(mca_btl_openib_frag_t); @@ -399,11 +400,7 @@ OBJ_CLASS_DECLARATION(mca_btl_openib_coalesced_frag_t); static inline mca_btl_openib_send_control_frag_t * alloc_control_frag(mca_btl_openib_module_t *btl) { - ompi_free_list_item_t *item; - - OMPI_FREE_LIST_WAIT_MT(&btl->device->send_free_control, item); - - return to_send_control_frag(item); + return to_send_control_frag(opal_free_list_wait (&btl->device->send_free_control)); } static inline uint8_t frag_size_to_order(mca_btl_openib_module_t* btl, @@ -419,35 +416,23 @@ static inline uint8_t frag_size_to_order(mca_btl_openib_module_t* btl, static inline mca_btl_openib_com_frag_t *alloc_send_user_frag(void) { - ompi_free_list_item_t *item; - - OMPI_FREE_LIST_GET_MT(&mca_btl_openib_component.send_user_free, item); - - return to_com_frag(item); + return to_com_frag(opal_free_list_get (&mca_btl_openib_component.send_user_free)); } static inline mca_btl_openib_com_frag_t *alloc_recv_user_frag(void) { - ompi_free_list_item_t *item; - - OMPI_FREE_LIST_GET_MT(&mca_btl_openib_component.recv_user_free, item); - - return to_com_frag(item); + return to_com_frag(opal_free_list_get (&mca_btl_openib_component.recv_user_free)); } static inline mca_btl_openib_coalesced_frag_t *alloc_coalesced_frag(void) { - ompi_free_list_item_t *item; - - OMPI_FREE_LIST_GET_MT(&mca_btl_openib_component.send_free_coalesced, item); - - return to_coalesced_frag(item); + return to_coalesced_frag(opal_free_list_get (&mca_btl_openib_component.send_free_coalesced)); } #define MCA_BTL_IB_FRAG_RETURN(frag) \ do { \ - OMPI_FREE_LIST_RETURN_MT(to_base_frag(frag)->list, \ - (ompi_free_list_item_t*)(frag)); \ + opal_free_list_return (to_base_frag(frag)->list, \ + (opal_free_list_item_t*)(frag)); \ } while(0); #define MCA_BTL_OPENIB_CLEAN_PENDING_FRAGS(list) \ @@ -461,11 +446,11 @@ struct mca_btl_openib_module_t; struct mca_btl_openib_frag_init_data_t { uint8_t order; - ompi_free_list_t* list; + opal_free_list_t* list; }; typedef struct mca_btl_openib_frag_init_data_t mca_btl_openib_frag_init_data_t; -void mca_btl_openib_frag_init(ompi_free_list_item_t* item, void* ctx); +int mca_btl_openib_frag_init(opal_free_list_item_t* item, void* ctx); END_C_DECLS diff --git a/opal/mca/btl/openib/connect/btl_openib_connect_base.c b/opal/mca/btl/openib/connect/btl_openib_connect_base.c index 71ba607f06..cc90c497bd 100644 --- a/opal/mca/btl/openib/connect/btl_openib_connect_base.c +++ b/opal/mca/btl/openib/connect/btl_openib_connect_base.c @@ -2,7 +2,7 @@ /* * Copyright (c) 2007-2013 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2007 Mellanox Technologies, Inc. All rights reserved. - * Copyright (c) 2012-2013 Los Alamos National Security, LLC. All rights + * Copyright (c) 2012-2015 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2013-2014 Intel, Inc. All rights reserved * Copyright (c) 2015 Research Organization for Information Science @@ -413,7 +413,7 @@ opal_btl_openib_connect_base_get_cpc_byindex(uint8_t index) int opal_btl_openib_connect_base_alloc_cts(mca_btl_base_endpoint_t *endpoint) { - ompi_free_list_item_t *fli; + opal_free_list_item_t *fli; int length = sizeof(mca_btl_openib_header_t) + sizeof(mca_btl_openib_header_coalesced_t) + sizeof(mca_btl_openib_control_header_t) + diff --git a/opal/mca/btl/portals4/btl_portals4.h b/opal/mca/btl/portals4/btl_portals4.h index bca8a7a73d..699e5fbddb 100644 --- a/opal/mca/btl/portals4/btl_portals4.h +++ b/opal/mca/btl/portals4/btl_portals4.h @@ -1,3 +1,4 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana * University Research and Technology @@ -11,6 +12,8 @@ * All rights reserved. * Copyright (c) 2010-2012 Sandia National Laboratories. All rights reserved. * Copyright (c) 2014 Bull SAS. All rights reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -89,9 +92,9 @@ struct mca_btl_portals4_module_t { uint32_t interface_num; /* fragment free lists */ - ompi_free_list_t portals_frag_eager; - ompi_free_list_t portals_frag_max; - ompi_free_list_t portals_frag_user; + opal_free_list_t portals_frag_eager; + opal_free_list_t portals_frag_max; + opal_free_list_t portals_frag_user; opal_list_t portals_recv_blocks; diff --git a/opal/mca/btl/portals4/btl_portals4_component.c b/opal/mca/btl/portals4/btl_portals4_component.c index bd796d1bee..e6f643b726 100644 --- a/opal/mca/btl/portals4/btl_portals4_component.c +++ b/opal/mca/btl/portals4/btl_portals4_component.c @@ -13,6 +13,8 @@ * Copyright (c) 2010-2012 Sandia National Laboratories. All rights reserved. * Copyright (c) 2014 Intel, Inc. All rights reserved. * Copyright (c) 2014 Bull SAS. All rights reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -353,12 +355,12 @@ static mca_btl_base_module_t** mca_btl_portals4_component_init(int *num_btls, portals4_btl->portals_ni_h = portals4_nis_h[interface]; portals4_btl->portals_max_outstanding_ops = mca_btl_portals4_component.portals_max_outstanding_ops; - OBJ_CONSTRUCT(&(portals4_btl->portals_frag_eager), ompi_free_list_t); - OBJ_CONSTRUCT(&(portals4_btl->portals_frag_max), ompi_free_list_t); - OBJ_CONSTRUCT(&(portals4_btl->portals_frag_user), ompi_free_list_t); + OBJ_CONSTRUCT(&(portals4_btl->portals_frag_eager), opal_free_list_t); + OBJ_CONSTRUCT(&(portals4_btl->portals_frag_max), opal_free_list_t); + OBJ_CONSTRUCT(&(portals4_btl->portals_frag_user), opal_free_list_t); /* eager frags */ - ompi_free_list_init_new(&(portals4_btl->portals_frag_eager), + opal_free_list_init (&(portals4_btl->portals_frag_eager), sizeof(mca_btl_portals4_frag_eager_t) + portals4_btl->super.btl_eager_limit, opal_cache_line_size, @@ -367,10 +369,10 @@ static mca_btl_base_module_t** mca_btl_portals4_component_init(int *num_btls, mca_btl_portals4_component.portals_free_list_init_num, mca_btl_portals4_component.portals_free_list_eager_max_num, mca_btl_portals4_component.portals_free_list_inc_num, - NULL); + NULL, 0, NULL, NULL, NULL); /* send frags */ - ompi_free_list_init_new(&(portals4_btl->portals_frag_max), + opal_free_list_init (&(portals4_btl->portals_frag_max), sizeof(mca_btl_portals4_frag_max_t) + portals4_btl->super.btl_max_send_size, opal_cache_line_size, @@ -379,10 +381,10 @@ static mca_btl_base_module_t** mca_btl_portals4_component_init(int *num_btls, mca_btl_portals4_component.portals_free_list_init_num, mca_btl_portals4_component.portals_free_list_max_num, mca_btl_portals4_component.portals_free_list_inc_num, - NULL); + NULL, 0, NULL, NULL, NULL); /* user frags */ - ompi_free_list_init_new(&(portals4_btl->portals_frag_user), + opal_free_list_init (&(portals4_btl->portals_frag_user), sizeof(mca_btl_portals4_frag_user_t), opal_cache_line_size, OBJ_CLASS(mca_btl_portals4_frag_user_t), @@ -390,7 +392,7 @@ static mca_btl_base_module_t** mca_btl_portals4_component_init(int *num_btls, mca_btl_portals4_component.portals_free_list_init_num, mca_btl_portals4_component.portals_free_list_max_num, mca_btl_portals4_component.portals_free_list_inc_num, - NULL); + NULL, 0, NULL, NULL, NULL); /* receive block list */ OBJ_CONSTRUCT(&(portals4_btl->portals_recv_blocks), opal_list_t); diff --git a/opal/mca/btl/portals4/btl_portals4_frag.h b/opal/mca/btl/portals4/btl_portals4_frag.h index e3b8551264..d615bef84b 100644 --- a/opal/mca/btl/portals4/btl_portals4_frag.h +++ b/opal/mca/btl/portals4/btl_portals4_frag.h @@ -1,3 +1,4 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology @@ -9,7 +10,7 @@ * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. - * Copyright (c) 2011-2012 Los Alamos National Security, LLC. + * Copyright (c) 2011-2015 Los Alamos National Security, LLC. * All rights reserved. * Copyright (c) 2014 Bull SAS. All rights reserved. * $COPYRIGHT$ @@ -77,48 +78,43 @@ OBJ_CLASS_DECLARATION(mca_btl_portals4_frag_user_t); * Macros to allocate/return descriptors from module specific * free list(s). */ -#define OPAL_BTL_PORTALS4_FRAG_ALLOC_EAGER(btl_macro, frag) \ -{ \ - \ - ompi_free_list_item_t *item; \ - OMPI_FREE_LIST_GET_MT(&((mca_btl_portals4_module_t*)btl_macro)->portals_frag_eager, item); \ - frag = (mca_btl_portals4_frag_t*) item; \ - if (NULL == frag) { \ - OPAL_BTL_PORTALS4_FRAG_ALLOC_MAX(btl_macro, frag); \ - } \ +#define OPAL_BTL_PORTALS4_FRAG_ALLOC_EAGER(btl_macro, frag) \ +{ \ + frag = (mca_btl_portals4_frag_t *) \ + opal_free_list_get (&((mca_btl_portals4_module_t*)btl_macro)->portals_frag_eager); \ + if (NULL == frag) { \ + OPAL_BTL_PORTALS4_FRAG_ALLOC_MAX(btl_macro, frag); \ + } \ } #define OPAL_BTL_PORTALS4_FRAG_RETURN_EAGER(btl_macro, frag) \ { \ assert(BTL_PORTALS4_FRAG_TYPE_EAGER == frag->type); \ - OMPI_FREE_LIST_RETURN_MT(&((mca_btl_portals4_module_t*)btl_macro)->portals_frag_eager, \ - (ompi_free_list_item_t*)(frag)); \ + opal_free_list_return (&((mca_btl_portals4_module_t*)btl_macro)->portals_frag_eager, \ + (opal_free_list_item_t*)(frag)); \ } #define OPAL_BTL_PORTALS4_FRAG_ALLOC_MAX(btl_macro, frag) \ { \ - \ - ompi_free_list_item_t *item_macro; \ - OMPI_FREE_LIST_GET_MT(&((mca_btl_portals4_module_t*)btl_macro)->portals_frag_max, item_macro); \ - frag = (mca_btl_portals4_frag_t*) item_macro; \ + frag = (mca_btl_portals4_frag_t*) \ + opal_free_list_get (&((mca_btl_portals4_module_t*)btl_macro)->portals_frag_max); \ } #define OPAL_BTL_PORTALS4_FRAG_RETURN_MAX(btl_macro, frag) \ { \ assert(BTL_PORTALS4_FRAG_TYPE_MAX == frag->type); \ - OMPI_FREE_LIST_RETURN_MT(&((mca_btl_portals4_module_t*)btl_macro)->portals_frag_max, \ - (ompi_free_list_item_t*)(frag)); \ + opal_free_list_return (&((mca_btl_portals4_module_t*)btl_macro)->portals_frag_max, \ + (opal_free_list_item_t*)(frag)); \ } #define OPAL_BTL_PORTALS4_FRAG_ALLOC_USER(btl_macro, frag) \ { \ - ompi_free_list_item_t *item; \ - OMPI_FREE_LIST_GET_MT(&((mca_btl_portals4_module_t*)btl_macro)->portals_frag_user, item); \ - frag = (mca_btl_portals4_frag_t*) item; \ + frag = (mca_btl_portals4_frag_t*) \ + opal_free_list_get (&((mca_btl_portals4_module_t*)btl_macro)->portals_frag_user); \ frag->base.des_cbfunc = NULL; \ } @@ -126,8 +122,8 @@ OBJ_CLASS_DECLARATION(mca_btl_portals4_frag_user_t); #define OPAL_BTL_PORTALS4_FRAG_RETURN_USER(btl_macro, frag) \ { \ assert(BTL_PORTALS4_FRAG_TYPE_USER == frag->type); \ - OMPI_FREE_LIST_RETURN_MT(&((mca_btl_portals4_module_t*)btl_macro)->portals_frag_user, \ - (ompi_free_list_item_t*)(frag)); \ + opal_free_list_return (&((mca_btl_portals4_module_t*)btl_macro)->portals_frag_user, \ + (opal_free_list_item_t*)(frag)); \ } diff --git a/opal/mca/btl/scif/btl_scif.h b/opal/mca/btl/scif/btl_scif.h index e55ace0a31..496f508e31 100644 --- a/opal/mca/btl/scif/btl_scif.h +++ b/opal/mca/btl/scif/btl_scif.h @@ -26,7 +26,6 @@ #include "opal/mca/btl/btl.h" #include "opal/mca/btl/base/base.h" #include "opal/mca/btl/base/btl_base_error.h" -#include "opal/class/ompi_free_list.h" #include #include @@ -85,10 +84,10 @@ typedef struct mca_btl_scif_module_t { opal_list_t failed_frags; /* fragments for DMA */ - ompi_free_list_t dma_frags; + opal_free_list_t dma_frags; /* fragments for eager send */ - ompi_free_list_t eager_frags; + opal_free_list_t eager_frags; pthread_t listen_thread; diff --git a/opal/mca/btl/scif/btl_scif_add_procs.c b/opal/mca/btl/scif/btl_scif_add_procs.c index f801ee5c7a..76fc290f09 100644 --- a/opal/mca/btl/scif/btl_scif_add_procs.c +++ b/opal/mca/btl/scif/btl_scif_add_procs.c @@ -1,6 +1,6 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* - * Copyright (c) 2013 Los Alamos National Security, LLC. All rights + * Copyright (c) 2013-2015 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2014 Research Organization for Information Science * and Technology (RIST). All rights reserved. @@ -233,26 +233,26 @@ mca_btl_scif_setup_mpools (mca_btl_scif_module_t *scif_module) /* setup free lists for fragments. dma fragments will be used for * rma operations and in-place sends. eager frags will be used for * buffered sends. */ - rc = ompi_free_list_init_new (&scif_module->dma_frags, - sizeof (mca_btl_scif_dma_frag_t), 64, - OBJ_CLASS(mca_btl_scif_dma_frag_t), - 128, opal_getpagesize (), - mca_btl_scif_component.scif_free_list_num, - mca_btl_scif_component.scif_free_list_max, - mca_btl_scif_component.scif_free_list_inc, - NULL); + rc = opal_free_list_init (&scif_module->dma_frags, + sizeof (mca_btl_scif_dma_frag_t), 64, + OBJ_CLASS(mca_btl_scif_dma_frag_t), + 128, opal_getpagesize (), + mca_btl_scif_component.scif_free_list_num, + mca_btl_scif_component.scif_free_list_max, + mca_btl_scif_component.scif_free_list_inc, + NULL, 0, NULL, NULL, NULL); if (OPAL_UNLIKELY(OPAL_SUCCESS != rc)) { return rc; } - rc = ompi_free_list_init_new (&scif_module->eager_frags, - sizeof (mca_btl_scif_eager_frag_t), 8, - OBJ_CLASS(mca_btl_scif_eager_frag_t), - 128 + scif_module->super.btl_eager_limit, 64, - mca_btl_scif_component.scif_free_list_num, - mca_btl_scif_component.scif_free_list_max, - mca_btl_scif_component.scif_free_list_inc, - NULL); + rc = opal_free_list_init (&scif_module->eager_frags, + sizeof (mca_btl_scif_eager_frag_t), 8, + OBJ_CLASS(mca_btl_scif_eager_frag_t), + 128 + scif_module->super.btl_eager_limit, 64, + mca_btl_scif_component.scif_free_list_num, + mca_btl_scif_component.scif_free_list_max, + mca_btl_scif_component.scif_free_list_inc, + NULL, 0, NULL, NULL); if (OPAL_UNLIKELY(OPAL_SUCCESS != rc)) { BTL_ERROR(("error creating eager receive fragment free list")); return rc; diff --git a/opal/mca/btl/scif/btl_scif_frag.h b/opal/mca/btl/scif/btl_scif_frag.h index 2f6736a6dc..aea6005457 100644 --- a/opal/mca/btl/scif/btl_scif_frag.h +++ b/opal/mca/btl/scif/btl_scif_frag.h @@ -1,6 +1,6 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* - * Copyright (c) 2013 Los Alamos National Security, LLC. All rights + * Copyright (c) 2013-2015 Los Alamos National Security, LLC. All rights * reserved. * $COPYRIGHT$ * @@ -34,7 +34,7 @@ typedef struct mca_btl_scif_base_frag_t { mca_btl_base_segment_t segments[2]; mca_btl_base_endpoint_t *endpoint; mca_btl_scif_reg_t *registration; - ompi_free_list_t *my_list; + opal_free_list_t *my_list; } mca_btl_scif_base_frag_t; typedef mca_btl_scif_base_frag_t mca_btl_scif_dma_frag_t; @@ -44,14 +44,11 @@ OBJ_CLASS_DECLARATION(mca_btl_scif_dma_frag_t); OBJ_CLASS_DECLARATION(mca_btl_scif_eager_frag_t); static inline int mca_btl_scif_frag_alloc (mca_btl_base_endpoint_t *ep, - ompi_free_list_t *list, + opal_free_list_t *list, mca_btl_scif_base_frag_t **frag) { - ompi_free_list_item_t *item = NULL; - - OMPI_FREE_LIST_GET_MT(list, item); - *frag = (mca_btl_scif_base_frag_t *) item; - if (OPAL_LIKELY(NULL != item)) { + *frag = (mca_btl_scif_base_frag_t *) opal_free_list_get (list); + if (OPAL_LIKELY(NULL != *frag)) { (*frag)->my_list = list; (*frag)->endpoint = ep; return OPAL_SUCCESS; @@ -72,7 +69,7 @@ static inline int mca_btl_scif_frag_return (mca_btl_scif_base_frag_t *frag) frag->segments[0].seg_len = 0; frag->segments[1].seg_len = 0; - OMPI_FREE_LIST_RETURN_MT(frag->my_list, (ompi_free_list_item_t *) frag); + opal_free_list_return (frag->my_list, (opal_free_list_item_t *) frag); return OPAL_SUCCESS; } diff --git a/opal/mca/btl/scif/btl_scif_module.c b/opal/mca/btl/scif/btl_scif_module.c index 1926efa86c..67e57dd2c9 100644 --- a/opal/mca/btl/scif/btl_scif_module.c +++ b/opal/mca/btl/scif/btl_scif_module.c @@ -1,6 +1,6 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* - * Copyright (c) 2013-2014 Los Alamos National Security, LLC. All rights + * Copyright (c) 2013-2015 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2014 Research Organization for Information Science * and Technology (RIST). All rights reserved. @@ -94,8 +94,8 @@ int mca_btl_scif_module_init (void) BTL_VERBOSE(("btl/scif: listening @ port %u on node %u\n", mca_btl_scif_module.port_id.port, mca_btl_scif_module.port_id.node)); - OBJ_CONSTRUCT(&mca_btl_scif_module.dma_frags, ompi_free_list_t); - OBJ_CONSTRUCT(&mca_btl_scif_module.eager_frags, ompi_free_list_t); + OBJ_CONSTRUCT(&mca_btl_scif_module.dma_frags, opal_free_list_t); + OBJ_CONSTRUCT(&mca_btl_scif_module.eager_frags, opal_free_list_t); return OPAL_SUCCESS; } diff --git a/opal/mca/btl/self/btl_self.h b/opal/mca/btl/self/btl_self.h index 37316d7b40..e3988e3029 100644 --- a/opal/mca/btl/self/btl_self.h +++ b/opal/mca/btl/self/btl_self.h @@ -33,7 +33,6 @@ #include #endif /* HAVE_SYS_TYPES_H */ #include "opal/mca/event/event.h" -#include "opal/class/ompi_free_list.h" #include "opal/mca/btl/btl.h" #include "opal/mca/btl/base/base.h" @@ -48,9 +47,9 @@ struct mca_btl_self_component_t { int free_list_max; /**< maximum size of free lists */ int free_list_inc; /**< number of elements to alloc when growing free lists */ opal_mutex_t self_lock; - ompi_free_list_t self_frags_eager; /**< free list of self first */ - ompi_free_list_t self_frags_send; /**< free list of self second */ - ompi_free_list_t self_frags_rdma; /**< free list of self second */ + opal_free_list_t self_frags_eager; /**< free list of self first */ + opal_free_list_t self_frags_send; /**< free list of self second */ + opal_free_list_t self_frags_rdma; /**< free list of self second */ }; typedef struct mca_btl_self_component_t mca_btl_self_component_t; OPAL_MODULE_DECLSPEC extern mca_btl_self_component_t mca_btl_self_component; diff --git a/opal/mca/btl/self/btl_self_component.c b/opal/mca/btl/self/btl_self_component.c index 5ddc17365b..3690cda80d 100644 --- a/opal/mca/btl/self/btl_self_component.c +++ b/opal/mca/btl/self/btl_self_component.c @@ -11,6 +11,8 @@ * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * Copyright (c) 2010 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2014-2015 Los Alamos National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -111,9 +113,9 @@ int mca_btl_self_component_open(void) { /* initialize objects */ OBJ_CONSTRUCT(&mca_btl_self_component.self_lock, opal_mutex_t); - OBJ_CONSTRUCT(&mca_btl_self_component.self_frags_eager, ompi_free_list_t); - OBJ_CONSTRUCT(&mca_btl_self_component.self_frags_send, ompi_free_list_t); - OBJ_CONSTRUCT(&mca_btl_self_component.self_frags_rdma, ompi_free_list_t); + OBJ_CONSTRUCT(&mca_btl_self_component.self_frags_eager, opal_free_list_t); + OBJ_CONSTRUCT(&mca_btl_self_component.self_frags_send, opal_free_list_t); + OBJ_CONSTRUCT(&mca_btl_self_component.self_frags_rdma, opal_free_list_t); return OPAL_SUCCESS; } @@ -151,7 +153,7 @@ mca_btl_base_module_t** mca_btl_self_component_init( int *num_btls, } /* initialize free lists */ - ompi_free_list_init_new( &mca_btl_self_component.self_frags_eager, + opal_free_list_init (&mca_btl_self_component.self_frags_eager, sizeof(mca_btl_self_frag_eager_t) + mca_btl_self.btl_eager_limit, opal_cache_line_size, OBJ_CLASS(mca_btl_self_frag_eager_t), @@ -159,8 +161,8 @@ mca_btl_base_module_t** mca_btl_self_component_init( int *num_btls, 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_new( &mca_btl_self_component.self_frags_send, + NULL, 0, NULL, NULL, NULL); + opal_free_list_init (&mca_btl_self_component.self_frags_send, sizeof(mca_btl_self_frag_send_t) + mca_btl_self.btl_max_send_size, opal_cache_line_size, OBJ_CLASS(mca_btl_self_frag_send_t), @@ -168,8 +170,8 @@ mca_btl_base_module_t** mca_btl_self_component_init( int *num_btls, 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_new( &mca_btl_self_component.self_frags_rdma, + NULL, 0, NULL, NULL, NULL); + opal_free_list_init (&mca_btl_self_component.self_frags_rdma, sizeof(mca_btl_self_frag_rdma_t), opal_cache_line_size, OBJ_CLASS(mca_btl_self_frag_rdma_t), @@ -177,7 +179,7 @@ mca_btl_base_module_t** mca_btl_self_component_init( int *num_btls, mca_btl_self_component.free_list_num, mca_btl_self_component.free_list_max, mca_btl_self_component.free_list_inc, - NULL ); + NULL, 0, NULL, NULL, NULL); /* get pointer to the btls */ btls[0] = (mca_btl_base_module_t *)(&mca_btl_self); diff --git a/opal/mca/btl/self/btl_self_frag.h b/opal/mca/btl/self/btl_self_frag.h index f121eba66b..6116322ec5 100644 --- a/opal/mca/btl/self/btl_self_frag.h +++ b/opal/mca/btl/self/btl_self_frag.h @@ -1,3 +1,4 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology @@ -9,6 +10,8 @@ * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -22,7 +25,6 @@ #define MCA_BTL_SELF_SEND_FRAG_H #include -#include "opal/class/ompi_free_list.h" #include "btl_self.h" @@ -46,44 +48,41 @@ OBJ_CLASS_DECLARATION(mca_btl_self_frag_rdma_t); #define MCA_BTL_SELF_FRAG_ALLOC_EAGER(frag) \ { \ - ompi_free_list_item_t* item; \ - OMPI_FREE_LIST_GET_MT(&mca_btl_self_component.self_frags_eager, item); \ - frag = (mca_btl_self_frag_t*)item; \ + frag = (mca_btl_self_frag_t *) \ + opal_free_list_get (&mca_btl_self_component.self_frags_eager); \ } -#define MCA_BTL_SELF_FRAG_RETURN_EAGER(frag) \ -{ \ - OMPI_FREE_LIST_RETURN_MT(&mca_btl_self_component.self_frags_eager, \ - (ompi_free_list_item_t*)(frag)); \ - frag->segment.seg_addr.pval = frag+1; \ +#define MCA_BTL_SELF_FRAG_RETURN_EAGER(frag) \ +{ \ + opal_free_list_return (&mca_btl_self_component.self_frags_eager, \ + (opal_free_list_item_t*)(frag)); \ + frag->segment.seg_addr.pval = frag+1; \ } #define MCA_BTL_SELF_FRAG_ALLOC_SEND(frag) \ { \ - ompi_free_list_item_t* item; \ - OMPI_FREE_LIST_GET_MT(&mca_btl_self_component.self_frags_send, item); \ - frag = (mca_btl_self_frag_t*)item; \ + frag = (mca_btl_self_frag_t *) \ + opal_free_list_get (&mca_btl_self_component.self_frags_send); \ } -#define MCA_BTL_SELF_FRAG_RETURN_SEND(frag) \ -{ \ - OMPI_FREE_LIST_RETURN_MT( &mca_btl_self_component.self_frags_send, \ - (ompi_free_list_item_t*)(frag)); \ - frag->segment.seg_addr.pval = frag+1; \ +#define MCA_BTL_SELF_FRAG_RETURN_SEND(frag) \ +{ \ + opal_free_list_return (&mca_btl_self_component.self_frags_send, \ + (opal_free_list_item_t*)(frag)); \ + frag->segment.seg_addr.pval = frag+1; \ } #define MCA_BTL_SELF_FRAG_ALLOC_RDMA(frag) \ { \ - ompi_free_list_item_t* item; \ - OMPI_FREE_LIST_GET_MT(&mca_btl_self_component.self_frags_rdma, item); \ - frag = (mca_btl_self_frag_t*)item; \ + frag = (mca_btl_self_frag_t *) \ + opal_free_list_get (&mca_btl_self_component.self_frags_rdma); \ } -#define MCA_BTL_SELF_FRAG_RETURN_RDMA(frag) \ -{ \ - OMPI_FREE_LIST_RETURN_MT(&mca_btl_self_component.self_frags_rdma, \ - (ompi_free_list_item_t*)(frag)); \ - frag->segment.seg_addr.pval = frag+1; \ +#define MCA_BTL_SELF_FRAG_RETURN_RDMA(frag) \ +{ \ + opal_free_list_return (&mca_btl_self_component.self_frags_rdma, \ + (opal_free_list_item_t*)(frag)); \ + frag->segment.seg_addr.pval = frag+1; \ } #endif diff --git a/opal/mca/btl/sm/btl_sm.c b/opal/mca/btl/sm/btl_sm.c index 69f2a6cf22..1df7d47f94 100644 --- a/opal/mca/btl/sm/btl_sm.c +++ b/opal/mca/btl/sm/btl_sm.c @@ -52,7 +52,6 @@ #include "opal/mca/shmem/shmem.h" #include "opal/datatype/opal_convertor.h" -#include "opal/class/ompi_free_list.h" #include "opal/mca/btl/btl.h" #include "opal/mca/mpool/base/base.h" #include "opal/mca/mpool/sm/mpool_sm.h" @@ -373,37 +372,37 @@ sm_btl_first_time_init(mca_btl_sm_t *sm_btl, length = sizeof(mca_btl_sm_frag1_t); length_payload = sizeof(mca_btl_sm_hdr_t) + mca_btl_sm_component.eager_limit; - i = ompi_free_list_init_new(&mca_btl_sm_component.sm_frags_eager, length, - opal_cache_line_size, OBJ_CLASS(mca_btl_sm_frag1_t), - length_payload, opal_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); + i = opal_free_list_init (&mca_btl_sm_component.sm_frags_eager, length, + opal_cache_line_size, OBJ_CLASS(mca_btl_sm_frag1_t), + length_payload, opal_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, 0, NULL, NULL, NULL); if ( OPAL_SUCCESS != i ) return i; length = sizeof(mca_btl_sm_frag2_t); length_payload = sizeof(mca_btl_sm_hdr_t) + mca_btl_sm_component.max_frag_size; - i = ompi_free_list_init_new(&mca_btl_sm_component.sm_frags_max, length, - opal_cache_line_size, OBJ_CLASS(mca_btl_sm_frag2_t), - length_payload, opal_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); + i = opal_free_list_init (&mca_btl_sm_component.sm_frags_max, length, + opal_cache_line_size, OBJ_CLASS(mca_btl_sm_frag2_t), + length_payload, opal_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, 0, NULL, NULL, NULL); if ( OPAL_SUCCESS != i ) return i; - i = ompi_free_list_init_new(&mca_btl_sm_component.sm_frags_user, - sizeof(mca_btl_sm_user_t), - opal_cache_line_size, OBJ_CLASS(mca_btl_sm_user_t), - sizeof(mca_btl_sm_hdr_t), opal_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); + i = opal_free_list_init (&mca_btl_sm_component.sm_frags_user, + sizeof(mca_btl_sm_user_t), + opal_cache_line_size, OBJ_CLASS(mca_btl_sm_user_t), + sizeof(mca_btl_sm_hdr_t), opal_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, 0, NULL, NULL, NULL); if ( OPAL_SUCCESS != i ) return i; @@ -411,9 +410,9 @@ sm_btl_first_time_init(mca_btl_sm_t *sm_btl, mca_btl_sm_component.num_pending_sends = 0; i = opal_free_list_init(&mca_btl_sm_component.pending_send_fl, - sizeof(btl_sm_pending_send_item_t), + sizeof(btl_sm_pending_send_item_t), 8, OBJ_CLASS(opal_free_list_item_t), - 0, 0, 16, -1, 32, NULL, 0, NULL, NULL + 0, 0, 16, -1, 32, NULL, 0, NULL, NULL, NULL); if ( OPAL_SUCCESS != i ) return i; @@ -642,8 +641,8 @@ int mca_btl_sm_add_procs( mca_btl_sm_component.num_smp_procs += n_local_procs; /* make sure we have enough eager fragmnents for each process */ - return_code = ompi_free_list_resize_mt(&mca_btl_sm_component.sm_frags_eager, - mca_btl_sm_component.num_smp_procs * 2); + return_code = opal_free_list_resize_mt (&mca_btl_sm_component.sm_frags_eager, + mca_btl_sm_component.num_smp_procs * 2); if (OPAL_SUCCESS != return_code) goto CLEANUP; @@ -1007,9 +1006,9 @@ mca_btl_base_registration_handle_t *mca_btl_sm_register_mem (struct mca_btl_base void *base, size_t size, uint32_t flags) { mca_btl_sm_registration_handle_t *handle; - ompi_free_list_item_t *item = NULL; + opal_free_list_item_t *item = NULL; - OMPI_FREE_LIST_GET_MT(&mca_btl_sm_component.registration_handles, item); + item = opal_free_list_get (&mca_btl_sm_component.registration_handles); if (OPAL_UNLIKELY(NULL == item)) { return NULL; } @@ -1036,7 +1035,7 @@ mca_btl_base_registration_handle_t *mca_btl_sm_register_mem (struct mca_btl_base } if (OPAL_UNLIKELY(ioctl(((mca_btl_sm_t*)btl)->knem_fd, KNEM_CMD_CREATE_REGION, &knem_cr) < 0)) { - OMPI_FREE_LIST_RETURN_MT(&mca_btl_sm_component.registration_handles, item); + opal_free_list_return (&mca_btl_sm_component.registration_handles, item); return NULL; } @@ -1065,7 +1064,7 @@ int mca_btl_sm_deregister_mem (struct mca_btl_base_module_t* btl, mca_btl_base_r } #endif - OMPI_FREE_LIST_RETURN_MT(&mca_btl_sm_component.registration_handles, &sm_handle->super); + opal_free_list_return (&mca_btl_sm_component.registration_handles, &sm_handle->super); return OPAL_SUCCESS; } diff --git a/opal/mca/btl/sm/btl_sm.h b/opal/mca/btl/sm/btl_sm.h index efad491eff..09e03fbbe9 100644 --- a/opal/mca/btl/sm/btl_sm.h +++ b/opal/mca/btl/sm/btl_sm.h @@ -156,10 +156,10 @@ struct mca_btl_sm_component_t { int32_t num_smp_procs; /**< current number of smp procs on this host */ int32_t my_smp_rank; /**< My SMP process rank. Used for accessing * SMP specfic data structures. */ - ompi_free_list_t sm_frags_eager; /**< free list of sm first */ - ompi_free_list_t sm_frags_max; /**< free list of sm second */ - ompi_free_list_t sm_frags_user; - ompi_free_list_t sm_first_frags_to_progress; /**< list of first + opal_free_list_t sm_frags_eager; /**< free list of sm first */ + opal_free_list_t sm_frags_max; /**< free list of sm second */ + opal_free_list_t sm_frags_user; + opal_free_list_t sm_first_frags_to_progress; /**< list of first fragments that are awaiting resources */ struct mca_btl_base_endpoint_t **sm_peers; @@ -186,7 +186,7 @@ struct mca_btl_sm_component_t { #endif #if OPAL_BTL_SM_HAVE_KNEM || OPAL_BTL_SM_HAVE_CMA /** registration handles to hold knem cookies */ - ompi_free_list_t registration_handles; + opal_free_list_t registration_handles; #endif /* OPAL_BTL_SM_HAVE_KNEM */ /** MCA: should we be using knem or not? neg=try but continue if @@ -564,7 +564,7 @@ struct mca_btl_base_registration_handle_t { }; struct mca_btl_sm_registration_handle_t { - ompi_free_list_item_t super; + opal_free_list_item_t super; mca_btl_base_registration_handle_t btl_handle; }; typedef struct mca_btl_sm_registration_handle_t mca_btl_sm_registration_handle_t; diff --git a/opal/mca/btl/sm/btl_sm_component.c b/opal/mca/btl/sm/btl_sm_component.c index 63239ca249..2d6b01e865 100644 --- a/opal/mca/btl/sm/btl_sm_component.c +++ b/opal/mca/btl/sm/btl_sm_component.c @@ -68,7 +68,7 @@ #endif /* OPAL_CUDA_SUPPORT */ #if OPAL_BTL_SM_HAVE_KNEM || OPAL_BTL_SM_HAVE_CMA -static OBJ_CLASS_INSTANCE(mca_btl_sm_registration_handle_t, ompi_free_list_item_t, NULL, NULL); +static OBJ_CLASS_INSTANCE(mca_btl_sm_registration_handle_t, opal_free_list_item_t, NULL, NULL); #endif static int mca_btl_sm_component_open(void); @@ -296,15 +296,15 @@ static int mca_btl_sm_component_open(void) /* initialize objects */ OBJ_CONSTRUCT(&mca_btl_sm_component.sm_lock, opal_mutex_t); - OBJ_CONSTRUCT(&mca_btl_sm_component.sm_frags_eager, ompi_free_list_t); - OBJ_CONSTRUCT(&mca_btl_sm_component.sm_frags_max, ompi_free_list_t); - OBJ_CONSTRUCT(&mca_btl_sm_component.sm_frags_user, ompi_free_list_t); + OBJ_CONSTRUCT(&mca_btl_sm_component.sm_frags_eager, opal_free_list_t); + OBJ_CONSTRUCT(&mca_btl_sm_component.sm_frags_max, opal_free_list_t); + OBJ_CONSTRUCT(&mca_btl_sm_component.sm_frags_user, opal_free_list_t); OBJ_CONSTRUCT(&mca_btl_sm_component.pending_send_fl, opal_free_list_t); mca_btl_sm_component.sm_seg = NULL; #if OPAL_BTL_SM_HAVE_KNEM || OPAL_BTL_SM_HAVE_CMA - OBJ_CONSTRUCT(&mca_btl_sm_component.registration_handles, ompi_free_list_t); + OBJ_CONSTRUCT(&mca_btl_sm_component.registration_handles, opal_free_list_t); #endif #if OPAL_BTL_SM_HAVE_KNEM @@ -955,12 +955,13 @@ mca_btl_sm_component_init(int *num_btls, #if OPAL_BTL_SM_HAVE_KNEM | OPAL_BTL_SM_HAVE_CMA if (mca_btl_sm_component.use_cma || mca_btl_sm_component.use_knem) { - rc = ompi_free_list_init_new (&mca_btl_sm_component.registration_handles, - sizeof (mca_btl_sm_registration_handle_t), - 8, OBJ_CLASS(mca_btl_sm_registration_handle_t), - 0, 0, mca_btl_sm_component.sm_free_list_num, - mca_btl_sm_component.sm_free_list_max, - mca_btl_sm_component.sm_free_list_inc, NULL); + rc = opal_free_list_init (&mca_btl_sm_component.registration_handles, + sizeof (mca_btl_sm_registration_handle_t), + 8, OBJ_CLASS(mca_btl_sm_registration_handle_t), + 0, 0, mca_btl_sm_component.sm_free_list_num, + mca_btl_sm_component.sm_free_list_max, + mca_btl_sm_component.sm_free_list_inc, NULL, 0, + NULL, NULL, NULL); if (OPAL_SUCCESS != rc) { free (btls); return NULL; @@ -1054,7 +1055,7 @@ void btl_sm_process_pending_sends(struct mca_btl_base_endpoint_t *ep) MCA_BTL_SM_FIFO_WRITE(ep, ep->my_smp_rank, ep->peer_smp_rank, si->data, true, false, rc); - opal_free_list_return (&mca_btl_sm_component.pending_send_fl, (opal_list_item_t*)si); + opal_free_list_return (&mca_btl_sm_component.pending_send_fl, (opal_free_list_item_t *) si); if ( OPAL_SUCCESS != rc ) return; diff --git a/opal/mca/btl/sm/btl_sm_frag.h b/opal/mca/btl/sm/btl_sm_frag.h index 424de6a7fb..208f122b74 100644 --- a/opal/mca/btl/sm/btl_sm_frag.h +++ b/opal/mca/btl/sm/btl_sm_frag.h @@ -12,7 +12,7 @@ * All rights reserved. * Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved. * Copyright (c) 2009 Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2014 Los Alamos National Security, LLC. All rights + * Copyright (c) 2014-2015 Los Alamos National Security, LLC. All rights * reserved. * $COPYRIGHT$ * @@ -66,7 +66,7 @@ struct mca_btl_sm_frag_t { size_t size; /* pointer written to the FIFO, this is the base of the shared memory region */ mca_btl_sm_hdr_t *hdr; - ompi_free_list_t* my_list; + opal_free_list_t* my_list; #if OPAL_BTL_SM_HAVE_KNEM /* rdma callback data. required for async get */ struct { @@ -91,28 +91,25 @@ OBJ_CLASS_DECLARATION(mca_btl_sm_user_t); #define MCA_BTL_SM_FRAG_ALLOC_EAGER(frag) \ { \ - ompi_free_list_item_t* item; \ - OMPI_FREE_LIST_GET_MT(&mca_btl_sm_component.sm_frags_eager, item); \ - frag = (mca_btl_sm_frag_t*)item; \ + frag = (mca_btl_sm_frag_t*) \ + opal_free_list_get (&mca_btl_sm_component.sm_frags_eager); \ } #define MCA_BTL_SM_FRAG_ALLOC_MAX(frag) \ { \ - ompi_free_list_item_t* item; \ - OMPI_FREE_LIST_GET_MT(&mca_btl_sm_component.sm_frags_max, item); \ - frag = (mca_btl_sm_frag_t*)item; \ + frag = (mca_btl_sm_frag_t*) \ + opal_free_list_get (&mca_btl_sm_component.sm_frags_max); \ } #define MCA_BTL_SM_FRAG_ALLOC_USER(frag) \ { \ - ompi_free_list_item_t* item; \ - OMPI_FREE_LIST_GET_MT(&mca_btl_sm_component.sm_frags_user, item); \ - frag = (mca_btl_sm_frag_t*)item; \ + frag = (mca_btl_sm_frag_t*) \ + opal_free_list_get (&mca_btl_sm_component.sm_frags_user); \ } #define MCA_BTL_SM_FRAG_RETURN(frag) \ { \ - OMPI_FREE_LIST_RETURN_MT(frag->my_list, (ompi_free_list_item_t*)(frag)); \ + opal_free_list_return (frag->my_list, (opal_free_list_item_t*)(frag)); \ } #endif diff --git a/opal/mca/btl/smcuda/btl_smcuda.c b/opal/mca/btl/smcuda/btl_smcuda.c index fbba356279..463bedce45 100644 --- a/opal/mca/btl/smcuda/btl_smcuda.c +++ b/opal/mca/btl/smcuda/btl_smcuda.c @@ -50,7 +50,6 @@ #include "opal/mca/shmem/base/base.h" #include "opal/mca/shmem/shmem.h" #include "opal/datatype/opal_convertor.h" -#include "opal/class/ompi_free_list.h" #include "opal/mca/btl/btl.h" #if OPAL_CUDA_SUPPORT @@ -401,47 +400,47 @@ smcuda_btl_first_time_init(mca_btl_smcuda_t *smcuda_btl, length = sizeof(mca_btl_smcuda_frag1_t); length_payload = sizeof(mca_btl_smcuda_hdr_t) + mca_btl_smcuda_component.eager_limit; - i = ompi_free_list_init_new(&mca_btl_smcuda_component.sm_frags_eager, length, - opal_cache_line_size, OBJ_CLASS(mca_btl_smcuda_frag1_t), - length_payload, opal_cache_line_size, - mca_btl_smcuda_component.sm_free_list_num, - mca_btl_smcuda_component.sm_free_list_max, - mca_btl_smcuda_component.sm_free_list_inc, - mca_btl_smcuda_component.sm_mpool); + i = opal_free_list_init (&mca_btl_smcuda_component.sm_frags_eager, length, + opal_cache_line_size, OBJ_CLASS(mca_btl_smcuda_frag1_t), + length_payload, opal_cache_line_size, + mca_btl_smcuda_component.sm_free_list_num, + mca_btl_smcuda_component.sm_free_list_max, + mca_btl_smcuda_component.sm_free_list_inc, + mca_btl_smcuda_component.sm_mpool, 0, NULL, NULL, NULL); if ( OPAL_SUCCESS != i ) return i; length = sizeof(mca_btl_smcuda_frag2_t); length_payload = sizeof(mca_btl_smcuda_hdr_t) + mca_btl_smcuda_component.max_frag_size; - i = ompi_free_list_init_new(&mca_btl_smcuda_component.sm_frags_max, length, - opal_cache_line_size, OBJ_CLASS(mca_btl_smcuda_frag2_t), - length_payload, opal_cache_line_size, - mca_btl_smcuda_component.sm_free_list_num, - mca_btl_smcuda_component.sm_free_list_max, - mca_btl_smcuda_component.sm_free_list_inc, - mca_btl_smcuda_component.sm_mpool); + i = opal_free_list_init (&mca_btl_smcuda_component.sm_frags_max, length, + opal_cache_line_size, OBJ_CLASS(mca_btl_smcuda_frag2_t), + length_payload, opal_cache_line_size, + mca_btl_smcuda_component.sm_free_list_num, + mca_btl_smcuda_component.sm_free_list_max, + mca_btl_smcuda_component.sm_free_list_inc, + mca_btl_smcuda_component.sm_mpool, 0, NULL, NULL, NULL); if ( OPAL_SUCCESS != i ) return i; - i = ompi_free_list_init_new(&mca_btl_smcuda_component.sm_frags_user, - sizeof(mca_btl_smcuda_user_t), - opal_cache_line_size, OBJ_CLASS(mca_btl_smcuda_user_t), - sizeof(mca_btl_smcuda_hdr_t), opal_cache_line_size, - mca_btl_smcuda_component.sm_free_list_num, - mca_btl_smcuda_component.sm_free_list_max, - mca_btl_smcuda_component.sm_free_list_inc, - mca_btl_smcuda_component.sm_mpool); + i = opal_free_list_init (&mca_btl_smcuda_component.sm_frags_user, + sizeof(mca_btl_smcuda_user_t), + opal_cache_line_size, OBJ_CLASS(mca_btl_smcuda_user_t), + sizeof(mca_btl_smcuda_hdr_t), opal_cache_line_size, + mca_btl_smcuda_component.sm_free_list_num, + mca_btl_smcuda_component.sm_free_list_max, + mca_btl_smcuda_component.sm_free_list_inc, + mca_btl_smcuda_component.sm_mpool, 0, NULL, NULL, NULL); if ( OPAL_SUCCESS != i ) return i; mca_btl_smcuda_component.num_outstanding_frags = 0; mca_btl_smcuda_component.num_pending_sends = 0; - i = opal_free_list_init(&mca_btl_smcuda_component.pending_send_fl, - sizeof(btl_smcuda_pending_send_item_t), - OBJ_CLASS(opal_free_list_item_t), - 0, 0, 16, -1, 32, NULL, 0, NULL, NULL, NULL); + i = opal_free_list_init (&mca_btl_smcuda_component.pending_send_fl, + sizeof(btl_smcuda_pending_send_item_t), 8, + OBJ_CLASS(opal_free_list_item_t), + 0, 0, 16, -1, 32, NULL, 0, NULL, NULL, NULL); if ( OPAL_SUCCESS != i ) return i; @@ -680,8 +679,8 @@ int mca_btl_smcuda_add_procs( mca_btl_smcuda_component.num_smp_procs += n_local_procs; /* make sure we have enough eager fragmnents for each process */ - return_code = ompi_free_list_resize_mt(&mca_btl_smcuda_component.sm_frags_eager, - mca_btl_smcuda_component.num_smp_procs * 2); + return_code = opal_free_list_resize_mt (&mca_btl_smcuda_component.sm_frags_eager, + mca_btl_smcuda_component.num_smp_procs * 2); if (OPAL_SUCCESS != return_code) goto CLEANUP; diff --git a/opal/mca/btl/smcuda/btl_smcuda.h b/opal/mca/btl/smcuda/btl_smcuda.h index edbe681efc..b94b6e7fc6 100644 --- a/opal/mca/btl/smcuda/btl_smcuda.h +++ b/opal/mca/btl/smcuda/btl_smcuda.h @@ -152,10 +152,10 @@ struct mca_btl_smcuda_component_t { int32_t num_smp_procs; /**< current number of smp procs on this host */ int32_t my_smp_rank; /**< My SMP process rank. Used for accessing * SMP specfic data structures. */ - ompi_free_list_t sm_frags_eager; /**< free list of sm first */ - ompi_free_list_t sm_frags_max; /**< free list of sm second */ - ompi_free_list_t sm_frags_user; - ompi_free_list_t sm_first_frags_to_progress; /**< list of first + opal_free_list_t sm_frags_eager; /**< free list of sm first */ + opal_free_list_t sm_frags_max; /**< free list of sm second */ + opal_free_list_t sm_frags_user; + opal_free_list_t sm_first_frags_to_progress; /**< list of first fragments that are awaiting resources */ struct mca_btl_base_endpoint_t **sm_peers; diff --git a/opal/mca/btl/smcuda/btl_smcuda_component.c b/opal/mca/btl/smcuda/btl_smcuda_component.c index e8665e0b3b..e5529677ab 100644 --- a/opal/mca/btl/smcuda/btl_smcuda_component.c +++ b/opal/mca/btl/smcuda/btl_smcuda_component.c @@ -218,9 +218,9 @@ static int mca_btl_smcuda_component_open(void) /* initialize objects */ OBJ_CONSTRUCT(&mca_btl_smcuda_component.sm_lock, opal_mutex_t); - OBJ_CONSTRUCT(&mca_btl_smcuda_component.sm_frags_eager, ompi_free_list_t); - OBJ_CONSTRUCT(&mca_btl_smcuda_component.sm_frags_max, ompi_free_list_t); - OBJ_CONSTRUCT(&mca_btl_smcuda_component.sm_frags_user, ompi_free_list_t); + OBJ_CONSTRUCT(&mca_btl_smcuda_component.sm_frags_eager, opal_free_list_t); + OBJ_CONSTRUCT(&mca_btl_smcuda_component.sm_frags_max, opal_free_list_t); + OBJ_CONSTRUCT(&mca_btl_smcuda_component.sm_frags_user, opal_free_list_t); OBJ_CONSTRUCT(&mca_btl_smcuda_component.pending_send_fl, opal_free_list_t); return OPAL_SUCCESS; } diff --git a/opal/mca/btl/smcuda/btl_smcuda_frag.h b/opal/mca/btl/smcuda/btl_smcuda_frag.h index 7ed50df079..c570d65bdc 100644 --- a/opal/mca/btl/smcuda/btl_smcuda_frag.h +++ b/opal/mca/btl/smcuda/btl_smcuda_frag.h @@ -84,7 +84,7 @@ struct mca_btl_smcuda_frag_t { size_t size; /* pointer written to the FIFO, this is the base of the shared memory region */ mca_btl_smcuda_hdr_t *hdr; - ompi_free_list_t* my_list; + opal_free_list_t* my_list; }; typedef struct mca_btl_smcuda_frag_t mca_btl_smcuda_frag_t; typedef struct mca_btl_smcuda_frag_t mca_btl_smcuda_frag1_t; @@ -97,29 +97,26 @@ OBJ_CLASS_DECLARATION(mca_btl_smcuda_frag1_t); OBJ_CLASS_DECLARATION(mca_btl_smcuda_frag2_t); OBJ_CLASS_DECLARATION(mca_btl_smcuda_user_t); -#define MCA_BTL_SMCUDA_FRAG_ALLOC_EAGER(frag) \ +#define MCA_BTL_SMCUDA_FRAG_ALLOC_EAGER(frag) \ { \ - ompi_free_list_item_t* item; \ - OMPI_FREE_LIST_GET_MT(&mca_btl_smcuda_component.sm_frags_eager, item); \ - frag = (mca_btl_smcuda_frag_t*)item; \ + frag = (mca_btl_smcuda_frag_t *) \ + opal_free_list_get (&mca_btl_smcuda_component.sm_frags_eager); \ } -#define MCA_BTL_SMCUDA_FRAG_ALLOC_MAX(frag) \ +#define MCA_BTL_SMCUDA_FRAG_ALLOC_MAX(frag) \ { \ - ompi_free_list_item_t* item; \ - OMPI_FREE_LIST_GET_MT(&mca_btl_smcuda_component.sm_frags_max, item); \ - frag = (mca_btl_smcuda_frag_t*)item; \ + frag = (mca_btl_smcuda_frag_t *) \ + opal_free_list_get (&mca_btl_smcuda_component.sm_frags_max); \ } -#define MCA_BTL_SMCUDA_FRAG_ALLOC_USER(frag) \ +#define MCA_BTL_SMCUDA_FRAG_ALLOC_USER(frag) \ { \ - ompi_free_list_item_t* item; \ - OMPI_FREE_LIST_GET_MT(&mca_btl_smcuda_component.sm_frags_user, item); \ - frag = (mca_btl_smcuda_frag_t*)item; \ + frag = (mca_btl_smcuda_frag_t *) \ + opal_free_list_get (&mca_btl_smcuda_component.sm_frags_user); \ } -#define MCA_BTL_SMCUDA_FRAG_RETURN(frag) \ -{ \ - OMPI_FREE_LIST_RETURN_MT(frag->my_list, (ompi_free_list_item_t*)(frag)); \ +#define MCA_BTL_SMCUDA_FRAG_RETURN(frag) \ +{ \ + opal_free_list_return (frag->my_list, (opal_free_list_item_t*)(frag)); \ } #endif diff --git a/opal/mca/btl/tcp/btl_tcp.h b/opal/mca/btl/tcp/btl_tcp.h index 7b45e08ed0..178f4b5627 100644 --- a/opal/mca/btl/tcp/btl_tcp.h +++ b/opal/mca/btl/tcp/btl_tcp.h @@ -40,7 +40,6 @@ /* Open MPI includes */ #include "opal/mca/event/event.h" -#include "opal/class/ompi_free_list.h" #include "opal/mca/btl/btl.h" #include "opal/mca/btl/base/base.h" #include "opal/mca/mpool/mpool.h" @@ -89,9 +88,9 @@ struct mca_btl_tcp_component_t { int tcp_disable_family; /**< disabled AF_family */ /* free list of fragment descriptors */ - ompi_free_list_t tcp_frag_eager; - ompi_free_list_t tcp_frag_max; - ompi_free_list_t tcp_frag_user; + opal_free_list_t tcp_frag_eager; + opal_free_list_t tcp_frag_max; + opal_free_list_t tcp_frag_user; /* Do we want to use TCP_NODELAY? */ int tcp_not_use_nodelay; diff --git a/opal/mca/btl/tcp/btl_tcp_component.c b/opal/mca/btl/tcp/btl_tcp_component.c index 8610f98726..53d2209142 100644 --- a/opal/mca/btl/tcp/btl_tcp_component.c +++ b/opal/mca/btl/tcp/btl_tcp_component.c @@ -13,7 +13,7 @@ * Copyright (c) 2007-2014 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved. * Copyright (c) 2009 Oak Ridge National Laboratory - * Copyright (c) 2012-2014 Los Alamos National Security, LLC. All rights + * Copyright (c) 2012-2015 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2013-2014 NVIDIA Corporation. All rights reserved. * Copyright (c) 2014 Intel, Inc. All rights reserved. @@ -300,9 +300,9 @@ static int mca_btl_tcp_component_open(void) /* initialize objects */ OBJ_CONSTRUCT(&mca_btl_tcp_component.tcp_lock, opal_mutex_t); OBJ_CONSTRUCT(&mca_btl_tcp_component.tcp_procs, opal_proc_table_t); - OBJ_CONSTRUCT(&mca_btl_tcp_component.tcp_frag_eager, ompi_free_list_t); - OBJ_CONSTRUCT(&mca_btl_tcp_component.tcp_frag_max, ompi_free_list_t); - OBJ_CONSTRUCT(&mca_btl_tcp_component.tcp_frag_user, ompi_free_list_t); + OBJ_CONSTRUCT(&mca_btl_tcp_component.tcp_frag_eager, opal_free_list_t); + OBJ_CONSTRUCT(&mca_btl_tcp_component.tcp_frag_max, opal_free_list_t); + OBJ_CONSTRUCT(&mca_btl_tcp_component.tcp_frag_user, opal_free_list_t); opal_proc_table_init(&mca_btl_tcp_component.tcp_procs, 16, 256); /* if_include and if_exclude need to be mutually exclusive */ @@ -934,7 +934,7 @@ 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_new( &mca_btl_tcp_component.tcp_frag_eager, + opal_free_list_init( &mca_btl_tcp_component.tcp_frag_eager, sizeof (mca_btl_tcp_frag_eager_t) + mca_btl_tcp_module.super.btl_eager_limit, opal_cache_line_size, @@ -943,9 +943,9 @@ mca_btl_base_module_t** mca_btl_tcp_component_init(int *num_btl_modules, 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 ); + NULL, 0, NULL, NULL, NULL ); - ompi_free_list_init_new( &mca_btl_tcp_component.tcp_frag_max, + opal_free_list_init( &mca_btl_tcp_component.tcp_frag_max, sizeof (mca_btl_tcp_frag_max_t) + mca_btl_tcp_module.super.btl_max_send_size, opal_cache_line_size, @@ -954,9 +954,9 @@ mca_btl_base_module_t** mca_btl_tcp_component_init(int *num_btl_modules, 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 ); + NULL, 0, NULL, NULL, NULL ); - ompi_free_list_init_new( &mca_btl_tcp_component.tcp_frag_user, + opal_free_list_init( &mca_btl_tcp_component.tcp_frag_user, sizeof (mca_btl_tcp_frag_user_t), opal_cache_line_size, OBJ_CLASS (mca_btl_tcp_frag_user_t), @@ -964,7 +964,7 @@ mca_btl_base_module_t** mca_btl_tcp_component_init(int *num_btl_modules, 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 ); + NULL, 0, NULL, NULL, NULL ); /* create a BTL TCP module for selected interfaces */ if(OPAL_SUCCESS != (ret = mca_btl_tcp_component_create_instances() )) { diff --git a/opal/mca/btl/tcp/btl_tcp_frag.h b/opal/mca/btl/tcp/btl_tcp_frag.h index ab7637b4d7..9802069f4f 100644 --- a/opal/mca/btl/tcp/btl_tcp_frag.h +++ b/opal/mca/btl/tcp/btl_tcp_frag.h @@ -10,7 +10,7 @@ * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. - * Copyright (c) 2014 Los Alamos National Security, LLC. All rights + * Copyright (c) 2014-2015 Los Alamos National Security, LLC. All rights * reserved. * $COPYRIGHT$ * @@ -57,7 +57,7 @@ struct mca_btl_tcp_frag_t { size_t iov_idx; size_t size; int rc; - ompi_free_list_t* my_list; + opal_free_list_t* my_list; /* fake rdma completion */ struct { mca_btl_base_rdma_completion_fn_t func; @@ -86,30 +86,27 @@ OBJ_CLASS_DECLARATION(mca_btl_tcp_frag_user_t); * free list(s). */ -#define MCA_BTL_TCP_FRAG_ALLOC_EAGER(frag) \ -{ \ - ompi_free_list_item_t *item; \ - OMPI_FREE_LIST_GET_MT(&mca_btl_tcp_component.tcp_frag_eager, item); \ - frag = (mca_btl_tcp_frag_t*) item; \ +#define MCA_BTL_TCP_FRAG_ALLOC_EAGER(frag) \ +{ \ + frag = (mca_btl_tcp_frag_t*) \ + opal_free_list_get (&mca_btl_tcp_component.tcp_frag_eager); \ } -#define MCA_BTL_TCP_FRAG_ALLOC_MAX(frag) \ -{ \ - ompi_free_list_item_t *item; \ - OMPI_FREE_LIST_GET_MT(&mca_btl_tcp_component.tcp_frag_max, item); \ - frag = (mca_btl_tcp_frag_t*) item; \ +#define MCA_BTL_TCP_FRAG_ALLOC_MAX(frag) \ +{ \ + frag = (mca_btl_tcp_frag_t*) \ + opal_free_list_get (&mca_btl_tcp_component.tcp_frag_max); \ } -#define MCA_BTL_TCP_FRAG_ALLOC_USER(frag) \ -{ \ - ompi_free_list_item_t *item; \ - OMPI_FREE_LIST_GET_MT(&mca_btl_tcp_component.tcp_frag_user, item); \ - frag = (mca_btl_tcp_frag_t*) item; \ +#define MCA_BTL_TCP_FRAG_ALLOC_USER(frag) \ +{ \ + frag = (mca_btl_tcp_frag_t*) \ + opal_free_list_get (&mca_btl_tcp_component.tcp_frag_user); \ } #define MCA_BTL_TCP_FRAG_RETURN(frag) \ { \ - OMPI_FREE_LIST_RETURN_MT(frag->my_list, (ompi_free_list_item_t*)(frag)); \ + opal_free_list_return (frag->my_list, (opal_free_list_item_t*)(frag)); \ } #define MCA_BTL_TCP_FRAG_INIT_DST(frag,ep) \ diff --git a/opal/mca/btl/template/btl_template.h b/opal/mca/btl/template/btl_template.h index cfe7231230..efd7b889d3 100644 --- a/opal/mca/btl/template/btl_template.h +++ b/opal/mca/btl/template/btl_template.h @@ -30,7 +30,6 @@ /* Open MPI includes */ #include "opal/mca/event/event.h" -#include "opal/class/ompi_free_list.h" #include "opal/mca/btl/btl.h" #include "opal/mca/btl/base/base.h" #include "opal/mca/mpool/mpool.h" @@ -84,9 +83,9 @@ struct mca_btl_template_module_t { mca_btl_base_module_t super; /**< base BTL interface */ /* free list of fragment descriptors */ - ompi_free_list_t template_frag_eager; - ompi_free_list_t template_frag_max; - ompi_free_list_t template_frag_user; + opal_free_list_t template_frag_eager; + opal_free_list_t template_frag_max; + opal_free_list_t template_frag_user; /* lock for accessing module state */ opal_mutex_t template_lock; diff --git a/opal/mca/btl/template/btl_template_frag.h b/opal/mca/btl/template/btl_template_frag.h index 81b7a2e85f..d09e23b533 100644 --- a/opal/mca/btl/template/btl_template_frag.h +++ b/opal/mca/btl/template/btl_template_frag.h @@ -1,3 +1,4 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology @@ -9,6 +10,8 @@ * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -60,46 +63,41 @@ OBJ_CLASS_DECLARATION(mca_btl_template_frag_user_t); * free list(s). */ -#define MCA_BTL_TEMPLATE_FRAG_ALLOC_EAGER(btl, frag) \ -{ \ - \ - ompi_free_list_item_t *item; \ - OMPI_FREE_LIST_GET_MT(&((mca_btl_template_module_t*)btl)->template_frag_eager, item); \ - frag = (mca_btl_template_frag_t*) item; \ +#define MCA_BTL_TEMPLATE_FRAG_ALLOC_EAGER(btl, frag) \ +{ \ + frag = (mca_btl_template_frag_t *) \ + opal_free_list_get (&((mca_btl_template_module_t*)btl)->template_frag_eager); \ } -#define MCA_BTL_TEMPLATE_FRAG_RETURN_EAGER(btl, frag) \ -{ \ - OMPI_FREE_LIST_RETURN_MT(&((mca_btl_template_module_t*)btl)->template_frag_eager, \ - (ompi_free_list_item_t*)(frag)); \ +#define MCA_BTL_TEMPLATE_FRAG_RETURN_EAGER(btl, frag) \ +{ \ + opal_free_list_return (&((mca_btl_template_module_t*)btl)->template_frag_eager, \ + (opal_free_list_item_t*)(frag)); \ } -#define MCA_BTL_TEMPLATE_FRAG_ALLOC_MAX(btl, frag) \ -{ \ - \ - ompi_free_list_item_t *item; \ - OMPI_FREE_LIST_GET_MT(&((mca_btl_template_module_t*)btl)->template_frag_max, item); \ - frag = (mca_btl_template_frag_t*) item; \ +#define MCA_BTL_TEMPLATE_FRAG_ALLOC_MAX(btl, frag) \ +{ \ + frag = (mca_btl_template_frag_t *) \ + opal_free_list_get (&((mca_btl_template_module_t*)btl)->template_frag_max); \ } -#define MCA_BTL_TEMPLATE_FRAG_RETURN_MAX(btl, frag) \ -{ \ - OMPI_FREE_LIST_RETURN_MT(&((mca_btl_template_module_t*)btl)->template_frag_max, \ - (ompi_free_list_item_t*)(frag)); \ +#define MCA_BTL_TEMPLATE_FRAG_RETURN_MAX(btl, frag) \ +{ \ + opal_free_list_return (&((mca_btl_template_module_t*)btl)->template_frag_max, \ + (opal_free_list_item_t*)(frag)); \ } -#define MCA_BTL_TEMPLATE_FRAG_ALLOC_USER(btl, frag) \ -{ \ - ompi_free_list_item_t *item; \ - OMPI_FREE_LIST_GET_MT(&((mca_btl_template_module_t*)btl)->template_frag_user, item); \ - frag = (mca_btl_template_frag_t*) item; \ +#define MCA_BTL_TEMPLATE_FRAG_ALLOC_USER(btl, frag) \ +{ \ + frag = (mca_btl_template_frag_t*) \ + opal_free_list_get (&((mca_btl_template_module_t*)btl)->template_frag_user); \ } -#define MCA_BTL_TEMPLATE_FRAG_RETURN_USER(btl, frag) \ -{ \ - OMPI_FREE_LIST_RETURN_MT(&((mca_btl_template_module_t*)btl)->template_frag_user, \ - (ompi_free_list_item_t*)(frag)); \ +#define MCA_BTL_TEMPLATE_FRAG_RETURN_USER(btl, frag) \ +{ \ + opal_free_list_return (&((mca_btl_template_module_t*)btl)->template_frag_user, \ + (opal_free_list_item_t*)(frag)); \ } diff --git a/opal/mca/btl/ugni/btl_ugni.h b/opal/mca/btl/ugni/btl_ugni.h index 977fcf7f77..d6ea8a6811 100644 --- a/opal/mca/btl/ugni/btl_ugni.h +++ b/opal/mca/btl/ugni/btl_ugni.h @@ -32,7 +32,6 @@ #include "opal/mca/btl/base/base.h" #include "opal/mca/btl/base/btl_base_error.h" #include "opal/class/opal_hash_table.h" -#include "opal/class/ompi_free_list.h" #include "opal/class/opal_free_list.h" #include "opal/mca/common/ugni/common_ugni.h" @@ -84,10 +83,10 @@ typedef struct mca_btl_ugni_module_t { opal_mutex_t pending_descriptors_lock; opal_list_t pending_descriptors; - ompi_free_list_t post_descriptors; + opal_free_list_t post_descriptors; mca_mpool_base_module_t *smsg_mpool; - ompi_free_list_t smsg_mboxes; + opal_free_list_t smsg_mboxes; gni_ep_handle_t wildcard_ep; struct mca_btl_base_endpoint_t *local_ep; @@ -101,15 +100,15 @@ typedef struct mca_btl_ugni_module_t { gni_cq_handle_t rdma_local_irq_cq; /* eager fragment list (registered) */ - ompi_free_list_t eager_frags_send; - ompi_free_list_t eager_frags_recv; + opal_free_list_t eager_frags_send; + opal_free_list_t eager_frags_recv; /* SMSG fragment list (unregistered) */ - ompi_free_list_t smsg_frags; + opal_free_list_t smsg_frags; /* RDMA fragment list */ - ompi_free_list_t rdma_frags; - ompi_free_list_t rdma_int_frags; + opal_free_list_t rdma_frags; + opal_free_list_t rdma_int_frags; /* lock for this list */ diff --git a/opal/mca/btl/ugni/btl_ugni_add_procs.c b/opal/mca/btl/ugni/btl_ugni_add_procs.c index bc5a184dc6..b7e5d1f828 100644 --- a/opal/mca/btl/ugni/btl_ugni_add_procs.c +++ b/opal/mca/btl/ugni/btl_ugni_add_procs.c @@ -319,40 +319,40 @@ mca_btl_ugni_setup_mpools (mca_btl_ugni_module_t *ugni_module) return rc; } - rc = ompi_free_list_init_ex_new (&ugni_module->smsg_frags, - sizeof (mca_btl_ugni_smsg_frag_t), - opal_cache_line_size, OBJ_CLASS(mca_btl_ugni_smsg_frag_t), - mca_btl_ugni_component.ugni_smsg_limit, - opal_cache_line_size, - mca_btl_ugni_component.ugni_free_list_num, - mca_btl_ugni_component.ugni_free_list_max, - mca_btl_ugni_component.ugni_free_list_inc, - NULL, (ompi_free_list_item_init_fn_t) mca_btl_ugni_frag_init, - (void *) ugni_module); + rc = opal_free_list_init (&ugni_module->smsg_frags, + sizeof (mca_btl_ugni_smsg_frag_t), + opal_cache_line_size, OBJ_CLASS(mca_btl_ugni_smsg_frag_t), + mca_btl_ugni_component.ugni_smsg_limit, + opal_cache_line_size, + mca_btl_ugni_component.ugni_free_list_num, + mca_btl_ugni_component.ugni_free_list_max, + mca_btl_ugni_component.ugni_free_list_inc, + NULL, 0, NULL, (opal_free_list_item_init_fn_t) mca_btl_ugni_frag_init, + (void *) ugni_module); if (OPAL_UNLIKELY(OPAL_SUCCESS != rc)) { BTL_ERROR(("error creating smsg fragment free list")); return rc; } - rc = ompi_free_list_init_ex_new (&ugni_module->rdma_frags, - sizeof (mca_btl_ugni_rdma_frag_t), 64, - OBJ_CLASS(mca_btl_ugni_rdma_frag_t), - 0, opal_cache_line_size, - mca_btl_ugni_component.ugni_free_list_num, - mca_btl_ugni_component.ugni_free_list_max, - mca_btl_ugni_component.ugni_free_list_inc, - NULL, (ompi_free_list_item_init_fn_t) mca_btl_ugni_frag_init, - (void *) ugni_module); + rc = opal_free_list_init (&ugni_module->rdma_frags, + sizeof (mca_btl_ugni_rdma_frag_t), 64, + OBJ_CLASS(mca_btl_ugni_rdma_frag_t), + 0, opal_cache_line_size, + mca_btl_ugni_component.ugni_free_list_num, + mca_btl_ugni_component.ugni_free_list_max, + mca_btl_ugni_component.ugni_free_list_inc, + NULL, 0, NULL, (opal_free_list_item_init_fn_t) mca_btl_ugni_frag_init, + (void *) ugni_module); if (OPAL_UNLIKELY(OPAL_SUCCESS != rc)) { return rc; } - rc = ompi_free_list_init_ex_new (&ugni_module->rdma_int_frags, - sizeof (mca_btl_ugni_rdma_frag_t), 8, - OBJ_CLASS(mca_btl_ugni_rdma_frag_t), - 0, opal_cache_line_size, 0, -1, 64, - NULL, (ompi_free_list_item_init_fn_t) mca_btl_ugni_frag_init, - (void *) ugni_module); + rc = opal_free_list_init (&ugni_module->rdma_int_frags, + sizeof (mca_btl_ugni_rdma_frag_t), 8, + OBJ_CLASS(mca_btl_ugni_rdma_frag_t), + 0, opal_cache_line_size, 0, -1, 64, + NULL, 0, NULL, (opal_free_list_item_init_fn_t) mca_btl_ugni_frag_init, + (void *) ugni_module); if (OPAL_UNLIKELY(OPAL_SUCCESS != rc)) { return rc; } @@ -397,31 +397,31 @@ mca_btl_ugni_setup_mpools (mca_btl_ugni_module_t *ugni_module) return OPAL_ERROR; } - rc = ompi_free_list_init_ex_new (&ugni_module->eager_frags_send, - sizeof (mca_btl_ugni_eager_frag_t), 8, - OBJ_CLASS(mca_btl_ugni_eager_frag_t), - ugni_module->super.btl_eager_limit, 64, - mca_btl_ugni_component.ugni_eager_num, - mca_btl_ugni_component.ugni_eager_max, - mca_btl_ugni_component.ugni_eager_inc, - ugni_module->super.btl_mpool, - (ompi_free_list_item_init_fn_t) mca_btl_ugni_frag_init, - (void *) ugni_module); + rc = opal_free_list_init (&ugni_module->eager_frags_send, + sizeof (mca_btl_ugni_eager_frag_t), 8, + OBJ_CLASS(mca_btl_ugni_eager_frag_t), + ugni_module->super.btl_eager_limit, 64, + mca_btl_ugni_component.ugni_eager_num, + mca_btl_ugni_component.ugni_eager_max, + mca_btl_ugni_component.ugni_eager_inc, + ugni_module->super.btl_mpool, 0, NULL, + (opal_free_list_item_init_fn_t) mca_btl_ugni_frag_init, + (void *) ugni_module); if (OPAL_UNLIKELY(OPAL_SUCCESS != rc)) { BTL_ERROR(("error creating eager send fragment free list")); return rc; } - rc = ompi_free_list_init_ex_new (&ugni_module->eager_frags_recv, - sizeof (mca_btl_ugni_eager_frag_t), 8, - OBJ_CLASS(mca_btl_ugni_eager_frag_t), - ugni_module->super.btl_eager_limit, 64, - mca_btl_ugni_component.ugni_eager_num, - mca_btl_ugni_component.ugni_eager_max, - mca_btl_ugni_component.ugni_eager_inc, - ugni_module->super.btl_mpool, - (ompi_free_list_item_init_fn_t) mca_btl_ugni_frag_init, - (void *) ugni_module); + rc = opal_free_list_init (&ugni_module->eager_frags_recv, + sizeof (mca_btl_ugni_eager_frag_t), 8, + OBJ_CLASS(mca_btl_ugni_eager_frag_t), + ugni_module->super.btl_eager_limit, 64, + mca_btl_ugni_component.ugni_eager_num, + mca_btl_ugni_component.ugni_eager_max, + mca_btl_ugni_component.ugni_eager_inc, + ugni_module->super.btl_mpool, 0, NULL, + (opal_free_list_item_init_fn_t) mca_btl_ugni_frag_init, + (void *) ugni_module); if (OPAL_UNLIKELY(OPAL_SUCCESS != rc)) { BTL_ERROR(("error creating eager receive fragment free list")); return rc; @@ -440,21 +440,21 @@ mca_btl_ugni_setup_mpools (mca_btl_ugni_module_t *ugni_module) mbox_increment = mca_btl_ugni_component.mbox_increment; } - rc = ompi_free_list_init_new (&ugni_module->smsg_mboxes, - sizeof (mca_btl_ugni_smsg_mbox_t), 8, - OBJ_CLASS(mca_btl_ugni_smsg_mbox_t), - mca_btl_ugni_component.smsg_mbox_size, 128, - 32, -1, mbox_increment, - ugni_module->smsg_mpool); + rc = opal_free_list_init (&ugni_module->smsg_mboxes, + sizeof (mca_btl_ugni_smsg_mbox_t), 8, + OBJ_CLASS(mca_btl_ugni_smsg_mbox_t), + mca_btl_ugni_component.smsg_mbox_size, 128, + 32, -1, mbox_increment, ugni_module->smsg_mpool, + 0, NULL, NULL, NULL); if (OPAL_UNLIKELY(OPAL_SUCCESS != rc)) { BTL_ERROR(("error creating smsg mailbox free list")); return rc; } - rc = ompi_free_list_init_new (&ugni_module->post_descriptors, - sizeof (mca_btl_ugni_post_descriptor_t), - 8, OBJ_CLASS(mca_btl_ugni_post_descriptor_t), - 0, 0, 0, -1, 256, NULL); + rc = opal_free_list_init (&ugni_module->post_descriptors, + sizeof (mca_btl_ugni_post_descriptor_t), + 8, OBJ_CLASS(mca_btl_ugni_post_descriptor_t), + 0, 0, 0, -1, 256, NULL, 0, NULL, NULL, NULL); if (OPAL_UNLIKELY(OPAL_SUCCESS != rc)) { BTL_ERROR(("error creating post descriptor free list")); return rc; diff --git a/opal/mca/btl/ugni/btl_ugni_endpoint.c b/opal/mca/btl/ugni/btl_ugni_endpoint.c index df2a81bf84..49551f8a8d 100644 --- a/opal/mca/btl/ugni/btl_ugni_endpoint.c +++ b/opal/mca/btl/ugni/btl_ugni_endpoint.c @@ -1,6 +1,6 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* - * Copyright (c) 2011-2014 Los Alamos National Security, LLC. All rights + * Copyright (c) 2011-2015 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2011-2013 UT-Battelle, LLC. All rights reserved. * $COPYRIGHT$ @@ -31,9 +31,9 @@ OBJ_CLASS_INSTANCE(mca_btl_ugni_endpoint_t, opal_list_item_t, static inline int mca_btl_ugni_ep_smsg_get_mbox (mca_btl_base_endpoint_t *ep) { mca_btl_ugni_module_t *ugni_module = ep->btl; - ompi_free_list_item_t *mbox; + opal_free_list_item_t *mbox; - OMPI_FREE_LIST_GET_MT(&ugni_module->smsg_mboxes, mbox); + mbox = opal_free_list_get (&ugni_module->smsg_mboxes); if (OPAL_UNLIKELY(NULL == mbox)) { return OPAL_ERR_OUT_OF_RESOURCE; } @@ -76,7 +76,7 @@ int mca_btl_ugni_ep_disconnect (mca_btl_base_endpoint_t *ep, bool send_disconnec OPAL_THREAD_UNLOCK(&ep->common->dev->dev_lock); if (ep->mailbox) { - OMPI_FREE_LIST_RETURN_MT(&ep->btl->smsg_mboxes, ((ompi_free_list_item_t *) ep->mailbox)); + opal_free_list_return (&ep->btl->smsg_mboxes, ((opal_free_list_item_t *) ep->mailbox)); ep->mailbox = NULL; } diff --git a/opal/mca/btl/ugni/btl_ugni_frag.c b/opal/mca/btl/ugni/btl_ugni_frag.c index 024a42b65c..a576c0c521 100644 --- a/opal/mca/btl/ugni/btl_ugni_frag.c +++ b/opal/mca/btl/ugni/btl_ugni_frag.c @@ -38,10 +38,11 @@ OBJ_CLASS_INSTANCE(mca_btl_ugni_rdma_frag_t, mca_btl_base_descriptor_t, OBJ_CLASS_INSTANCE(mca_btl_ugni_eager_frag_t, mca_btl_base_descriptor_t, mca_btl_ugni_eager_frag_constructor, NULL); -OBJ_CLASS_INSTANCE(mca_btl_ugni_post_descriptor_t, ompi_free_list_item_t, +OBJ_CLASS_INSTANCE(mca_btl_ugni_post_descriptor_t, opal_free_list_item_t, NULL, NULL); -void mca_btl_ugni_frag_init (mca_btl_ugni_base_frag_t *frag, mca_btl_ugni_module_t *ugni_module) +int mca_btl_ugni_frag_init (mca_btl_ugni_base_frag_t *frag, mca_btl_ugni_module_t *ugni_module) { frag->msg_id = opal_pointer_array_add (&ugni_module->pending_smsg_frags_bb, (void *) frag); + return OPAL_SUCCESS; } diff --git a/opal/mca/btl/ugni/btl_ugni_frag.h b/opal/mca/btl/ugni/btl_ugni_frag.h index 543e71237a..ee47492741 100644 --- a/opal/mca/btl/ugni/btl_ugni_frag.h +++ b/opal/mca/btl/ugni/btl_ugni_frag.h @@ -74,7 +74,7 @@ typedef struct mca_btl_ugni_base_frag_t { opal_common_ugni_post_desc_t post_desc; mca_btl_base_endpoint_t *endpoint; mca_btl_ugni_reg_t *registration; - ompi_free_list_t *my_list; + opal_free_list_t *my_list; mca_btl_base_registration_handle_t memory_handle; } mca_btl_ugni_base_frag_t; @@ -86,7 +86,7 @@ typedef struct mca_btl_ugni_base_frag_t mca_btl_ugni_eager_frag_t; ((mca_btl_ugni_base_frag_t *)((uintptr_t) (desc) - offsetof (mca_btl_ugni_base_frag_t, post_desc))) typedef struct mca_btl_ugni_post_descriptor_t { - ompi_free_list_item_t super; + opal_free_list_item_t super; opal_common_ugni_post_desc_t desc; mca_btl_base_endpoint_t *endpoint; mca_btl_base_registration_handle_t *local_handle; @@ -104,11 +104,8 @@ static inline void mca_btl_ugni_alloc_post_descriptor (mca_btl_base_endpoint_t * mca_btl_base_rdma_completion_fn_t cbfunc, void *cbcontext, void *cbdata, mca_btl_ugni_post_descriptor_t **desc) { - ompi_free_list_item_t *item = NULL; - - OMPI_FREE_LIST_GET_MT(&endpoint->btl->post_descriptors, item); - *desc = (mca_btl_ugni_post_descriptor_t *) item; - if (NULL != item) { + *desc = (mca_btl_ugni_post_descriptor_t *) opal_free_list_get (&endpoint->btl->post_descriptors); + if (NULL != *desc) { (*desc)->cbfunc = cbfunc; (*desc)->ctx = cbcontext; (*desc)->cbdata = cbdata; @@ -120,7 +117,7 @@ static inline void mca_btl_ugni_alloc_post_descriptor (mca_btl_base_endpoint_t * static inline void mca_btl_ugni_return_post_descriptor (mca_btl_ugni_module_t *module, mca_btl_ugni_post_descriptor_t *desc) { - OMPI_FREE_LIST_RETURN_MT(&module->post_descriptors, &desc->super); + opal_free_list_return (&module->post_descriptors, &desc->super); } static inline void mca_btl_ugni_post_desc_complete (mca_btl_ugni_module_t *module, mca_btl_ugni_post_descriptor_t *desc, int rc) @@ -144,14 +141,11 @@ OBJ_CLASS_DECLARATION(mca_btl_ugni_eager_frag_t); void mca_btl_ugni_frag_init (mca_btl_ugni_base_frag_t *frag, mca_btl_ugni_module_t *ugni_module); static inline int mca_btl_ugni_frag_alloc (mca_btl_base_endpoint_t *ep, - ompi_free_list_t *list, + opal_free_list_t *list, mca_btl_ugni_base_frag_t **frag) { - ompi_free_list_item_t *item = NULL; - - OMPI_FREE_LIST_GET_MT(list, item); - *frag = (mca_btl_ugni_base_frag_t *) item; - if (OPAL_LIKELY(NULL != item)) { + *frag = (mca_btl_ugni_base_frag_t *) opal_free_list_get (*frag); + if (OPAL_LIKELY(NULL != *frag)) { (*frag)->my_list = list; (*frag)->endpoint = ep; return OPAL_SUCCESS; @@ -170,7 +164,7 @@ static inline int mca_btl_ugni_frag_return (mca_btl_ugni_base_frag_t *frag) frag->flags = 0; - OMPI_FREE_LIST_RETURN_MT(frag->my_list, (ompi_free_list_item_t *) frag); + opal_free_list_return (frag->my_list, (opal_free_list_item_t *) frag); return OPAL_SUCCESS; } diff --git a/opal/mca/btl/ugni/btl_ugni_module.c b/opal/mca/btl/ugni/btl_ugni_module.c index 9161d653f0..4977659fc1 100644 --- a/opal/mca/btl/ugni/btl_ugni_module.c +++ b/opal/mca/btl/ugni/btl_ugni_module.c @@ -83,20 +83,20 @@ mca_btl_ugni_module_init (mca_btl_ugni_module_t *ugni_module, OBJ_CONSTRUCT(&ugni_module->eager_get_pending, opal_list_t); OBJ_CONSTRUCT(&ugni_module->eager_get_pending_lock,opal_mutex_t); - OBJ_CONSTRUCT(&ugni_module->eager_frags_send, ompi_free_list_t); - OBJ_CONSTRUCT(&ugni_module->eager_frags_recv, ompi_free_list_t); - OBJ_CONSTRUCT(&ugni_module->smsg_frags, ompi_free_list_t); - OBJ_CONSTRUCT(&ugni_module->rdma_frags, ompi_free_list_t); - OBJ_CONSTRUCT(&ugni_module->rdma_int_frags, ompi_free_list_t); + OBJ_CONSTRUCT(&ugni_module->eager_frags_send, opal_free_list_t); + OBJ_CONSTRUCT(&ugni_module->eager_frags_recv, opal_free_list_t); + OBJ_CONSTRUCT(&ugni_module->smsg_frags, opal_free_list_t); + OBJ_CONSTRUCT(&ugni_module->rdma_frags, opal_free_list_t); + OBJ_CONSTRUCT(&ugni_module->rdma_int_frags, opal_free_list_t); OBJ_CONSTRUCT(&ugni_module->pending_smsg_frags_bb, opal_pointer_array_t); OBJ_CONSTRUCT(&ugni_module->ep_wait_list_lock,opal_mutex_t); OBJ_CONSTRUCT(&ugni_module->ep_wait_list, opal_list_t); OBJ_CONSTRUCT(&ugni_module->endpoints, opal_pointer_array_t); OBJ_CONSTRUCT(&ugni_module->id_to_endpoint, opal_hash_table_t); - OBJ_CONSTRUCT(&ugni_module->smsg_mboxes, ompi_free_list_t); + OBJ_CONSTRUCT(&ugni_module->smsg_mboxes, opal_free_list_t); OBJ_CONSTRUCT(&ugni_module->pending_descriptors, opal_list_t); OBJ_CONSTRUCT(&ugni_module->eager_get_pending, opal_list_t); - OBJ_CONSTRUCT(&ugni_module->post_descriptors, ompi_free_list_t); + OBJ_CONSTRUCT(&ugni_module->post_descriptors, opal_free_list_t); ugni_module->device = dev; dev->btl_ctx = (void *) ugni_module; diff --git a/opal/mca/btl/ugni/btl_ugni_smsg.c b/opal/mca/btl/ugni/btl_ugni_smsg.c index cd857f96f8..f4f255edfb 100644 --- a/opal/mca/btl/ugni/btl_ugni_smsg.c +++ b/opal/mca/btl/ugni/btl_ugni_smsg.c @@ -31,7 +31,7 @@ static void mca_btl_ugni_smsg_mbox_construct (mca_btl_ugni_smsg_mbox_t *mbox) { mbox->attr.rmt_irq_mem_hndl = mca_btl_ugni_component.modules[0].device->smsg_irq_mhndl; } -OBJ_CLASS_INSTANCE(mca_btl_ugni_smsg_mbox_t, ompi_free_list_item_t, +OBJ_CLASS_INSTANCE(mca_btl_ugni_smsg_mbox_t, opal_free_list_item_t, mca_btl_ugni_smsg_mbox_construct, NULL); diff --git a/opal/mca/btl/ugni/btl_ugni_smsg.h b/opal/mca/btl/ugni/btl_ugni_smsg.h index 2a191a2eee..7746e798a4 100644 --- a/opal/mca/btl/ugni/btl_ugni_smsg.h +++ b/opal/mca/btl/ugni/btl_ugni_smsg.h @@ -26,7 +26,7 @@ typedef enum { } mca_btl_ugni_smsg_tag_t; typedef struct mca_btl_ugni_smsg_mbox_t { - ompi_free_list_item_t super; + opal_free_list_item_t super; mca_btl_ugni_endpoint_attr_t attr; } mca_btl_ugni_smsg_mbox_t; diff --git a/opal/mca/btl/vader/btl_vader.h b/opal/mca/btl/vader/btl_vader.h index 8bc7f529f0..bbaaf7eb6c 100644 --- a/opal/mca/btl/vader/btl_vader.h +++ b/opal/mca/btl/vader/btl_vader.h @@ -112,9 +112,9 @@ struct mca_btl_vader_component_t { size_t segment_size; /**< size of my_segment */ size_t segment_offset; /**< start of unused portion of my_segment */ int32_t num_smp_procs; /**< current number of smp procs on this host */ - ompi_free_list_t vader_frags_eager; /**< free list of vader send frags */ - ompi_free_list_t vader_frags_max_send; /**< free list of vader max send frags (large fragments) */ - ompi_free_list_t vader_frags_user; /**< free list of small inline frags */ + opal_free_list_t vader_frags_eager; /**< free list of vader send frags */ + opal_free_list_t vader_frags_max_send; /**< free list of vader max send frags (large fragments) */ + opal_free_list_t vader_frags_user; /**< free list of small inline frags */ unsigned int fbox_threshold; /**< number of sends required before we setup a send fast box for a peer */ unsigned int fbox_max; /**< maximum number of send fast boxes to allocate */ diff --git a/opal/mca/btl/vader/btl_vader_component.c b/opal/mca/btl/vader/btl_vader_component.c index 5f55dc914b..646f4f4fa3 100644 --- a/opal/mca/btl/vader/btl_vader_component.c +++ b/opal/mca/btl/vader/btl_vader_component.c @@ -268,9 +268,9 @@ static int mca_btl_vader_component_register (void) static int mca_btl_vader_component_open(void) { /* initialize objects */ - OBJ_CONSTRUCT(&mca_btl_vader_component.vader_frags_eager, ompi_free_list_t); - OBJ_CONSTRUCT(&mca_btl_vader_component.vader_frags_user, ompi_free_list_t); - OBJ_CONSTRUCT(&mca_btl_vader_component.vader_frags_max_send, ompi_free_list_t); + OBJ_CONSTRUCT(&mca_btl_vader_component.vader_frags_eager, opal_free_list_t); + OBJ_CONSTRUCT(&mca_btl_vader_component.vader_frags_user, opal_free_list_t); + OBJ_CONSTRUCT(&mca_btl_vader_component.vader_frags_max_send, opal_free_list_t); OBJ_CONSTRUCT(&mca_btl_vader_component.lock, opal_mutex_t); OBJ_CONSTRUCT(&mca_btl_vader_component.pending_endpoints, opal_list_t); OBJ_CONSTRUCT(&mca_btl_vader_component.pending_fragments, opal_list_t); diff --git a/opal/mca/btl/vader/btl_vader_frag.c b/opal/mca/btl/vader/btl_vader_frag.c index b39f5fb3c3..0cd45e1029 100644 --- a/opal/mca/btl/vader/btl_vader_frag.c +++ b/opal/mca/btl/vader/btl_vader_frag.c @@ -11,7 +11,7 @@ * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * Copyright (c) 2009 Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2011-2013 Los Alamos National Security, LLC. All rights + * Copyright (c) 2011-2015 Los Alamos National Security, LLC. All rights * reserved. * $COPYRIGHT$ * @@ -39,7 +39,7 @@ static inline void mca_btl_vader_frag_constructor (mca_btl_vader_frag_t *frag) frag->fbox = NULL; } -void mca_btl_vader_frag_init (ompi_free_list_item_t *item, void *ctx) +int mca_btl_vader_frag_init (opal_free_list_item_t *item, void *ctx) { mca_btl_vader_frag_t *frag = (mca_btl_vader_frag_t *) item; unsigned int data_size = (unsigned int)(uintptr_t) ctx; @@ -52,13 +52,12 @@ void mca_btl_vader_frag_init (ompi_free_list_item_t *item, void *ctx) if (data_size && mca_btl_vader_component.segment_size < mca_btl_vader_component.segment_offset + frag_size) { OPAL_THREAD_UNLOCK(&mca_btl_vader_component.lock); - item->ptr = NULL; - return; + return OPAL_ERR_OUT_OF_RESOURCE; } /* Set the list element here so we don't have to set it on the critical path. This only * works if each free list has its own unique fragment size and ALL free lists are initialized - * with ompi_free_list_init_ex_new. */ + * with opal_free_list_init. */ if (mca_btl_vader_component.max_inline_send == data_size) { frag->my_list = &mca_btl_vader_component.vader_frags_user; } else if (mca_btl_vader.super.btl_eager_limit == data_size) { @@ -75,6 +74,8 @@ void mca_btl_vader_frag_init (ompi_free_list_item_t *item, void *ctx) OPAL_THREAD_UNLOCK(&mca_btl_vader_component.lock); mca_btl_vader_frag_constructor ((mca_btl_vader_frag_t *) item); + + return OPAL_SUCCESS; } OBJ_CLASS_INSTANCE(mca_btl_vader_frag_t, mca_btl_base_descriptor_t, diff --git a/opal/mca/btl/vader/btl_vader_frag.h b/opal/mca/btl/vader/btl_vader_frag.h index 2c6e5c9091..e89e87aba8 100644 --- a/opal/mca/btl/vader/btl_vader_frag.h +++ b/opal/mca/btl/vader/btl_vader_frag.h @@ -12,7 +12,7 @@ * All rights reserved. * Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved. * Copyright (c) 2009 Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2011-2014 Los Alamos National Security, LLC. All rights + * Copyright (c) 2011-2015 Los Alamos National Security, LLC. All rights * reserved. * $COPYRIGHT$ * @@ -72,24 +72,15 @@ struct mca_btl_vader_frag_t { /** fragment header (in the shared memory region) */ mca_btl_vader_hdr_t *hdr; /** free list this fragment was allocated within */ - ompi_free_list_t *my_list; + opal_free_list_t *my_list; }; typedef struct mca_btl_vader_frag_t mca_btl_vader_frag_t; -static inline int mca_btl_vader_frag_alloc (mca_btl_vader_frag_t **frag, ompi_free_list_t *list, +static inline int mca_btl_vader_frag_alloc (mca_btl_vader_frag_t **frag, opal_free_list_t *list, struct mca_btl_base_endpoint_t *endpoint) { - ompi_free_list_item_t *item; - - OMPI_FREE_LIST_GET_MT(list, item); - *frag = (mca_btl_vader_frag_t *) item; - if (OPAL_LIKELY(NULL != item)) { - if (OPAL_UNLIKELY(NULL == (*frag)->hdr)) { - OMPI_FREE_LIST_RETURN_MT(list, item); - *frag = NULL; - return OPAL_ERR_TEMP_OUT_OF_RESOURCE; - } - + *frag = (mca_btl_vader_frag_t *) opal_free_list_get (list); + if (OPAL_LIKELY(NULL != *frag)) { (*frag)->endpoint = endpoint; } @@ -106,7 +97,7 @@ static inline void mca_btl_vader_frag_return (mca_btl_vader_frag_t *frag) frag->base.des_segment_count = 1; frag->fbox = NULL; - OMPI_FREE_LIST_RETURN_MT(frag->my_list, (ompi_free_list_item_t *)frag); + opal_free_list_return (frag->my_list, (opal_free_list_item_t *)frag); } OBJ_CLASS_DECLARATION(mca_btl_vader_frag_t); @@ -134,6 +125,6 @@ static inline void mca_btl_vader_frag_complete (mca_btl_vader_frag_t *frag) { } } -void mca_btl_vader_frag_init (ompi_free_list_item_t *item, void *ctx); +int mca_btl_vader_frag_init (opal_free_list_item_t *item, void *ctx); #endif /* MCA_BTL_VADER_SEND_FRAG_H */ diff --git a/opal/mca/btl/vader/btl_vader_module.c b/opal/mca/btl/vader/btl_vader_module.c index aab71458b4..deec2ed4f4 100644 --- a/opal/mca/btl/vader/btl_vader_module.c +++ b/opal/mca/btl/vader/btl_vader_module.c @@ -12,7 +12,7 @@ * All rights reserved. * Copyright (c) 2006-2007 Voltaire. All rights reserved. * Copyright (c) 2009 Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2010-2014 Los Alamos National Security, LLC. All rights + * Copyright (c) 2010-2015 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2014 Intel, Inc. All rights reserved. * Copyright (c) 2014-2015 Research Organization for Information Science @@ -101,44 +101,44 @@ static int vader_btl_first_time_init(mca_btl_vader_t *vader_btl, int n) /* initialize fragment descriptor free lists */ /* initialize free list for small send and inline fragments */ - rc = ompi_free_list_init_ex_new(&component->vader_frags_user, - sizeof(mca_btl_vader_frag_t), - opal_cache_line_size, OBJ_CLASS(mca_btl_vader_frag_t), - 0, opal_cache_line_size, - component->vader_free_list_num, - component->vader_free_list_max, - component->vader_free_list_inc, - NULL, mca_btl_vader_frag_init, - (void *)(intptr_t) mca_btl_vader_component.max_inline_send); + rc = opal_free_list_init (&component->vader_frags_user, + sizeof(mca_btl_vader_frag_t), + opal_cache_line_size, OBJ_CLASS(mca_btl_vader_frag_t), + 0, opal_cache_line_size, + component->vader_free_list_num, + component->vader_free_list_max, + component->vader_free_list_inc, + NULL, 0, NULL, mca_btl_vader_frag_init, + (void *)(intptr_t) mca_btl_vader_component.max_inline_send); if (OPAL_SUCCESS != rc) { return rc; } /* initialize free list for buffered send fragments */ - rc = ompi_free_list_init_ex_new(&component->vader_frags_eager, - sizeof (mca_btl_vader_frag_t), - opal_cache_line_size, OBJ_CLASS(mca_btl_vader_frag_t), - 0, opal_cache_line_size, - component->vader_free_list_num, - component->vader_free_list_max, - component->vader_free_list_inc, - NULL, mca_btl_vader_frag_init, - (void *)(intptr_t) mca_btl_vader.super.btl_eager_limit); + rc = opal_free_list_init (&component->vader_frags_eager, + sizeof (mca_btl_vader_frag_t), + opal_cache_line_size, OBJ_CLASS(mca_btl_vader_frag_t), + 0, opal_cache_line_size, + component->vader_free_list_num, + component->vader_free_list_max, + component->vader_free_list_inc, + NULL, 0, NULL, mca_btl_vader_frag_init, + (void *)(intptr_t) mca_btl_vader.super.btl_eager_limit); if (OPAL_SUCCESS != rc) { return rc; } if (MCA_BTL_VADER_XPMEM != mca_btl_vader_component.single_copy_mechanism) { /* initialize free list for buffered send fragments */ - rc = ompi_free_list_init_ex_new(&component->vader_frags_max_send, - sizeof (mca_btl_vader_frag_t), - opal_cache_line_size, OBJ_CLASS(mca_btl_vader_frag_t), - 0, opal_cache_line_size, - component->vader_free_list_num, - component->vader_free_list_max, - component->vader_free_list_inc, - NULL, mca_btl_vader_frag_init, - (void *)(intptr_t) mca_btl_vader.super.btl_max_send_size); + rc = opal_free_list_init (&component->vader_frags_max_send, + sizeof (mca_btl_vader_frag_t), + opal_cache_line_size, OBJ_CLASS(mca_btl_vader_frag_t), + 0, opal_cache_line_size, + component->vader_free_list_num, + component->vader_free_list_max, + component->vader_free_list_inc, + NULL, 0, NULL, mca_btl_vader_frag_init, + (void *)(intptr_t) mca_btl_vader.super.btl_max_send_size); if (OPAL_SUCCESS != rc) { return rc; } diff --git a/opal/mca/common/ofacm/common_ofacm_base.c b/opal/mca/common/ofacm/common_ofacm_base.c index 25c41281fa..b3af7aa436 100644 --- a/opal/mca/common/ofacm/common_ofacm_base.c +++ b/opal/mca/common/ofacm/common_ofacm_base.c @@ -1,3 +1,4 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2007-2013 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2007-2012 Mellanox Technologies. All rights reserved. @@ -6,6 +7,8 @@ * Copyright (c) 2013 Intel, Inc. All rights reserved * Copyright (c) 2014 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -584,7 +587,7 @@ opal_common_ofacm_base_get_cpc_byindex(uint8_t index) #if 0 int opal_common_ofacm_base_alloc_cts(mca_btl_base_endpoint_t *endpoint) { - ompi_free_list_item_t *fli; + opal_free_list_item_t *fli; int length = sizeof(mca_btl_openib_header_t) + sizeof(mca_btl_openib_header_coalesced_t) + sizeof(mca_btl_openib_control_header_t) + diff --git a/opal/mca/mpool/base/mpool_base_alloc.c b/opal/mca/mpool/base/mpool_base_alloc.c index af3196f98c..6a253d2d87 100644 --- a/opal/mca/mpool/base/mpool_base_alloc.c +++ b/opal/mca/mpool/base/mpool_base_alloc.c @@ -1,3 +1,4 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology @@ -11,6 +12,8 @@ * All rights reserved. * Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved. * Copyright (c) 2010 IBM Corporation. All rights reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -66,7 +69,7 @@ static void mca_mpool_base_registration_destructor( mca_mpool_base_registration_ OBJ_CLASS_INSTANCE( mca_mpool_base_registration_t, - ompi_free_list_item_t, + opal_free_list_item_t, mca_mpool_base_registration_constructor, mca_mpool_base_registration_destructor); diff --git a/opal/mca/mpool/base/mpool_base_tree.c b/opal/mca/mpool/base/mpool_base_tree.c index 9cc2b6bd2d..55ec0dbb13 100644 --- a/opal/mca/mpool/base/mpool_base_tree.c +++ b/opal/mca/mpool/base/mpool_base_tree.c @@ -1,3 +1,4 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology @@ -12,7 +13,7 @@ * Copyright (c) 2007 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2007 Voltaire. All rights reserved. * Copyright (c) 2010 IBM Corporation. All rights reserved. - * Copyright (c) 2012 Los Alamos National Security, LLC. + * Copyright (c) 2012-2015 Los Alamos National Security, LLC. * All rights reserved. * $COPYRIGHT$ * @@ -31,7 +32,6 @@ #include "opal/util/show_help.h" #include "opal/util/proc.h" -#include "opal/class/ompi_free_list.h" #include "opal/class/opal_rb_tree.h" #include "mpool_base_tree.h" @@ -43,13 +43,13 @@ static char *leak_msg = NULL; static int condition(void *value); static void action(void *key, void *value); -OBJ_CLASS_INSTANCE(mca_mpool_base_tree_item_t, ompi_free_list_item_t, NULL, NULL); +OBJ_CLASS_INSTANCE(mca_mpool_base_tree_item_t, opal_free_list_item_t, NULL, NULL); /* * use globals for the tree and the tree_item free list.. */ opal_rb_tree_t mca_mpool_base_tree; -ompi_free_list_t mca_mpool_base_tree_item_free_list; +opal_free_list_t mca_mpool_base_tree_item_free_list; static opal_mutex_t tree_lock; /* @@ -77,14 +77,14 @@ int mca_mpool_base_tree_node_compare(void * key1, void * key2) int mca_mpool_base_tree_init(void) { int rc; OBJ_CONSTRUCT(&mca_mpool_base_tree, opal_rb_tree_t); - OBJ_CONSTRUCT(&mca_mpool_base_tree_item_free_list, ompi_free_list_t); + OBJ_CONSTRUCT(&mca_mpool_base_tree_item_free_list, opal_free_list_t); OBJ_CONSTRUCT(&tree_lock, opal_mutex_t); - rc = ompi_free_list_init_new(&mca_mpool_base_tree_item_free_list, + rc = opal_free_list_init (&mca_mpool_base_tree_item_free_list, sizeof(mca_mpool_base_tree_item_t), opal_cache_line_size, OBJ_CLASS(mca_mpool_base_tree_item_t), 0,opal_cache_line_size, - 0, -1 , 4, NULL); + 0, -1 , 4, NULL, 0, NULL, NULL, NULL); if(OPAL_SUCCESS == rc) { rc = opal_rb_tree_init(&mca_mpool_base_tree, mca_mpool_base_tree_node_compare); } @@ -153,21 +153,16 @@ mca_mpool_base_tree_item_t* mca_mpool_base_tree_find(void* base) { * get a tree item from the free list */ mca_mpool_base_tree_item_t* mca_mpool_base_tree_item_get(void) { - ompi_free_list_item_t* item = NULL; - OMPI_FREE_LIST_GET_MT(&mca_mpool_base_tree_item_free_list, item); - if(NULL != item) { - return (mca_mpool_base_tree_item_t*) item; - } else { - return NULL; - } + return (mca_mpool_base_tree_item_t *) + opal_free_list_get (&mca_mpool_base_tree_item_free_list); } /* * put an item back into the free list */ void mca_mpool_base_tree_item_put(mca_mpool_base_tree_item_t* item) { - OMPI_FREE_LIST_RETURN_MT(&mca_mpool_base_tree_item_free_list, - &(item->super)); + opal_free_list_return (&mca_mpool_base_tree_item_free_list, + &item->super); } diff --git a/opal/mca/mpool/base/mpool_base_tree.h b/opal/mca/mpool/base/mpool_base_tree.h index 4ed707d4e4..0742f44867 100644 --- a/opal/mca/mpool/base/mpool_base_tree.h +++ b/opal/mca/mpool/base/mpool_base_tree.h @@ -1,3 +1,4 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology @@ -10,6 +11,8 @@ * Copyright (c) 2004-2006 The Regents of the University of California. * All rights reserved. * Copyright (c) 2007 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -24,7 +27,6 @@ #define MCA_MPOOL_BASE_TREE_MAX 8 #include "opal/mca/mca.h" -#include "opal/class/ompi_free_list.h" #include "opal/mca/mpool/mpool.h" BEGIN_C_DECLS @@ -39,7 +41,7 @@ BEGIN_C_DECLS */ struct mca_mpool_base_tree_item_t { - ompi_free_list_item_t super; /**< the parent class */ + opal_free_list_item_t super; /**< the parent class */ void* key; /**< the address this was alloc'd on */ size_t num_bytes; /**< the number of bytes in this alloc, only for debugging reporting with diff --git a/opal/mca/mpool/gpusm/mpool_gpusm.h b/opal/mca/mpool/gpusm/mpool_gpusm.h index 3d20f40163..c36752bc6e 100644 --- a/opal/mca/mpool/gpusm/mpool_gpusm.h +++ b/opal/mca/mpool/gpusm/mpool_gpusm.h @@ -1,3 +1,4 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology @@ -11,6 +12,8 @@ * All rights reserved. * Copyright (c) 2006 Voltaire. All rights reserved. * Copyright (c) 2012 NVIDIA Corporation. All rights reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. * * $COPYRIGHT$ * @@ -26,7 +29,6 @@ #include "opal_config.h" #include "opal/class/opal_list.h" -#include "opal/class/ompi_free_list.h" #include "opal/mca/mpool/mpool.h" BEGIN_C_DECLS @@ -61,7 +63,7 @@ typedef struct mca_mpool_base_resources_t mca_mpool_base_resources_t; struct mca_mpool_gpusm_module_t { mca_mpool_base_module_t super; struct mca_mpool_base_resources_t resources; - ompi_free_list_t reg_list; + opal_free_list_t reg_list; }; typedef struct mca_mpool_gpusm_module_t mca_mpool_gpusm_module_t; /* diff --git a/opal/mca/mpool/gpusm/mpool_gpusm_module.c b/opal/mca/mpool/gpusm/mpool_gpusm_module.c index a91d63e533..70598143c8 100644 --- a/opal/mca/mpool/gpusm/mpool_gpusm_module.c +++ b/opal/mca/mpool/gpusm/mpool_gpusm_module.c @@ -1,3 +1,4 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology @@ -14,6 +15,8 @@ * Copyright (c) 2007 Mellanox Technologies. All rights reserved. * Copyright (c) 2010 IBM Corporation. All rights reserved. * Copyright (c) 2012 NVIDIA Corporation. All rights reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. * * $COPYRIGHT$ * @@ -85,16 +88,16 @@ void mca_mpool_gpusm_module_init(mca_mpool_gpusm_module_t* mpool) mpool->resources.register_mem = cuda_getmemhandle; mpool->resources.deregister_mem = cuda_ungetmemhandle; - OBJ_CONSTRUCT(&mpool->reg_list, ompi_free_list_t); + OBJ_CONSTRUCT(&mpool->reg_list, opal_free_list_t); /* Start with 0 entries in the free list since CUDA may not have * been initialized when this free list is created and there is * some CUDA specific activities that need to be done. */ - ompi_free_list_init_new(&mpool->reg_list, mpool->resources.sizeof_reg, + opal_free_list_init (&mpool->reg_list, mpool->resources.sizeof_reg, opal_cache_line_size, OBJ_CLASS(mca_mpool_gpusm_registration_t), 0,opal_cache_line_size, - 0, -1, 64, NULL); + 0, -1, 64, NULL, 0, NULL, NULL, NULL); } @@ -121,7 +124,7 @@ int mca_mpool_gpusm_register(mca_mpool_base_module_t *mpool, void *addr, { mca_mpool_gpusm_module_t *mpool_gpusm = (mca_mpool_gpusm_module_t*)mpool; mca_mpool_base_registration_t *gpusm_reg; - ompi_free_list_item_t *item; + opal_free_list_item_t *item; unsigned char *base, *bound; int rc; @@ -134,7 +137,7 @@ int mca_mpool_gpusm_register(mca_mpool_base_module_t *mpool, void *addr, base = addr; bound = (unsigned char *)addr + size - 1; - OMPI_FREE_LIST_GET_MT(&mpool_gpusm->reg_list, item); + item = opal_free_list_get (&mpool_gpusm->reg_list); if(NULL == item) { return OPAL_ERR_OUT_OF_RESOURCE; } @@ -148,7 +151,7 @@ int mca_mpool_gpusm_register(mca_mpool_base_module_t *mpool, void *addr, rc = mpool_gpusm->resources.register_mem(base, size, gpusm_reg, NULL); if(rc != OPAL_SUCCESS) { - OMPI_FREE_LIST_RETURN_MT(&mpool_gpusm->reg_list, item); + opal_free_list_return (&mpool_gpusm->reg_list, item); return rc; } @@ -168,7 +171,7 @@ int mca_mpool_gpusm_deregister(struct mca_mpool_base_module_t *mpool, mca_mpool_gpusm_module_t *mpool_gpusm = (mca_mpool_gpusm_module_t *)mpool; rc = mpool_gpusm->resources.deregister_mem(mpool, reg); - OMPI_FREE_LIST_RETURN_MT(&mpool_gpusm->reg_list, (ompi_free_list_item_t*)reg); + opal_free_list_return (&mpool_gpusm->reg_list, (opal_free_list_item_t *) reg); return OPAL_SUCCESS; } @@ -177,13 +180,13 @@ int mca_mpool_gpusm_deregister(struct mca_mpool_base_module_t *mpool, */ void mca_mpool_gpusm_finalize(struct mca_mpool_base_module_t *mpool) { - ompi_free_list_item_t *item; + opal_free_list_item_t *item; mca_mpool_gpusm_module_t *mpool_gpusm = (mca_mpool_gpusm_module_t *)mpool; /* Need to run the destructor on each item in the free list explicitly. * The destruction of the free list only runs the destructor on the * main free list, not each item. */ - while (NULL != (item = (ompi_free_list_item_t *)opal_lifo_pop(&(mpool_gpusm->reg_list.super)))) { + while (NULL != (item = (opal_free_list_item_t *)opal_lifo_pop(&(mpool_gpusm->reg_list.super)))) { OBJ_DESTRUCT(item); } diff --git a/opal/mca/mpool/grdma/mpool_grdma.h b/opal/mca/mpool/grdma/mpool_grdma.h index 32b0d27a68..4f5362149b 100644 --- a/opal/mca/mpool/grdma/mpool_grdma.h +++ b/opal/mca/mpool/grdma/mpool_grdma.h @@ -11,7 +11,7 @@ * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * Copyright (c) 2006 Voltaire. All rights reserved. - * Copyright (c) 2011-2012 Los Alamos National Security, LLC. All rights + * Copyright (c) 2011-2015 Los Alamos National Security, LLC. All rights * reserved. * * $COPYRIGHT$ @@ -28,7 +28,6 @@ #include "opal_config.h" #include "opal/class/opal_list.h" -#include "opal/class/ompi_free_list.h" #include "opal/mca/event/event.h" #include "opal/mca/mpool/mpool.h" #if HAVE_SYS_MMAN_H @@ -77,7 +76,7 @@ struct mca_mpool_grdma_module_t { mca_mpool_base_module_t super; struct mca_mpool_base_resources_t resources; mca_mpool_grdma_pool_t *pool; - ompi_free_list_t reg_list; + opal_free_list_t reg_list; uint32_t stat_cache_hit; uint32_t stat_cache_miss; uint32_t stat_evicted; diff --git a/opal/mca/mpool/grdma/mpool_grdma_module.c b/opal/mca/mpool/grdma/mpool_grdma_module.c index d6f11d9351..d474dc1c37 100644 --- a/opal/mca/mpool/grdma/mpool_grdma_module.c +++ b/opal/mca/mpool/grdma/mpool_grdma_module.c @@ -14,7 +14,7 @@ * Copyright (c) 2006 Voltaire. All rights reserved. * Copyright (c) 2007 Mellanox Technologies. All rights reserved. * Copyright (c) 2010 IBM Corporation. All rights reserved. - * Copyright (c) 2011-2012 Los Alamos National Security, LLC. All rights + * Copyright (c) 2011-2015 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2013 NVIDIA Corporation. All rights reserved. * @@ -94,11 +94,12 @@ void mca_mpool_grdma_module_init(mca_mpool_grdma_module_t* mpool, mca_mpool_grdm mpool->stat_cache_hit = mpool->stat_cache_miss = mpool->stat_evicted = 0; mpool->stat_cache_found = mpool->stat_cache_notfound = 0; - OBJ_CONSTRUCT(&mpool->reg_list, ompi_free_list_t); - ompi_free_list_init_new(&mpool->reg_list, mpool->resources.sizeof_reg, - opal_cache_line_size, - OBJ_CLASS(mca_mpool_base_registration_t), - 0, opal_cache_line_size, 0, -1, 32, NULL); + OBJ_CONSTRUCT(&mpool->reg_list, opal_free_list_t); + opal_free_list_init (&mpool->reg_list, mpool->resources.sizeof_reg, + opal_cache_line_size, + OBJ_CLASS(mca_mpool_base_registration_t), + 0, opal_cache_line_size, 0, -1, 32, NULL, 0, + NULL, NULL, NULL); } static inline int dereg_mem(mca_mpool_base_registration_t *reg) @@ -116,8 +117,8 @@ static inline int dereg_mem(mca_mpool_base_registration_t *reg) OPAL_THREAD_LOCK(®->mpool->rcache->lock); if (OPAL_LIKELY(OPAL_SUCCESS == rc)) { - OMPI_FREE_LIST_RETURN_MT(&mpool_grdma->reg_list, - (ompi_free_list_item_t *) reg); + opal_free_list_return (&mpool_grdma->reg_list, + (opal_free_list_item_t *) reg); } return rc; @@ -220,7 +221,7 @@ int mca_mpool_grdma_register(mca_mpool_base_module_t *mpool, void *addr, const bool bypass_cache = !!(flags & MCA_MPOOL_FLAGS_CACHE_BYPASS); const bool persist = !!(flags & MCA_MPOOL_FLAGS_PERSIST); mca_mpool_base_registration_t *grdma_reg; - ompi_free_list_item_t *item; + opal_free_list_item_t *item; unsigned char *base, *bound; int rc; @@ -273,7 +274,7 @@ int mca_mpool_grdma_register(mca_mpool_base_module_t *mpool, void *addr, * here is !mca_mpool_grdma_component.leave_pinned. */ } - OMPI_FREE_LIST_GET_MT(&mpool_grdma->reg_list, item); + item = opal_free_list_get (&mpool_grdma->reg_list); if(NULL == item) { OPAL_THREAD_UNLOCK(&mpool->rcache->lock); return OPAL_ERR_OUT_OF_RESOURCE; @@ -295,7 +296,7 @@ int mca_mpool_grdma_register(mca_mpool_base_module_t *mpool, void *addr, if (OPAL_UNLIKELY(rc != OPAL_SUCCESS)) { OPAL_THREAD_UNLOCK(&mpool->rcache->lock); - OMPI_FREE_LIST_RETURN_MT(&mpool_grdma->reg_list, item); + opal_free_list_return (&mpool_grdma->reg_list, item); return rc; } } @@ -314,7 +315,7 @@ int mca_mpool_grdma_register(mca_mpool_base_module_t *mpool, void *addr, mpool->rcache->rcache_delete(mpool->rcache, grdma_reg); } OPAL_THREAD_UNLOCK(&mpool->rcache->lock); - OMPI_FREE_LIST_RETURN_MT(&mpool_grdma->reg_list, item); + opal_free_list_return (&mpool_grdma->reg_list, item); return rc; } diff --git a/opal/mca/mpool/mpool.h b/opal/mca/mpool/mpool.h index f52d31f46e..3d6c1792ce 100644 --- a/opal/mca/mpool/mpool.h +++ b/opal/mca/mpool/mpool.h @@ -1,23 +1,25 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ -/** - * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana - * University Research and Technology - * Corporation. All rights reserved. - * Copyright (c) 2004-2007 The University of Tennessee and The University - * of Tennessee Research Foundation. All rights - * reserved. - * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, - * University of Stuttgart. All rights reserved. - * Copyright (c) 2004-2005 The Regents of the University of California. - * All rights reserved. - * Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved. - * Copyright (c) 2011 NVIDIA Corporation. All rights reserved. - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * $HEADER$ - */ +/* + * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2007 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * University of Stuttgart. All rights reserved. + * Copyright (c) 2004-2005 The Regents of the University of California. + * All rights reserved. + * Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved. + * Copyright (c) 2011 NVIDIA Corporation. All rights reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ /** * @file * Description of the Memory Pool framework @@ -26,7 +28,7 @@ #define MCA_MPOOL_H #include "opal_config.h" #include "opal/mca/mca.h" -#include "opal/class/ompi_free_list.h" +#include "opal/class/opal_free_list.h" #include "opal/mca/crs/crs.h" #include "opal/mca/crs/base/base.h" @@ -50,7 +52,7 @@ struct opal_info_t; struct mca_mpool_base_resources_t; struct mca_mpool_base_registration_t { - ompi_free_list_item_t super; + opal_free_list_item_t super; struct mca_mpool_base_module_t *mpool; unsigned char* base; unsigned char* bound; diff --git a/opal/mca/mpool/rgpusm/mpool_rgpusm.h b/opal/mca/mpool/rgpusm/mpool_rgpusm.h index ae08d34e06..bcca8942ad 100644 --- a/opal/mca/mpool/rgpusm/mpool_rgpusm.h +++ b/opal/mca/mpool/rgpusm/mpool_rgpusm.h @@ -1,3 +1,4 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology @@ -11,6 +12,8 @@ * All rights reserved. * Copyright (c) 2006 Voltaire. All rights reserved. * Copyright (c) 2012 NVIDIA Corporation. All rights reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. * * $COPYRIGHT$ * @@ -26,7 +29,7 @@ #include "opal_config.h" #include "opal/class/opal_list.h" -#include "opal/class/ompi_free_list.h" +#include "opal/class/opal_free_list.h" #include "opal/mca/mpool/mpool.h" BEGIN_C_DECLS @@ -55,7 +58,7 @@ typedef struct mca_mpool_base_resources_t mca_mpool_base_resources_t; struct mca_mpool_rgpusm_module_t { mca_mpool_base_module_t super; struct mca_mpool_base_resources_t resources; - ompi_free_list_t reg_list; + opal_free_list_t reg_list; opal_list_t lru_list; uint32_t stat_cache_hit; uint32_t stat_cache_valid; diff --git a/opal/mca/mpool/rgpusm/mpool_rgpusm_module.c b/opal/mca/mpool/rgpusm/mpool_rgpusm_module.c index 5c470cf329..59c7296b42 100644 --- a/opal/mca/mpool/rgpusm/mpool_rgpusm_module.c +++ b/opal/mca/mpool/rgpusm/mpool_rgpusm_module.c @@ -1,3 +1,4 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology @@ -14,6 +15,8 @@ * Copyright (c) 2007 Mellanox Technologies. All rights reserved. * Copyright (c) 2010 IBM Corporation. All rights reserved. * Copyright (c) 2012-2014 NVIDIA Corporation. All rights reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. * * $COPYRIGHT$ * @@ -121,8 +124,8 @@ static inline bool mca_mpool_rgpusm_deregister_lru (mca_mpool_base_module_t *mpo return false; } - OMPI_FREE_LIST_RETURN_MT(&mpool_rgpusm->reg_list, - (ompi_free_list_item_t*)old_reg); + opal_free_list_return (&mpool_rgpusm->reg_list, + (opal_free_list_item_t*)old_reg); mpool_rgpusm->stat_evicted++; return true; @@ -154,12 +157,12 @@ void mca_mpool_rgpusm_module_init(mca_mpool_rgpusm_module_t* mpool) mpool->resources.register_mem = cuda_openmemhandle; mpool->resources.deregister_mem = cuda_closememhandle; - OBJ_CONSTRUCT(&mpool->reg_list, ompi_free_list_t); - ompi_free_list_init_new(&mpool->reg_list, mpool->resources.sizeof_reg, + OBJ_CONSTRUCT(&mpool->reg_list, opal_free_list_t); + opal_free_list_init (&mpool->reg_list, mpool->resources.sizeof_reg, opal_cache_line_size, OBJ_CLASS(mca_mpool_base_registration_t), 0,opal_cache_line_size, - 0, -1, 32, NULL); + 0, -1, 32, NULL, 0, NULL, NULL, NULL); OBJ_CONSTRUCT(&mpool->lru_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; @@ -179,7 +182,7 @@ int mca_mpool_rgpusm_register(mca_mpool_base_module_t *mpool, void *addr, mca_mpool_rgpusm_module_t *mpool_rgpusm = (mca_mpool_rgpusm_module_t*)mpool; mca_mpool_common_cuda_reg_t *rgpusm_reg; mca_mpool_common_cuda_reg_t *rget_reg; - ompi_free_list_item_t *item; + opal_free_list_item_t *item; int rc; int mypeer; /* just for debugging */ @@ -201,7 +204,7 @@ int mca_mpool_rgpusm_register(mca_mpool_base_module_t *mpool, void *addr, * are not leaving the registrations pinned, the number of * registrations is unlimited and there is no need for a cache. */ if(!mca_mpool_rgpusm_component.leave_pinned && 0 == mca_mpool_rgpusm_component.rcache_size_limit) { - OMPI_FREE_LIST_GET_MT(&mpool_rgpusm->reg_list, item); + item = opal_free_list_get (&mpool_rgpusm->reg_list); if(NULL == item) { return OPAL_ERR_OUT_OF_RESOURCE; } @@ -225,7 +228,7 @@ int mca_mpool_rgpusm_register(mca_mpool_base_module_t *mpool, void *addr, assert(OPAL_ERR_WOULD_BLOCK != rc); if(rc != OPAL_SUCCESS) { - OMPI_FREE_LIST_RETURN_MT(&mpool_rgpusm->reg_list, item); + opal_free_list_return (&mpool_rgpusm->reg_list, item); return rc; } rgpusm_reg->base.ref_count++; @@ -312,7 +315,7 @@ int mca_mpool_rgpusm_register(mca_mpool_base_module_t *mpool, void *addr, "RGPUSM: New registration ep=%d, addr=%p, size=%d. Need to register and insert in cache", mypeer, addr, (int)size); - OMPI_FREE_LIST_GET_MT(&mpool_rgpusm->reg_list, item); + item = opal_free_list_get (&mpool_rgpusm->reg_list); if(NULL == item) { OPAL_THREAD_UNLOCK(&mpool->rcache->lock); return OPAL_ERR_OUT_OF_RESOURCE; @@ -392,7 +395,7 @@ int mca_mpool_rgpusm_register(mca_mpool_base_module_t *mpool, void *addr, if(rc != OPAL_SUCCESS) { OPAL_THREAD_UNLOCK(&mpool->rcache->lock); - OMPI_FREE_LIST_RETURN_MT(&mpool_rgpusm->reg_list, item); + opal_free_list_return (&mpool_rgpusm->reg_list, item); return rc; } @@ -409,7 +412,7 @@ int mca_mpool_rgpusm_register(mca_mpool_base_module_t *mpool, void *addr, if(rc != OPAL_SUCCESS) { OPAL_THREAD_UNLOCK(&mpool->rcache->lock); - OMPI_FREE_LIST_RETURN_MT(&mpool_rgpusm->reg_list, item); + opal_free_list_return (&mpool_rgpusm->reg_list, item); /* We cannot recover from this. We can be here if the size of * the cache is smaller than the amount of memory we are * trying to register in a single transfer. In that case, rc @@ -512,8 +515,8 @@ int mca_mpool_rgpusm_deregister(struct mca_mpool_base_module_t *mpool, OPAL_THREAD_LOCK(&mpool->rcache->lock); if(OPAL_SUCCESS == rc) { - OMPI_FREE_LIST_RETURN_MT(&mpool_rgpusm->reg_list, - (ompi_free_list_item_t*)reg); + opal_free_list_return (&mpool_rgpusm->reg_list, + (opal_free_list_item_t*)reg); } } OPAL_THREAD_UNLOCK(&mpool->rcache->lock); @@ -555,8 +558,8 @@ int mca_mpool_rgpusm_deregister_no_lock(struct mca_mpool_base_module_t *mpool, } if(OPAL_SUCCESS == rc) { - OMPI_FREE_LIST_RETURN_MT(&mpool_rgpusm->reg_list, - (ompi_free_list_item_t*)reg); + opal_free_list_return (&mpool_rgpusm->reg_list, + (opal_free_list_item_t*)reg); } } @@ -615,8 +618,8 @@ void mca_mpool_rgpusm_finalize(struct mca_mpool_base_module_t *mpool) continue; } - OMPI_FREE_LIST_RETURN_MT(&mpool_rgpusm->reg_list, - (ompi_free_list_item_t*)reg); + opal_free_list_return (&mpool_rgpusm->reg_list, + (opal_free_list_item_t *) reg); } } while(reg_cnt == RGPUSM_MPOOL_NREGS); diff --git a/opal/mca/mpool/udreg/mpool_udreg.h b/opal/mca/mpool/udreg/mpool_udreg.h index 35489ca227..e1fb224060 100644 --- a/opal/mca/mpool/udreg/mpool_udreg.h +++ b/opal/mca/mpool/udreg/mpool_udreg.h @@ -11,7 +11,7 @@ * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * Copyright (c) 2006 Voltaire. All rights reserved. - * Copyright (c) 2011-2013 Los Alamos National Security, LLC. All rights + * Copyright (c) 2011-2015 Los Alamos National Security, LLC. All rights * reserved. * * $COPYRIGHT$ @@ -28,7 +28,7 @@ #include "opal_config.h" #include "opal/class/opal_list.h" -#include "opal/class/ompi_free_list.h" +#include "opal/class/opal_free_list.h" #include "opal/mca/event/event.h" #include "opal/mca/mpool/mpool.h" #include "opal/util/proc.h" @@ -94,7 +94,7 @@ OBJ_CLASS_DECLARATION(mca_mpool_udreg_hugepage_pool_item_t); struct mca_mpool_udreg_module_t { mca_mpool_base_module_t super; struct mca_mpool_base_resources_t resources; - ompi_free_list_t reg_list; + opal_free_list_t reg_list; mca_mpool_udreg_hugepage_t *huge_page; opal_mutex_t lock; void *udreg_handle; diff --git a/opal/mca/mpool/udreg/mpool_udreg_module.c b/opal/mca/mpool/udreg/mpool_udreg_module.c index 70930ecea7..1c10829a3e 100644 --- a/opal/mca/mpool/udreg/mpool_udreg_module.c +++ b/opal/mca/mpool/udreg/mpool_udreg_module.c @@ -14,7 +14,7 @@ * Copyright (c) 2006 Voltaire. All rights reserved. * Copyright (c) 2007 Mellanox Technologies. All rights reserved. * Copyright (c) 2010 IBM Corporation. All rights reserved. - * Copyright (c) 2011-2014 Los Alamos National Security, LLC. All rights + * Copyright (c) 2011-2015 Los Alamos National Security, LLC. All rights * reserved. * * $COPYRIGHT$ @@ -177,11 +177,12 @@ int mca_mpool_udreg_module_init(mca_mpool_udreg_module_t* mpool) return OPAL_ERROR; } - OBJ_CONSTRUCT(&mpool->reg_list, ompi_free_list_t); - ompi_free_list_init_new(&mpool->reg_list, mpool->resources.sizeof_reg, - opal_cache_line_size, - OBJ_CLASS(mca_mpool_base_registration_t), - 0, opal_cache_line_size, 0, -1, 32, NULL); + OBJ_CONSTRUCT(&mpool->reg_list, opal_free_list_t); + opal_free_list_init (&mpool->reg_list, mpool->resources.sizeof_reg, + opal_cache_line_size, + OBJ_CLASS(mca_mpool_base_registration_t), + 0, opal_cache_line_size, 0, -1, 32, NULL, 0, + NULL, NULL, NULL); return OPAL_SUCCESS; } @@ -191,10 +192,10 @@ static void *mca_mpool_udreg_reg_func (void *addr, uint64_t len, void *reg_conte { mca_mpool_udreg_module_t *mpool_udreg = (mca_mpool_udreg_module_t *) reg_context; mca_mpool_base_registration_t *udreg_reg; - ompi_free_list_item_t *item; + opal_free_list_item_t *item; int rc; - OMPI_FREE_LIST_GET_MT(&mpool_udreg->reg_list, item); + item = opal_free_list_get (&mpool_udreg->reg_list); if (NULL == item) { return NULL; } @@ -207,7 +208,7 @@ static void *mca_mpool_udreg_reg_func (void *addr, uint64_t len, void *reg_conte rc = mpool_udreg->resources.register_mem(mpool_udreg->resources.reg_data, addr, len, udreg_reg); if (OPAL_SUCCESS != rc) { - OMPI_FREE_LIST_RETURN_MT(&mpool_udreg->reg_list, item); + opal_free_list_return (&mpool_udreg->reg_list, item); udreg_reg = NULL; } @@ -223,8 +224,8 @@ static uint32_t mca_mpool_udreg_dereg_func (void *device_data, void *dreg_contex rc = mpool_udreg->resources.deregister_mem(mpool_udreg->resources.reg_data, udreg_reg); if (OPAL_LIKELY(OPAL_SUCCESS == rc)) { - OMPI_FREE_LIST_RETURN_MT(&mpool_udreg->reg_list, - (ompi_free_list_item_t *) udreg_reg); + opal_free_list_return (&mpool_udreg->reg_list, + (opal_free_list_item_t *) udreg_reg); } /* might be worth printing out a warning if an error occurs here */ diff --git a/oshmem/mca/spml/base/spml_base_frame.c b/oshmem/mca/spml/base/spml_base_frame.c index d22e219a75..7cee996b65 100644 --- a/oshmem/mca/spml/base/spml_base_frame.c +++ b/oshmem/mca/spml/base/spml_base_frame.c @@ -1,6 +1,9 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2013 Mellanox Technologies, Inc. * All rights reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -64,7 +67,7 @@ static int mca_spml_base_close(void) int i, j; /** - * Destruct the send and receive queues. The ompi_free_list_t destructor + * Destruct the send and receive queues. The opal_free_list_t destructor * will return the memory to the mpool, so this has to be done before the * mpool get released by the SPML close function. */ @@ -100,8 +103,8 @@ static int mca_spml_base_open(mca_base_open_flag_t flags) * their content, they should get constructed as soon as possible once the MPI * process is started. */ - OBJ_CONSTRUCT(&mca_spml_base_put_requests, ompi_free_list_t); - OBJ_CONSTRUCT(&mca_spml_base_get_requests, ompi_free_list_t); + OBJ_CONSTRUCT(&mca_spml_base_put_requests, opal_free_list_t); + OBJ_CONSTRUCT(&mca_spml_base_get_requests, opal_free_list_t); OBJ_CONSTRUCT(&mca_spml_base_spml, opal_pointer_array_t); diff --git a/oshmem/mca/spml/base/spml_base_request.c b/oshmem/mca/spml/base/spml_base_request.c index 80f7b2f0ed..a9a22df8f0 100644 --- a/oshmem/mca/spml/base/spml_base_request.c +++ b/oshmem/mca/spml/base/spml_base_request.c @@ -1,6 +1,9 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2013 Mellanox Technologies, Inc. * All rights reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -16,9 +19,9 @@ * If you wonder why these 2 freelists are declared here read the comment * in the spml_base_request.h file. */ -ompi_free_list_t mca_spml_base_put_requests/* = {{{0}}}*/; -ompi_free_list_t mca_spml_base_get_requests /*= {{{0}}}*/; -ompi_free_list_t mca_spml_base_atomic_requests = { { { 0 } } }; +opal_free_list_t mca_spml_base_put_requests/* = {{{0}}}*/; +opal_free_list_t mca_spml_base_get_requests /*= {{{0}}}*/; +opal_free_list_t mca_spml_base_atomic_requests = { { { 0 } } }; static void mca_spml_base_request_construct(mca_spml_base_request_t* req) { diff --git a/oshmem/mca/spml/base/spml_base_request.h b/oshmem/mca/spml/base/spml_base_request.h index 8ec74f1c68..1719da8cee 100644 --- a/oshmem/mca/spml/base/spml_base_request.h +++ b/oshmem/mca/spml/base/spml_base_request.h @@ -1,6 +1,9 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2013 Mellanox Technologies, Inc. * All rights reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -18,7 +21,7 @@ #include "opal/datatype/opal_convertor.h" -#include "opal/class/ompi_free_list.h" +#include "opal/class/opal_free_list.h" #include "ompi/mca/pml/ob1/pml_ob1_comm.h" BEGIN_C_DECLS @@ -29,11 +32,11 @@ BEGIN_C_DECLS * the list. Beware these free lists have to be initialized * directly by the SPML who win the SPML election. */ -OSHMEM_DECLSPEC extern ompi_free_list_t mca_spml_base_put_requests; -OSHMEM_DECLSPEC extern ompi_free_list_t mca_spml_base_get_requests; -OSHMEM_DECLSPEC extern ompi_free_list_t mca_spml_base_send_requests; -OSHMEM_DECLSPEC extern ompi_free_list_t mca_spml_base_recv_requests; -OSHMEM_DECLSPEC extern ompi_free_list_t mca_spml_base_atomic_requests; +OSHMEM_DECLSPEC extern opal_free_list_t mca_spml_base_put_requests; +OSHMEM_DECLSPEC extern opal_free_list_t mca_spml_base_get_requests; +OSHMEM_DECLSPEC extern opal_free_list_t mca_spml_base_send_requests; +OSHMEM_DECLSPEC extern opal_free_list_t mca_spml_base_recv_requests; +OSHMEM_DECLSPEC extern opal_free_list_t mca_spml_base_atomic_requests; /* TODO: Consider to add requests lists * 1. List of Non blocking requests with NULL handle. diff --git a/oshmem/mca/spml/ikrit/spml_ikrit.c b/oshmem/mca/spml/ikrit/spml_ikrit.c index c76faaf8c5..2e0caf1e29 100644 --- a/oshmem/mca/spml/ikrit/spml_ikrit.c +++ b/oshmem/mca/spml/ikrit/spml_ikrit.c @@ -1,8 +1,11 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2013-2015 Mellanox Technologies, Inc. * All rights reserved. * Copyright (c) 2014 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -99,8 +102,8 @@ static int mca_spml_ikrit_put_request_free(struct oshmem_request_t** request) assert(false == put_req->req_put.req_base.req_free_called); OPAL_THREAD_LOCK(&oshmem_request_lock); put_req->req_put.req_base.req_free_called = true; - OMPI_FREE_LIST_RETURN_MT( &mca_spml_base_put_requests, - (ompi_free_list_item_t*)put_req); + opal_free_list_return (&mca_spml_base_put_requests, + (opal_free_list_item_t*)put_req); OPAL_THREAD_UNLOCK(&oshmem_request_lock); *request = SHMEM_REQUEST_NULL; /*MPI_REQUEST_NULL;*/ @@ -147,8 +150,8 @@ static int mca_spml_ikrit_get_request_free(struct oshmem_request_t** request) assert(false == get_req->req_get.req_base.req_free_called); OPAL_THREAD_LOCK(&oshmem_request_lock); get_req->req_get.req_base.req_free_called = true; - OMPI_FREE_LIST_RETURN_MT( &mca_spml_base_get_requests, - (ompi_free_list_item_t*)get_req); + opal_free_list_return (&mca_spml_base_get_requests, + (opal_free_list_item_t*)get_req); OPAL_THREAD_UNLOCK(&oshmem_request_lock); *request = SHMEM_REQUEST_NULL; /*MPI_REQUEST_NULL;*/ @@ -234,9 +237,9 @@ void mca_spml_ikrit_dump_stats() static inline mca_spml_ikrit_put_request_t *alloc_put_req(void) { mca_spml_ikrit_put_request_t *req; - ompi_free_list_item_t* item; + opal_free_list_item_t* item; - OMPI_FREE_LIST_WAIT_MT(&mca_spml_base_put_requests, item); + item = opal_free_list_wait (&mca_spml_base_put_requests); req = (mca_spml_ikrit_put_request_t *) item; req->req_put.req_base.req_free_called = false; @@ -248,9 +251,9 @@ static inline mca_spml_ikrit_put_request_t *alloc_put_req(void) static inline mca_spml_ikrit_get_request_t *alloc_get_req(void) { mca_spml_ikrit_get_request_t *req; - ompi_free_list_item_t* item; + opal_free_list_item_t* item; - OMPI_FREE_LIST_WAIT_MT(&mca_spml_base_get_requests, item); + item = opal_free_list_wait (&mca_spml_base_get_requests); req = (mca_spml_ikrit_get_request_t *) item; req->req_get.req_base.req_free_called = false; @@ -266,27 +269,27 @@ int mca_spml_ikrit_enable(bool enable) return OSHMEM_SUCCESS; } - ompi_free_list_init_new(&mca_spml_base_put_requests, - sizeof(mca_spml_ikrit_put_request_t), - opal_cache_line_size, - OBJ_CLASS(mca_spml_ikrit_put_request_t), - 0, - opal_cache_line_size, - mca_spml_ikrit.free_list_num, - mca_spml_ikrit.free_list_max, - mca_spml_ikrit.free_list_inc, - NULL ); + opal_free_list_init (&mca_spml_base_put_requests, + sizeof(mca_spml_ikrit_put_request_t), + opal_cache_line_size, + OBJ_CLASS(mca_spml_ikrit_put_request_t), + 0, + opal_cache_line_size, + mca_spml_ikrit.free_list_num, + mca_spml_ikrit.free_list_max, + mca_spml_ikrit.free_list_inc, + NULL, 0, NULL, NULL, NULL); - ompi_free_list_init_new(&mca_spml_base_get_requests, - sizeof(mca_spml_ikrit_get_request_t), - opal_cache_line_size, - OBJ_CLASS(mca_spml_ikrit_get_request_t), - 0, - opal_cache_line_size, - mca_spml_ikrit.free_list_num, - mca_spml_ikrit.free_list_max, - mca_spml_ikrit.free_list_inc, - NULL ); + opal_free_list_init (&mca_spml_base_get_requests, + sizeof(mca_spml_ikrit_get_request_t), + opal_cache_line_size, + OBJ_CLASS(mca_spml_ikrit_get_request_t), + 0, + opal_cache_line_size, + mca_spml_ikrit.free_list_num, + mca_spml_ikrit.free_list_max, + mca_spml_ikrit.free_list_inc, + NULL, 0, NULL, NULL, NULL); mca_spml_ikrit.enabled = true; diff --git a/oshmem/mca/spml/ikrit/spml_ikrit.h b/oshmem/mca/spml/ikrit/spml_ikrit.h index e0ce288065..990f295670 100644 --- a/oshmem/mca/spml/ikrit/spml_ikrit.h +++ b/oshmem/mca/spml/ikrit/spml_ikrit.h @@ -1,6 +1,9 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2013 Mellanox Technologies, Inc. * All rights reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -24,7 +27,7 @@ #include "oshmem/mca/spml/base/spml_base_getreq.h" #include "ompi/mca/bml/base/base.h" -#include "opal/class/ompi_free_list.h" +#include "opal/class/opal_free_list.h" #include "opal/class/opal_list.h" #include "orte/runtime/orte_globals.h" diff --git a/oshmem/mca/spml/yoda/spml_yoda.c b/oshmem/mca/spml/yoda/spml_yoda.c index 2a599c964e..83a707a755 100644 --- a/oshmem/mca/spml/yoda/spml_yoda.c +++ b/oshmem/mca/spml/yoda/spml_yoda.c @@ -934,27 +934,27 @@ int mca_spml_yoda_enable(bool enable) * initialize them with the size of our own requests. */ - ompi_free_list_init_new(&mca_spml_base_put_requests, - sizeof(mca_spml_yoda_put_request_t), - opal_cache_line_size, - OBJ_CLASS(mca_spml_yoda_put_request_t), - 0, - opal_cache_line_size, - mca_spml_yoda.free_list_num, - mca_spml_yoda.free_list_max, - mca_spml_yoda.free_list_inc, - NULL ); + opal_free_list_init (&mca_spml_base_put_requests, + sizeof(mca_spml_yoda_put_request_t), + opal_cache_line_size, + OBJ_CLASS(mca_spml_yoda_put_request_t), + 0, + opal_cache_line_size, + mca_spml_yoda.free_list_num, + mca_spml_yoda.free_list_max, + mca_spml_yoda.free_list_inc, + NULL, 0, NULL, NULL, NULL); - ompi_free_list_init_new(&mca_spml_base_get_requests, - sizeof(mca_spml_yoda_get_request_t), - opal_cache_line_size, - OBJ_CLASS(mca_spml_yoda_get_request_t), - 0, - opal_cache_line_size, - mca_spml_yoda.free_list_num, - mca_spml_yoda.free_list_max, - mca_spml_yoda.free_list_inc, - NULL ); + opal_free_list_init (&mca_spml_base_get_requests, + sizeof(mca_spml_yoda_get_request_t), + opal_cache_line_size, + OBJ_CLASS(mca_spml_yoda_get_request_t), + 0, + opal_cache_line_size, + mca_spml_yoda.free_list_num, + mca_spml_yoda.free_list_max, + mca_spml_yoda.free_list_inc, + NULL, 0, NULL, NULL, NULL); mca_spml_yoda.enabled = true; diff --git a/oshmem/mca/spml/yoda/spml_yoda.h b/oshmem/mca/spml/yoda/spml_yoda.h index deb45654b9..c0a04e5e4c 100644 --- a/oshmem/mca/spml/yoda/spml_yoda.h +++ b/oshmem/mca/spml/yoda/spml_yoda.h @@ -30,7 +30,7 @@ #include "ompi/mca/bml/base/base.h" #include "opal/mca/btl/btl.h" -#include "opal/class/ompi_free_list.h" +#include "opal/class/opal_free_list.h" /* Turn ON/OFF debug output from build (default 0) */ #ifndef OSHMEM_WAIT_COMPLETION_DEBUG @@ -79,7 +79,7 @@ struct mca_spml_yoda_t { opal_mutex_t lock; /* free lists */ - ompi_free_list_t rdma_frags; + opal_free_list_t rdma_frags; /* number of outstanding put requests */ int32_t n_active_puts; int32_t n_active_gets; diff --git a/oshmem/mca/spml/yoda/spml_yoda_getreq.c b/oshmem/mca/spml/yoda/spml_yoda_getreq.c index 1b63038b9a..657beb15a6 100644 --- a/oshmem/mca/spml/yoda/spml_yoda_getreq.c +++ b/oshmem/mca/spml/yoda/spml_yoda_getreq.c @@ -42,8 +42,8 @@ static int mca_spml_yoda_get_request_free(struct oshmem_request_t** request) OPAL_THREAD_LOCK(&oshmem_request_lock); getreq->req_get.req_base.req_free_called = true; - OMPI_FREE_LIST_RETURN_MT( &mca_spml_base_get_requests, - (ompi_free_list_item_t*)getreq); + opal_free_list_return (&mca_spml_base_get_requests, + (opal_free_list_item_t*)getreq); OPAL_THREAD_UNLOCK(&oshmem_request_lock); diff --git a/oshmem/mca/spml/yoda/spml_yoda_getreq.h b/oshmem/mca/spml/yoda/spml_yoda_getreq.h index f32f843063..8269d63718 100644 --- a/oshmem/mca/spml/yoda/spml_yoda_getreq.h +++ b/oshmem/mca/spml/yoda/spml_yoda_getreq.h @@ -42,10 +42,10 @@ OBJ_CLASS_DECLARATION(mca_spml_yoda_get_request_t); static inline mca_spml_yoda_get_request_t *mca_spml_yoda_getreq_alloc(int dst) { - ompi_free_list_item_t *item; + opal_free_list_item_t *item; mca_spml_yoda_get_request_t *getreq; - OMPI_FREE_LIST_WAIT_MT(&mca_spml_base_get_requests, item); + item = opal_free_list_wait (&mca_spml_base_get_requests); getreq = (mca_spml_yoda_get_request_t*) item; assert(getreq); getreq->req_get.req_base.req_free_called = false; diff --git a/oshmem/mca/spml/yoda/spml_yoda_putreq.c b/oshmem/mca/spml/yoda/spml_yoda_putreq.c index dea643652e..c1dca77089 100644 --- a/oshmem/mca/spml/yoda/spml_yoda_putreq.c +++ b/oshmem/mca/spml/yoda/spml_yoda_putreq.c @@ -1,6 +1,9 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2013 Mellanox Technologies, Inc. * All rights reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -35,8 +38,8 @@ static int mca_spml_yoda_put_request_free(struct oshmem_request_t** request) OPAL_THREAD_LOCK(&oshmem_request_lock); putreq->req_put.req_base.req_free_called = true; - OMPI_FREE_LIST_RETURN_MT( &mca_spml_base_put_requests, - (ompi_free_list_item_t*)putreq); + opal_free_list_return (&mca_spml_base_put_requests, + (opal_free_list_item_t*)putreq); OPAL_THREAD_UNLOCK(&oshmem_request_lock); *request = SHMEM_REQUEST_NULL; diff --git a/oshmem/mca/spml/yoda/spml_yoda_putreq.h b/oshmem/mca/spml/yoda/spml_yoda_putreq.h index 5251aa4415..9bdb1b8651 100644 --- a/oshmem/mca/spml/yoda/spml_yoda_putreq.h +++ b/oshmem/mca/spml/yoda/spml_yoda_putreq.h @@ -1,6 +1,9 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2013 Mellanox Technologies, Inc. * All rights reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -32,10 +35,10 @@ typedef struct mca_spml_yoda_put_request_t mca_spml_yoda_put_request_t; OBJ_CLASS_DECLARATION(mca_spml_yoda_put_request_t); static inline mca_spml_yoda_put_request_t *mca_spml_yoda_putreq_alloc(int dst) { - ompi_free_list_item_t *item; + opal_free_list_item_t *item; mca_spml_yoda_put_request_t *putreq; - OMPI_FREE_LIST_WAIT_MT(&mca_spml_base_put_requests, item); + item = opal_free_list_wait (&mca_spml_base_put_requests); putreq = (mca_spml_yoda_put_request_t*) item; assert(putreq); putreq->req_put.req_base.req_free_called = false; diff --git a/oshmem/request/request.c b/oshmem/request/request.c index 564765abbd..64b4ae86e8 100644 --- a/oshmem/request/request.c +++ b/oshmem/request/request.c @@ -1,7 +1,9 @@ -/* -*- Mode: C; c-basic-offset:4 ; -*- */ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2013 Mellanox Technologies, Inc. * All rights reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -84,7 +86,7 @@ int oshmem_request_persistent_proc_null_free(oshmem_request_t** request) /*TODO: define under class oshmem_free_list_item_t */ OBJ_CLASS_INSTANCE( oshmem_request_t, - ompi_free_list_item_t, + opal_free_list_item_t, oshmem_request_construct, oshmem_request_destruct); diff --git a/oshmem/request/request.h b/oshmem/request/request.h index 9d19e59661..051ec0aa2f 100644 --- a/oshmem/request/request.h +++ b/oshmem/request/request.h @@ -1,7 +1,10 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* -*- Mode: C; c-basic-offset:4 ; -*- */ /* * Copyright (c) 2013 Mellanox Technologies, Inc. * All rights reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -20,7 +23,7 @@ #include "oshmem_config.h" #include "oshmem/constants.h" -#include "opal/class/ompi_free_list.h" +#include "opal/class/opal_free_list.h" #include "opal/class/opal_pointer_array.h" #include "opal/threads/condition.h" @@ -108,7 +111,7 @@ typedef union oshmem_shmem_object_t { * Main top-level request struct definition */ struct oshmem_request_t { - ompi_free_list_item_t super; /**< Base type *//*TODO: Implement in shmem */ + opal_free_list_item_t super; /**< Base type *//*TODO: Implement in shmem */ oshmem_request_type_t req_type; /**< Enum indicating the type of the request */ oshmem_status_public_t req_status; /**< Completion status */ volatile bool req_complete; /**< Flag indicating completion on a request */ diff --git a/test/class/ompi_rb_tree.c b/test/class/ompi_rb_tree.c index 31f6480962..11979b9d9d 100644 --- a/test/class/ompi_rb_tree.c +++ b/test/class/ompi_rb_tree.c @@ -1,3 +1,4 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology @@ -10,6 +11,8 @@ * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * Copyright (c) 2006-2010 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -28,7 +31,6 @@ #endif #include #include "support.h" -#include "opal/class/ompi_free_list.h" #include "opal/class/opal_rb_tree.h" #include "opal/mca/mpool/base/base.h" @@ -281,14 +283,14 @@ typedef struct opal_test_rb_key_t opal_test_rb_key_t; struct opal_test_rb_value_t { - ompi_free_list_item_t super; /* the parent class */ + opal_free_list_item_t super; /* the parent class */ opal_test_rb_key_t key; /* the key which holds the memory pointers */ mca_mpool_base_module_t* registered_mpools[MAX_REGISTRATIONS]; /* the mpools the memory is registered with */ }; typedef struct opal_test_rb_value_t opal_test_rb_value_t; -OBJ_CLASS_INSTANCE(opal_test_rb_value_t, ompi_free_list_item_t, NULL, NULL); +OBJ_CLASS_INSTANCE(opal_test_rb_value_t, opal_free_list_item_t, NULL, NULL); int mem_node_compare(void * key1, void * key2) { @@ -307,21 +309,21 @@ int mem_node_compare(void * key1, void * key2) void test2(void) { - ompi_free_list_t key_list; - ompi_free_list_item_t * new_value; + opal_free_list_t key_list; + opal_free_list_item_t * new_value; opal_rb_tree_t tree; int rc, i, size; void * result, * lookup; void * mem[NUM_ALLOCATIONS]; - ompi_free_list_item_t * key_array[NUM_ALLOCATIONS]; + opal_free_list_item_t * key_array[NUM_ALLOCATIONS]; struct timeval start, end; - OBJ_CONSTRUCT(&key_list, ompi_free_list_t); - ompi_free_list_init_new(&key_list, sizeof(opal_test_rb_value_t), + OBJ_CONSTRUCT(&key_list, opal_free_list_t); + opal_free_list_init (&key_list, sizeof(opal_test_rb_value_t), opal_cache_line_size, OBJ_CLASS(opal_test_rb_value_t), 0,opal_cache_line_size, - 0, -1 , 128, NULL); + 0, -1 , 128, NULL, 0, NULL, NULL, NULL); OBJ_CONSTRUCT(&tree, opal_rb_tree_t); rc = opal_rb_tree_init(&tree, mem_node_compare); @@ -338,7 +340,7 @@ void test2(void) test_failure("system out of memory"); return; } - OMPI_FREE_LIST_GET_MT(&key_list, new_value); + new_value = opal_free_list_get (&key_list); if(NULL == new_value) { test_failure("failed to get memory from free list"); @@ -394,7 +396,7 @@ void test2(void) { free(mem[i]); } - OMPI_FREE_LIST_RETURN_MT(&(key_list), key_array[i]); + opal_free_list_return (&(key_list), key_array[i]); } OBJ_DESTRUCT(&tree);