Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions ompi/communicator/comm_request.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ 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),
OBJ_CLASS(ompi_comm_request_t), 0, -1, 8);
(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);

OBJ_CONSTRUCT(&ompi_comm_requests_active, opal_list_t);
ompi_comm_request_progress_active = false;
Expand Down Expand Up @@ -237,10 +238,11 @@ OBJ_CLASS_INSTANCE(ompi_comm_request_item_t, opal_list_item_t, NULL, NULL);
ompi_comm_request_t *ompi_comm_request_get (void)
{
opal_free_list_item_t *item;
int rc;

OPAL_FREE_LIST_GET(&ompi_comm_requests, item, rc);
(void) rc;
item = opal_free_list_get (&ompi_comm_requests);
if (OPAL_UNLIKELY(NULL == item)) {
return NULL;
}

OMPI_REQUEST_INIT((ompi_request_t *) item, false);

Expand All @@ -254,6 +256,6 @@ void ompi_comm_request_return (ompi_comm_request_t *request)
request->context = NULL;
}

OPAL_FREE_LIST_RETURN(&ompi_comm_requests, (opal_free_list_item_t *) request);
opal_free_list_return (&ompi_comm_requests, (opal_free_list_item_t *) request);
}

53 changes: 28 additions & 25 deletions ompi/debuggers/ompi_common_dll.c
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 );
Expand Down
7 changes: 5 additions & 2 deletions ompi/debuggers/ompi_common_dll_defs.h
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down
12 changes: 6 additions & 6 deletions ompi/debuggers/ompi_debuggers.c
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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;
Expand Down
49 changes: 26 additions & 23 deletions ompi/debuggers/ompi_msgq_dll.c
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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 );
Expand All @@ -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);
Expand All @@ -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 ) {
Expand All @@ -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 ?
Expand All @@ -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",
Expand All @@ -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));
Expand All @@ -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 );
/**
Expand All @@ -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);
Expand All @@ -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,
Expand All @@ -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 );
/**
Expand All @@ -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));
Expand Down Expand Up @@ -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, &current_item );
if( 0 == current_item ) {
DEBUG(VERBOSE_REQ,("no more items in the %s request queue\n",
Expand Down Expand Up @@ -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 */
Expand Down
Loading