1
1

Update OMPI frameworks to use the MCA framework system.

Notes:
  - This commit also eliminates the need for an available components list in use
    in several frameworks. None of the code in question was making use of the
    priority field of the priority component list item so these extra lists were
    removed.
  - Cleaned up selection code in several frameworks to sort lists using opal_list_sort.
  - Cleans up the ompi/orte-info functions. Expose the functions that construct the
    list of params so they can be used elsewhere.

patches for mtl/portals4 from brian

missed a few output variables in openib

This commit was SVN r28241.
This commit is contained in:
Nathan Hjelm 2013-03-27 21:17:31 +00:00
parent c041156f60
commit 9d4a26f47d
197 changed files with 1553 additions and 5103 deletions

View File

@ -371,7 +371,6 @@ sub mca_generate_framework_header(\$\@) {
# There is no common framework object
if ($framework ne "common") {
my $framework_name = "${project}_${framework}_base_framework";
$framework_array_output .= " &$framework_name,\n";
$framework_decl_output .= "extern mca_base_framework_t $framework_name;\n";
}

View File

@ -39,20 +39,8 @@
/*
* Global variables
*/
opal_list_t mca_allocator_base_components;
/**
* Function for finding and opening either all MCA components, or the one
* that was specifically requested via a MCA parameter.
*/
int mca_allocator_base_open(void)
{
/* Open up all available components */
return mca_base_components_open("allocator", 0,
mca_allocator_base_static_components,
&mca_allocator_base_components, true);
}
MCA_BASE_FRAMEWORK_DECLARE(ompi, allocator, NULL, NULL, NULL, NULL,
mca_allocator_base_static_components, 0);
/**
* Traverses through the list of available components, calling their init
@ -66,11 +54,8 @@ int mca_allocator_base_open(void)
mca_allocator_base_component_t* mca_allocator_component_lookup(const char* name)
{
/* Traverse the list of available components; call their init functions. */
opal_list_item_t* item;
for (item = opal_list_get_first(&mca_allocator_base_components);
item != opal_list_get_end(&mca_allocator_base_components);
item = opal_list_get_next(item)) {
mca_base_component_list_item_t *cli = (mca_base_component_list_item_t *) item;
mca_base_component_list_item_t *cli;
OPAL_LIST_FOREACH(cli, &ompi_allocator_base_framework.framework_components, mca_base_component_list_item_t) {
mca_allocator_base_component_t* component = (mca_allocator_base_component_t *) cli->cli_component;
if(strcmp(component->allocator_version.mca_component_name,
name) == 0) {

View File

@ -50,12 +50,6 @@ typedef struct mca_allocator_base_selected_module_t mca_allocator_base_selected_
OMPI_DECLSPEC OBJ_CLASS_DECLARATION(mca_allocator_base_selected_module_t);
/*
* Global functions for MCA: overall allocator open and close
*/
OMPI_DECLSPEC int mca_allocator_base_open(void);
OMPI_DECLSPEC int mca_allocator_base_close(void);
OMPI_DECLSPEC mca_allocator_base_component_t* mca_allocator_component_lookup(const char* name);
@ -63,9 +57,9 @@ OMPI_DECLSPEC mca_allocator_base_component_t* mca_allocator_component_lookup(con
* Globals
*/
/**
* The list of all the selected components.
* The allocator framework
*/
OMPI_DECLSPEC extern opal_list_t mca_allocator_base_components;
OMPI_DECLSPEC extern mca_base_framework_t ompi_allocator_base_framework;
END_C_DECLS

View File

@ -12,6 +12,5 @@
headers += \
base/base.h
libmca_bcol_la_SOURCES += \
base/bcol_base_close.c \
base/bcol_base_open.c \
base/bcol_base_frame.c \
base/bcol_base_init.c

View File

@ -24,15 +24,10 @@
BEGIN_C_DECLS
OMPI_DECLSPEC extern opal_list_t mca_bcol_base_components_opened;
OMPI_DECLSPEC extern opal_list_t mca_bcol_base_components_in_use;
OMPI_DECLSPEC extern int mca_bcol_base_output;
OMPI_DECLSPEC extern char *ompi_bcol_bcols_string;
OMPI_DECLSPEC int mca_bcol_base_open(void);
OMPI_DECLSPEC int mca_bcol_base_close(void);
OMPI_DECLSPEC extern mca_base_framework_t ompi_bcol_base_framework;
OMPI_DECLSPEC int mca_bcol_base_init(bool enable_progress_threads, bool enable_mpi_threads);

View File

@ -1,37 +0,0 @@
/*
* Copyright (c) 2009-2012 Oak Ridge National Laboratory. All rights reserved.
* Copyright (c) 2009-2012 Mellanox Technologies. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "ompi_config.h"
#include <stdio.h>
#include "ompi/constants.h"
#include "opal/mca/mca.h"
#include "opal/mca/base/base.h"
#include "ompi/mca/bcol/bcol.h"
#include "ompi/mca/bcol/base/base.h"
#include "ompi/include/ompi/constants.h"
int mca_bcol_base_close(void)
{
/* Close all remaining available modules */
mca_base_components_close(mca_bcol_base_output,
&mca_bcol_base_components_opened, NULL);
/* Close the framework output */
opal_output_close (mca_bcol_base_output);
mca_bcol_base_output = -1;
/* All done */
return OMPI_SUCCESS;
}

View File

@ -34,13 +34,14 @@
#include "ompi/mca/bcol/base/static-components.h"
static int mca_bcol_base_open(mca_base_open_flag_t flags);
static int mca_bcol_base_register(mca_base_register_flag_t flags);
/*
** * Global variables
** */
int mca_bcol_base_output = 0;
opal_list_t mca_bcol_base_components_opened;
static int mca_bcol_base_verbose = 0;
MCA_BASE_FRAMEWORK_DECLARE(ompi, bcol, NULL, mca_bcol_base_register, mca_bcol_base_open, NULL,
mca_bcol_base_static_components, 0);
OMPI_DECLSPEC opal_list_t mca_bcol_base_components_in_use;
OMPI_DECLSPEC char *ompi_bcol_bcols_string;
@ -202,17 +203,8 @@ static int mca_bcol_base_set_components_to_use(opal_list_t *bcol_components_avai
return OMPI_SUCCESS;
}
static int mca_bcol_base_register(int flags)
static int mca_bcol_base_register(mca_base_register_flag_t flags)
{
/* Debugging/Verbose output */
(void) mca_base_var_register("ompi", "bcol", "base", "verbose",
"Verbosity level of BCOL framework",
MCA_BASE_VAR_TYPE_INT, NULL, 0,
MCA_BASE_VAR_FLAG_SETTABLE,
OPAL_INFO_LVL_9,
MCA_BASE_VAR_SCOPE_LOCAL,
&mca_bcol_base_verbose);
/* figure out which bcol and sbgp components will actually be used */
/* get list of sub-grouping functions to use */
ompi_bcol_bcols_string = "basesmuma,basesmuma,iboffload,ptpcoll,ugni";
@ -230,28 +222,17 @@ static int mca_bcol_base_register(int flags)
* Function for finding and opening either all MCA components, or the one
* that was specifically requested via a MCA parameter.
*/
int mca_bcol_base_open(void)
static int mca_bcol_base_open(mca_base_open_flag_t flags)
{
int ret;
/*_bcol_base_components_available
* Register some MCA parameters
*/
(void) mca_bcol_base_register(0);
/* get framework id */
mca_bcol_base_output = opal_output_open(NULL);
opal_output_set_verbosity(mca_bcol_base_output, mca_bcol_base_verbose);
/* Open up all available components */
if (OMPI_SUCCESS !=
mca_base_components_open("bcol", mca_bcol_base_output, mca_bcol_base_static_components,
&mca_bcol_base_components_opened,
true)) {
return OMPI_ERROR;
(ret = mca_base_framework_components_open(&ompi_bcol_base_framework, flags))) {
return ret;
}
ret = mca_bcol_base_set_components_to_use(&mca_bcol_base_components_opened,
ret = mca_bcol_base_set_components_to_use(&ompi_bcol_base_framework.framework_components,
&mca_bcol_base_components_in_use);
/* memory registration compatibilities */

View File

@ -565,7 +565,7 @@ basesmuma_module_enable(mca_bcol_base_module_t *module,
memset(&output_buffer[0],0,sizeof(output_buffer));
snprintf(output_buffer,sizeof(output_buffer),"%s (cid %d)", comm->c_name,
comm->c_contextid);
opal_output_verbose(10, mca_bcol_base_output,
opal_output_verbose(10, ompi_bcol_base_framework.framework_output,
"bcol:basesmuma:enable: new communicator: %s", output_buffer);
/* All done */

View File

@ -26,6 +26,5 @@ libmca_bml_la_SOURCES += \
base/bml_base_btl.h \
base/bml_base_endpoint.c \
base/bml_base_init.c \
base/bml_base_close.c \
base/bml_base_open.c \
base/bml_base_frame.c \
base/bml_base_ft.c

View File

@ -23,6 +23,7 @@
#include "ompi_config.h"
#include "opal/mca/mca.h"
#include "opal/mca/base/mca_base_framework.h"
#include "ompi/mca/bml/bml.h"
@ -46,10 +47,8 @@ OMPI_DECLSPEC OBJ_CLASS_DECLARATION(mca_bml_base_selected_module_t);
* Global functions for MCA: overall BTL open and close
*/
OMPI_DECLSPEC int mca_bml_base_open(void);
OMPI_DECLSPEC int mca_bml_base_init(bool enable_progress_threads,
bool enable_mpi_threads);
OMPI_DECLSPEC int mca_bml_base_close(void);
OMPI_DECLSPEC bool mca_bml_base_inited(void);
OMPI_DECLSPEC int mca_bml_base_ft_event(int state);
@ -58,11 +57,9 @@ OMPI_DECLSPEC int mca_bml_base_ft_event(int state);
/*
* Globals
*/
extern int mca_bml_base_already_opened;
OMPI_DECLSPEC extern int mca_bml_base_output;
OMPI_DECLSPEC extern mca_bml_base_component_t mca_bml_component;
OMPI_DECLSPEC extern opal_list_t mca_bml_base_components_available;
OMPI_DECLSPEC extern mca_bml_base_module_t mca_bml;
OMPI_DECLSPEC extern mca_base_framework_t ompi_bml_base_framework;
END_C_DECLS
#endif /* MCA_BML_BASE_H */

View File

@ -1,34 +0,0 @@
/*
* Copyright (c) 2004-2005 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-2006 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2009 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "ompi_config.h"
#include "ompi/mca/btl/base/base.h"
#include "ompi/mca/bml/base/base.h"
int mca_bml_base_close( void )
{
if (mca_bml_base_already_opened <= 0) {
return OMPI_ERROR;
} else if (--mca_bml_base_already_opened > 0) {
return OMPI_SUCCESS;
}
return mca_btl_base_close();
}

View File

@ -28,8 +28,13 @@
#include "ompi/mca/bml/base/static-components.h"
#include "opal/mca/base/base.h"
int mca_bml_base_already_opened = 0;
opal_list_t mca_bml_base_components_available = {{0}};
static int mca_bml_base_register(mca_base_register_flag_t flags);
static int mca_bml_base_open(mca_base_open_flag_t flags);
static int mca_bml_base_close(void);
MCA_BASE_FRAMEWORK_DECLARE(ompi, bml, "BTL Multiplexing Layer", mca_bml_base_register,
mca_bml_base_open, mca_bml_base_close, mca_bml_base_static_components,
0);
#if OPAL_ENABLE_DEBUG_RELIABILITY
int mca_bml_base_error_rate_floor;
@ -38,7 +43,7 @@ int mca_bml_base_error_count;
static bool mca_bml_base_srand;
#endif
int mca_bml_base_register(int flags)
static int mca_bml_base_register(mca_base_register_flag_t flags)
{
#if OPAL_ENABLE_DEBUG_RELIABILITY
do {
@ -77,20 +82,13 @@ int mca_bml_base_register(int flags)
return OMPI_SUCCESS;
}
int mca_bml_base_open(void)
static int mca_bml_base_open(mca_base_open_flag_t flags)
{
/* See if we've already been here */
if (++mca_bml_base_already_opened > 1) {
return OMPI_SUCCESS;
}
(void) mca_bml_base_register(0);
int ret;
if(OMPI_SUCCESS !=
mca_base_components_open("bml", 0, mca_bml_base_static_components,
&mca_bml_base_components_available,
true)) {
return OMPI_ERROR;
(ret = mca_base_framework_components_open(&ompi_bml_base_framework, flags))) {
return ret;
}
#if OPAL_ENABLE_DEBUG_RELIABILITY
@ -108,6 +106,10 @@ int mca_bml_base_open(void)
}
#endif
return mca_btl_base_open();
return mca_base_framework_open(&ompi_btl_base_framework, 0);
}
static int mca_bml_base_close( void )
{
return mca_base_framework_close(&ompi_btl_base_framework);
}

View File

@ -23,8 +23,6 @@
#include "opal/mca/mca.h"
#include "opal/runtime/opal.h"
int mca_bml_base_output = -1;
mca_bml_base_module_t mca_bml = {
NULL, /* bml_component */
NULL, /* bml_add_procs */
@ -57,13 +55,13 @@ int mca_bml_base_init( bool enable_progress_threads,
init_called = true;
for (item = opal_list_get_first(&mca_bml_base_components_available);
opal_list_get_end(&mca_bml_base_components_available) != item;
for (item = opal_list_get_first(&ompi_bml_base_framework.framework_components);
opal_list_get_end(&ompi_bml_base_framework.framework_components) != item;
item = opal_list_get_next(item)) {
cli = (mca_base_component_list_item_t*) item;
component = (mca_bml_base_component_t*) cli->cli_component;
if(NULL == component->bml_init) {
opal_output_verbose( 10, mca_bml_base_output,
opal_output_verbose( 10, ompi_bml_base_framework.framework_output,
"select: no init function; ignoring component %s",
component->bml_version.mca_component_name );
continue;
@ -85,11 +83,9 @@ int mca_bml_base_init( bool enable_progress_threads,
if(NULL == best_module) {
return OMPI_SUCCESS;
}
else {
mca_bml_component = *best_component;
mca_bml = *best_module;
return mca_base_components_close(mca_bml_base_output,
&mca_bml_base_components_available,
(mca_base_component_t*) best_component);
}
mca_bml_component = *best_component;
mca_bml = *best_module;
return mca_base_framework_components_close(&ompi_bml_base_framework,
(mca_base_component_t*) best_component);
}

View File

@ -144,7 +144,7 @@ int mca_bml_r2_ft_event(int state)
opal_output(0, "bml:r2: ft_event(Restart): Failed to finalize BML framework\n");
return ret;
}
if( OMPI_SUCCESS != (ret = mca_btl_base_close()) ) {
if( OMPI_SUCCESS != (ret = mca_base_framework_close(&ompi_btl_base_framework)) ) {
opal_output(0, "bml:r2: ft_event(Restart): Failed to close BTL framework\n");
return ret;
}
@ -168,7 +168,7 @@ int mca_bml_r2_ft_event(int state)
/*
* Re-open the BTL framework to get the full list of components.
*/
if( OMPI_SUCCESS != (ret = mca_btl_base_open()) ) {
if( OMPI_SUCCESS != (ret = mca_base_framework_open(&ompi_btl_base_framework, 0)) ) {
opal_output(0, "bml:r2: ft_event(Restart): Failed to open BTL framework\n");
return ret;
}
@ -222,7 +222,7 @@ int mca_bml_r2_ft_event(int state)
opal_output(0, "bml:r2: ft_event(Restart): Failed to finalize BML framework\n");
return ret;
}
if( OMPI_SUCCESS != (ret = mca_btl_base_close()) ) {
if( OMPI_SUCCESS != (ret = mca_base_framework_close(&ompi_btl_base_framework)) ) {
opal_output(0, "bml:r2: ft_event(Restart): Failed to close BTL framework\n");
return ret;
}
@ -253,7 +253,7 @@ int mca_bml_r2_ft_event(int state)
opal_output_verbose(11, ompi_cr_output,
"Restart (Previous BTL MCA): <%s>\n", btl_list ? btl_list[0] : "");
if( OMPI_SUCCESS != (ret = mca_btl_base_open()) ) {
if( OMPI_SUCCESS != (ret = mca_base_framework_open(&ompi_btl_base_framework, 0)) ) {
opal_output(0, "bml:r2: ft_event(Restart): Failed to open BTL framework\n");
return ret;
}

View File

@ -23,8 +23,7 @@ headers += \
base/btl_base_error.h
libmca_btl_la_SOURCES += \
base/btl_base_close.c \
base/btl_base_frame.c \
base/btl_base_error.c \
base/btl_base_open.c \
base/btl_base_select.c \
base/btl_base_mca.c

View File

@ -54,9 +54,7 @@ OMPI_DECLSPEC OBJ_CLASS_DECLARATION(mca_btl_base_selected_module_t);
* Global functions for MCA: overall BTL open and close
*/
OMPI_DECLSPEC int mca_btl_base_open(void);
OMPI_DECLSPEC int mca_btl_base_select(bool enable_progress_threads, bool enable_mpi_threads);
OMPI_DECLSPEC int mca_btl_base_close(void);
OMPI_DECLSPEC void mca_btl_base_dump(
struct mca_btl_base_module_t*,
struct mca_btl_base_endpoint_t*,
@ -68,15 +66,15 @@ OMPI_DECLSPEC int mca_btl_base_param_verify(mca_btl_base_module_t *module);
/*
* Globals
*/
OMPI_DECLSPEC extern int mca_btl_base_output;
extern char* mca_btl_base_include;
extern char* mca_btl_base_exclude;
extern int mca_btl_base_warn_component_unused;
extern int mca_btl_base_already_opened;
OMPI_DECLSPEC extern opal_list_t mca_btl_base_components_opened;
OMPI_DECLSPEC extern opal_list_t mca_btl_base_modules_initialized;
OMPI_DECLSPEC extern bool mca_btl_base_thread_multiple_override;
OMPI_DECLSPEC extern mca_base_framework_t ompi_btl_base_framework;
END_C_DECLS
#endif /* MCA_BTL_BASE_H */

View File

@ -1,81 +0,0 @@
/*
* 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) 2008-2009 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "ompi_config.h"
#include <stdio.h>
#include "ompi/constants.h"
#include "opal/mca/event/event.h"
#include "opal/mca/mca.h"
#include "opal/mca/base/base.h"
#include "ompi/mca/btl/base/base.h"
int mca_btl_base_close(void)
{
opal_list_item_t *item;
mca_btl_base_selected_module_t *sm;
if( mca_btl_base_already_opened <= 0 ) {
return OMPI_ERROR;
} else if (--mca_btl_base_already_opened > 0) {
return OMPI_SUCCESS;
}
#if 0
/* disable event processing while cleaning up btls */
opal_event_disable();
#endif
/* Finalize all the btl components and free their list items */
for (item = opal_list_remove_first(&mca_btl_base_modules_initialized);
NULL != item;
item = opal_list_remove_first(&mca_btl_base_modules_initialized)) {
sm = (mca_btl_base_selected_module_t *) item;
/* Blatebtly ignore the return code (what would we do to recover,
anyway? This component is going away, so errors don't matter
anymore) */
sm->btl_module->btl_finalize(sm->btl_module);
free(sm);
}
/* Close all remaining opened components (may be one if this is a
OMPI RTE program, or [possibly] multiple if this is ompi_info) */
mca_base_components_close(mca_btl_base_output,
&mca_btl_base_components_opened, NULL);
/* Close the framework output */
opal_output_close (mca_btl_base_output);
mca_btl_base_output = -1;
/* cleanup */
if(NULL != mca_btl_base_include)
free(mca_btl_base_include);
if(NULL != mca_btl_base_exclude)
free(mca_btl_base_exclude);
#if 0
/* restore event processing */
opal_event_enable();
#endif
/* All done */
return OMPI_SUCCESS;
}

View File

@ -70,26 +70,14 @@ OBJ_CLASS_INSTANCE(
/*
* Global variables
*/
int mca_btl_base_output = -1;
char* mca_btl_base_include = NULL;
char* mca_btl_base_exclude = NULL;
int mca_btl_base_warn_component_unused = 1;
opal_list_t mca_btl_base_components_opened;
opal_list_t mca_btl_base_modules_initialized;
int mca_btl_base_already_opened = 0;
bool mca_btl_base_thread_multiple_override = false;
static int mca_btl_base_register(int flags)
static int mca_btl_base_register(mca_base_register_flag_t flags)
{
mca_btl_base_verbose = 0;
(void) mca_base_var_register("ompi", "btl", "base", "verbose",
"Verbosity level of the BTL framework",
MCA_BASE_VAR_TYPE_INT, NULL, 0,
MCA_BASE_VAR_FLAG_SETTABLE,
OPAL_INFO_LVL_9,
MCA_BASE_VAR_SCOPE_LOCAL,
&mca_btl_base_verbose);
/* Override the per-BTL "don't run if THREAD_MULTIPLE selected"
embargo? */
mca_btl_base_thread_multiple_override = false;
@ -125,23 +113,15 @@ static int mca_btl_base_register(int flags)
* Function for finding and opening either all MCA components, or the one
* that was specifically requested via a MCA parameter.
*/
int mca_btl_base_open(void)
static int mca_btl_base_open(mca_base_open_flag_t flags)
{
int i;
if( ++mca_btl_base_already_opened > 1 ) return OMPI_SUCCESS;
(void) mca_btl_base_register(0);
/* Verbose output */
mca_btl_base_output = opal_output_open(NULL);
opal_output_set_verbosity(mca_btl_base_output, mca_btl_base_verbose);
int ret;
/* Open up all available components */
if (OMPI_SUCCESS !=
mca_base_components_open("btl", mca_btl_base_output, mca_btl_base_static_components,
&mca_btl_base_components_opened, true)) {
return OMPI_ERROR;
(ret = mca_base_framework_components_open(&ompi_btl_base_framework, flags))) {
return ret;
}
/* Initialize the list so that in mca_btl_base_close(), we can
@ -153,3 +133,39 @@ int mca_btl_base_open(void)
/* All done */
return OMPI_SUCCESS;
}
static int mca_btl_base_close(void)
{
mca_btl_base_selected_module_t *sm;
#if 0
/* disable event processing while cleaning up btls */
opal_event_disable();
#endif
/* Finalize all the btl components and free their list items */
OPAL_LIST_FOREACH(sm, &mca_btl_base_modules_initialized, mca_btl_base_selected_module_t) {
/* Blatently ignore the return code (what would we do to recover,
anyway? This component is going away, so errors don't matter
anymore) */
sm->btl_module->btl_finalize(sm->btl_module);
free(sm);
}
/* Close all remaining opened components (may be one if this is a
OMPI RTE program, or [possibly] multiple if this is ompi_info) */
(void) mca_base_framework_components_close(&ompi_btl_base_framework, NULL);
#if 0
/* restore event processing */
opal_event_enable();
#endif
/* All done */
return OMPI_SUCCESS;
}
MCA_BASE_FRAMEWORK_DECLARE(ompi, btl, "Byte Transport Layer", mca_btl_base_register,
mca_btl_base_open, mca_btl_base_close, mca_btl_base_static_components,
0);

View File

@ -53,8 +53,7 @@ int mca_btl_base_select(bool enable_progress_threads,
bool enable_mpi_threads)
{
int i, num_btls;
opal_list_item_t *item;
mca_base_component_list_item_t *cli;
mca_base_component_list_item_t *cli, *next;
mca_btl_base_component_t *component;
mca_btl_base_module_t **modules;
mca_btl_base_selected_module_t *sm;
@ -65,11 +64,7 @@ int mca_btl_base_select(bool enable_progress_threads,
/* Traverse the list of opened modules; call their init
functions. */
item = opal_list_get_first(&mca_btl_base_components_opened);
while(item != opal_list_get_end(&mca_btl_base_components_opened)) {
opal_list_item_t *next = opal_list_get_next(item);
cli = (mca_base_component_list_item_t *) item;
OPAL_LIST_FOREACH_SAFE(cli, next, &ompi_btl_base_framework.framework_components, mca_base_component_list_item_t) {
component = (mca_btl_base_component_t *) cli->cli_component;
/* if there is an include list - item must be in the list to be included */
@ -84,7 +79,6 @@ int mca_btl_base_select(bool enable_progress_threads,
argv++;
}
if(found == false) {
item = next;
continue;
}
@ -100,17 +94,16 @@ int mca_btl_base_select(bool enable_progress_threads,
argv++;
}
if(found == true) {
item = next;
continue;
}
}
opal_output_verbose(10, mca_btl_base_output,
opal_output_verbose(10, ompi_btl_base_framework.framework_output,
"select: initializing %s component %s",
component->btl_version.mca_type_name,
component->btl_version.mca_component_name);
if (NULL == component->btl_init) {
opal_output_verbose(10, mca_btl_base_output,
opal_output_verbose(10, ompi_btl_base_framework.framework_output,
"select: no init function; ignoring component %s",
component->btl_version.mca_component_name);
} else {
@ -121,21 +114,19 @@ int mca_btl_base_select(bool enable_progress_threads,
list and remove it from the component repository */
if (NULL == modules) {
opal_output_verbose(10, mca_btl_base_output,
opal_output_verbose(10, ompi_btl_base_framework.framework_output,
"select: init of component %s returned failure",
component->btl_version.mca_component_name);
opal_output_verbose(10, mca_btl_base_output,
"select: module %s unloaded",
component->btl_version.mca_component_name);
mca_base_component_repository_release((mca_base_component_t *) component);
opal_list_remove_item(&mca_btl_base_components_opened, item);
opal_list_remove_item(&ompi_btl_base_framework.framework_components, &cli->super);
mca_base_component_close((mca_base_component_t *) component,
ompi_btl_base_framework.framework_output);
}
/* Otherwise, if it initialized properly, save it. */
else {
opal_output_verbose(10, mca_btl_base_output,
opal_output_verbose(10, ompi_btl_base_framework.framework_output,
"select: init of component %s returned success",
component->btl_version.mca_component_name);
@ -158,7 +149,6 @@ int mca_btl_base_select(bool enable_progress_threads,
free(modules);
}
}
item = next;
}
/* Finished querying all components. Check for the bozo case. */

View File

@ -129,7 +129,7 @@ static int oob_component_query(mca_btl_openib_module_t *btl,
therefore we must be IB. */
#if defined(HAVE_STRUCT_IBV_DEVICE_TRANSPORT_TYPE) && defined(HAVE_IBV_LINK_LAYER_ETHERNET)
if (BTL_OPENIB_CONNECT_BASE_CHECK_IF_NOT_IB(btl)) {
opal_output_verbose(5, mca_btl_base_output,
opal_output_verbose(5, ompi_btl_base_framework.framework_output,
"openib BTL: oob CPC only supported on InfiniBand; skipped on %s:%d",
ibv_get_device_name(btl->device->ib_dev),
btl->port_num);
@ -138,7 +138,7 @@ static int oob_component_query(mca_btl_openib_module_t *btl,
#endif
if (mca_btl_openib_component.num_xrc_qps > 0) {
opal_output_verbose(5, mca_btl_base_output,
opal_output_verbose(5, ompi_btl_base_framework.framework_output,
"openib BTL: oob CPC not supported with XRC receive queues, please try xoob CPC; skipped on %s:%d",
ibv_get_device_name(btl->device->ib_dev),
btl->port_num);
@ -154,7 +154,7 @@ static int oob_component_query(mca_btl_openib_module_t *btl,
rml_recv_cb,
NULL);
if (OMPI_SUCCESS != rc) {
opal_output_verbose(5, mca_btl_base_output,
opal_output_verbose(5, ompi_btl_base_framework.framework_output,
"openib BTL: oob CPC system error %d (%s)",
rc, opal_strerror(rc));
return rc;
@ -166,7 +166,7 @@ static int oob_component_query(mca_btl_openib_module_t *btl,
if (NULL == *cpc) {
ompi_rte_recv_cancel(OMPI_NAME_WILDCARD, OMPI_RML_TAG_OPENIB);
rml_recv_posted = false;
opal_output_verbose(5, mca_btl_base_output,
opal_output_verbose(5, ompi_btl_base_framework.framework_output,
"openib BTL: oob CPC system error (malloc failed)");
return OMPI_ERR_OUT_OF_RESOURCE;
}
@ -188,7 +188,7 @@ static int oob_component_query(mca_btl_openib_module_t *btl,
(*cpc)->cbm_finalize = NULL;
(*cpc)->cbm_uses_cts = false;
opal_output_verbose(5, mca_btl_base_output,
opal_output_verbose(5, ompi_btl_base_framework.framework_output,
"openib BTL: oob CPC available for use on %s:%d",
ibv_get_device_name(btl->device->ib_dev),
btl->port_num);

View File

@ -1858,7 +1858,7 @@ static int rdmacm_component_query(mca_btl_openib_module_t *openib_btl, ompi_btl_
context = OBJ_NEW(id_context_t);
OPAL_OUTPUT((-1, "MAIN Server context: %p", (void*) context));
if (NULL == context) {
opal_output_verbose(5, mca_btl_base_output,
opal_output_verbose(5, ompi_btl_base_framework.framework_output,
"openib BTL: rdmacm CPC system error (malloc failed)");
rc = OMPI_ERR_OUT_OF_RESOURCE;
goto out3;
@ -1870,7 +1870,7 @@ static int rdmacm_component_query(mca_btl_openib_module_t *openib_btl, ompi_btl_
rc = rdma_create_id(event_channel, &(context->id), context, RDMA_PS_TCP);
if (0 != rc) {
opal_output_verbose(5, mca_btl_base_output,
opal_output_verbose(5, ompi_btl_base_framework.framework_output,
"openib BTL: rdmacm CPC failed to create ID");
rc = OMPI_ERR_OUT_OF_RESOURCE;
goto out4;
@ -1886,7 +1886,7 @@ static int rdmacm_component_query(mca_btl_openib_module_t *openib_btl, ompi_btl_
*/
rc = rdma_bind_addr(context->id, (struct sockaddr *)&sin);
if (0 != rc) {
opal_output_verbose(5, mca_btl_base_output,
opal_output_verbose(5, ompi_btl_base_framework.framework_output,
"openib BTL: rdmacm CPC unable to bind to address");
rc = OMPI_ERR_UNREACH;
goto out5;
@ -1896,7 +1896,7 @@ static int rdmacm_component_query(mca_btl_openib_module_t *openib_btl, ompi_btl_
cannot use the cpc */
rc = ipaddrcheck(context, openib_btl);
if (OMPI_SUCCESS != rc) {
opal_output_verbose(5, mca_btl_base_output,
opal_output_verbose(5, ompi_btl_base_framework.framework_output,
"openib BTL: rdmacm IP address not found on port");
rc = OMPI_ERR_NOT_SUPPORTED;
goto out5;
@ -1908,7 +1908,7 @@ static int rdmacm_component_query(mca_btl_openib_module_t *openib_btl, ompi_btl_
mca_btl_openib_component.num_qps) */
rc = rdma_listen(context->id, 1024);
if (0 != rc) {
opal_output_verbose(5, mca_btl_base_output,
opal_output_verbose(5, ompi_btl_base_framework.framework_output,
"openib BTL: rdmacm CPC unable to listen");
rc = OMPI_ERR_UNREACH;
goto out5;
@ -1916,7 +1916,7 @@ static int rdmacm_component_query(mca_btl_openib_module_t *openib_btl, ompi_btl_
rc = create_message(server, openib_btl, &(*cpc)->data);
if (0 != rc) {
opal_output_verbose(5, mca_btl_base_output,
opal_output_verbose(5, ompi_btl_base_framework.framework_output,
"openib BTL: rdmacm CPC unable to create message");
rc = OMPI_ERR_OUT_OF_RESOURCE;
goto out5;
@ -1924,7 +1924,7 @@ static int rdmacm_component_query(mca_btl_openib_module_t *openib_btl, ompi_btl_
opal_list_append(&server_listener_list, &(server->super));
opal_output_verbose(5, mca_btl_base_output,
opal_output_verbose(5, ompi_btl_base_framework.framework_output,
"openib BTL: rdmacm CPC available for use on %s:%d",
ibv_get_device_name(openib_btl->device->ib_dev),
openib_btl->port_num);
@ -1945,12 +1945,12 @@ out1:
free(*cpc);
out:
if (OMPI_ERR_NOT_SUPPORTED == rc) {
opal_output_verbose(5, mca_btl_base_output,
opal_output_verbose(5, ompi_btl_base_framework.framework_output,
"openib BTL: rdmacm CPC unavailable for use on %s:%d; skipped",
ibv_get_device_name(openib_btl->device->ib_dev),
openib_btl->port_num);
} else {
opal_output_verbose(5, mca_btl_base_output,
opal_output_verbose(5, ompi_btl_base_framework.framework_output,
"openib BTL: rmacm CPC unavailable for use on %s:%d; fatal error %d (%s)",
ibv_get_device_name(openib_btl->device->ib_dev),
openib_btl->port_num, rc,
@ -2036,14 +2036,14 @@ static int rdmacm_component_init(void)
rc = mca_btl_openib_build_rdma_addr_list();
if (OMPI_SUCCESS != rc) {
opal_output_verbose(5, mca_btl_base_output,
opal_output_verbose(5, ompi_btl_base_framework.framework_output,
"openib BTL: rdmacm CPC unable to find any valid IP address");
return OMPI_ERR_NOT_SUPPORTED;
}
event_channel = rdma_create_event_channel();
if (NULL == event_channel) {
opal_output_verbose(5, mca_btl_base_output,
opal_output_verbose(5, ompi_btl_base_framework.framework_output,
"openib BTL: rdmacm CPC failed to create channel");
return OMPI_ERR_UNREACH;
}

View File

@ -1006,7 +1006,7 @@ static int xoob_component_query(mca_btl_openib_module_t *openib_btl,
int rc;
if (mca_btl_openib_component.num_xrc_qps <= 0) {
opal_output_verbose(5, mca_btl_base_output,
opal_output_verbose(5, ompi_btl_base_framework.framework_output,
"openib BTL: xoob CPC only supported with XRC receive queues; skipped on %s:%d",
ibv_get_device_name(openib_btl->device->ib_dev),
openib_btl->port_num);
@ -1015,7 +1015,7 @@ static int xoob_component_query(mca_btl_openib_module_t *openib_btl,
*cpc = malloc(sizeof(ompi_btl_openib_connect_base_module_t));
if (NULL == *cpc) {
opal_output_verbose(5, mca_btl_base_output,
opal_output_verbose(5, ompi_btl_base_framework.framework_output,
"openib BTL: xoob CPC system error (malloc failed)");
return OMPI_ERR_OUT_OF_RESOURCE;
}
@ -1030,7 +1030,7 @@ static int xoob_component_query(mca_btl_openib_module_t *openib_btl,
xoob_rml_recv_cb,
NULL);
if (OMPI_SUCCESS != rc) {
opal_output_verbose(5, mca_btl_base_output,
opal_output_verbose(5, ompi_btl_base_framework.framework_output,
"openib BTL: xoob CPC system error %d (%s)",
rc, opal_strerror(rc));
return rc;
@ -1055,7 +1055,7 @@ static int xoob_component_query(mca_btl_openib_module_t *openib_btl,
(*cpc)->cbm_finalize = NULL;
(*cpc)->cbm_uses_cts = false;
opal_output_verbose(5, mca_btl_base_output,
opal_output_verbose(5, ompi_btl_base_framework.framework_output,
"openib BTL: xoob CPC available for use on %s:%d",
ibv_get_device_name(openib_btl->device->ib_dev),
openib_btl->port_num);

View File

@ -544,7 +544,7 @@ static char **split_and_resolve(char **orig_str, char *name)
free(tmp);
continue;
}
opal_output_verbose(20, mca_btl_base_output,
opal_output_verbose(20, ompi_btl_base_framework.framework_output,
"btl: tcp: Searching for %s address+prefix: %s / %u",
name,
opal_net_get_hostname((struct sockaddr*) &argv_inaddr),
@ -575,7 +575,7 @@ static char **split_and_resolve(char **orig_str, char *name)
/* We found a match; get the name and replace it in the
argv */
opal_ifindextoname(if_index, if_name, sizeof(if_name));
opal_output_verbose(20, mca_btl_base_output,
opal_output_verbose(20, ompi_btl_base_framework.framework_output,
"btl: tcp: Found match: %s (%s)",
opal_net_get_hostname((struct sockaddr*) &if_inaddr),
if_name);

View File

@ -605,7 +605,7 @@ static int mca_btl_tcp_endpoint_start_connect(mca_btl_base_endpoint_t* btl_endpo
/* start the connect - will likely fail with EINPROGRESS */
mca_btl_tcp_proc_tosocks(btl_endpoint->endpoint_addr, &endpoint_addr);
opal_output_verbose(20, mca_btl_base_output,
opal_output_verbose(20, ompi_btl_base_framework.framework_output,
"btl: tcp: attempting to connect() to %s address %s on port %d",
OMPI_NAME_PRINT(&btl_endpoint->endpoint_proc->proc_ompi->proc_name),
opal_net_get_hostname((struct sockaddr*) &endpoint_addr),

View File

@ -23,8 +23,7 @@ headers += \
base/coll_tags.h
libmca_coll_la_SOURCES += \
base/coll_base_close.c \
base/coll_base_comm_select.c \
base/coll_base_comm_unselect.c \
base/coll_base_find_available.c \
base/coll_base_open.c
base/coll_base_frame.c

View File

@ -35,34 +35,13 @@
#include "mpi.h"
#include "opal/class/opal_list.h"
#include "opal/mca/base/base.h"
/*
* Global functions for MCA overall collective open and close
*/
BEGIN_C_DECLS
/**
* Initialize the coll MCA framework
*
* @retval OMPI_SUCCESS Upon success
* @retval OMPI_ERROR Upon failure
*
* This must be the first function invoked in the coll MCA
* framework. It initializes the coll MCA framework, finds and
* opens coll components, etc.
*
* This function is invoked during ompi_mpi_init() and during the
* initialization of the special case of the laminfo command.
*
* This function fills in the internal global variable
* mca_coll_base_components_opened, which is a list of all coll components
* that were successfully opened. This variable should \em only be
* used by other coll base functions -- it is not considered a
* public interface member -- and is only mentioned here for
* completeness.
*/
OMPI_DECLSPEC int mca_coll_base_open(void);
/**
* Create list of available coll components.
@ -79,15 +58,10 @@ OMPI_DECLSPEC int mca_coll_base_open(void);
* successfully opened coll components and create a list of all
* available coll components.
*
* This function traverses the (internal global variable)
* mca_coll_base_components_opened list and queries each component to see
* if it ever might want to run during this MPI process. It creates
* another internal global variable list named
* mca_coll_base_components_available, consisting of a list of components
* that are available for selection when communicators are created.
* This variable should \em only be used by other coll base
* functions -- it is not considered a public interface member --
* and is only mentioned here for completeness.
* This function traverses the (internal global variable) framework components
* list and queries each component to see if it ever might want to run during
* this MPI process. If a component does not want to run it is closed and
* removed from the framework components list.
*/
int mca_coll_base_find_available(bool enable_progress_threads,
bool enable_mpi_threads);
@ -147,55 +121,10 @@ int mca_coll_base_comm_select(struct ompi_communicator_t *comm);
*/
int mca_coll_base_comm_unselect(struct ompi_communicator_t *comm);
/**
* Shut down the coll MCA framework.
*
* @retval OMPI_SUCCESS Always
*
* This function shuts down everything in the coll MCA framework,
* and is called during ompi_mpi_finalize() and the special case of
* the laminfo command.
*
* It must be the last function invoked on the coll MCA framework.
*/
OMPI_DECLSPEC int mca_coll_base_close(void);
/*
* Globals
*/
/**
* Coll framework debugging stream ID used with opal_output() and
* opal_output_verbose().
*/
OMPI_DECLSPEC extern int mca_coll_base_output;
/**
* Indicator as to whether the list of opened coll components is valid or
* not.
*/
extern bool mca_coll_base_components_opened_valid;
/**
* List of all opened components; created when the coll framework is
* initialized and destroyed when we reduce the list to all available
* coll components.
*/
OMPI_DECLSPEC extern opal_list_t mca_coll_base_components_opened;
/**
* Indicator as to whether the list of available coll components is valid
* or not.
*/
extern bool mca_coll_base_components_available_valid;
/**
* List of all available components; created by reducing the list of open
* components to all those who indicate that they may run during this
* process.
*/
extern opal_list_t mca_coll_base_components_available;
OMPI_DECLSPEC extern mca_base_framework_t ompi_coll_base_framework;
END_C_DECLS
#endif /* MCA_BASE_COLL_H */

View File

@ -1,55 +0,0 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2005 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$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "ompi_config.h"
#include <stdio.h>
#include "ompi/constants.h"
#include "opal/mca/mca.h"
#include "opal/mca/base/base.h"
#include "ompi/mca/coll/base/base.h"
#include "opal/util/output.h"
int mca_coll_base_close(void)
{
/* Close all components that are still open. This may be the opened
* list (if we're in ompi_info), or it may be the available list (if
* we're anywhere else). */
if (mca_coll_base_components_opened_valid) {
mca_base_components_close(mca_coll_base_output,
&mca_coll_base_components_opened, NULL);
OBJ_DESTRUCT(&mca_coll_base_components_opened);
mca_coll_base_components_opened_valid = false;
} else if (mca_coll_base_components_available_valid) {
mca_base_components_close(mca_coll_base_output,
&mca_coll_base_components_available,
NULL);
OBJ_DESTRUCT(&mca_coll_base_components_available);
mca_coll_base_components_available_valid = false;
}
/* Close the framework output */
opal_output_close (mca_coll_base_output);
mca_coll_base_output = -1;
/* All done */
return OMPI_SUCCESS;
}

View File

@ -101,7 +101,7 @@ int mca_coll_base_comm_select(ompi_communicator_t * comm)
int ret;
/* Announce */
opal_output_verbose(10, mca_coll_base_output,
opal_output_verbose(10, ompi_coll_base_framework.framework_output,
"coll:base:comm_select: new communicator: %s (cid %d)",
comm->c_name, comm->c_contextid);
@ -109,9 +109,9 @@ int mca_coll_base_comm_select(ompi_communicator_t * comm)
* sentinel values */
memset(&comm->c_coll, 0, sizeof(mca_coll_base_comm_coll_t));
opal_output_verbose(10, mca_coll_base_output,
opal_output_verbose(10, ompi_coll_base_framework.framework_output,
"coll:base:comm_select: Checking all available modules");
selectable = check_components(&mca_coll_base_components_available, comm);
selectable = check_components(&ompi_coll_base_framework.framework_components, comm);
/* Upon return from the above, the modules list will contain the
list of modules that returned (priority >= 0). If we have no
@ -225,6 +225,19 @@ int mca_coll_base_comm_select(ompi_communicator_t * comm)
return OMPI_SUCCESS;
}
static int avail_coll_compare (opal_list_item_t **a,
opal_list_item_t **b) {
avail_coll_t *acoll = (avail_coll_t *) *a;
avail_coll_t *bcoll = (avail_coll_t *) *b;
if (acoll->ac_priority > bcoll->ac_priority) {
return 1;
} else if (acoll->ac_priority < bcoll->ac_priority) {
return -1;
}
return 0;
}
/*
* For each module in the list, check and see if it wants to run, and
@ -237,53 +250,29 @@ static opal_list_t *check_components(opal_list_t * components,
{
int priority;
const mca_base_component_t *component;
opal_list_item_t *item, *item2;
mca_base_component_list_item_t *cli;
mca_coll_base_module_2_0_0_t *module;
opal_list_t *selectable;
avail_coll_t *avail, *avail2;
avail_coll_t *avail;
/* Make a list of the components that query successfully */
selectable = OBJ_NEW(opal_list_t);
/* Scan through the list of components. This nested loop is
O(N^2), but we should never have too many components, so this
*hopefully* shouldn't matter... */
for (item = opal_list_get_first(components);
item != opal_list_get_end(components);
item = opal_list_get_next(item)) {
component = ((mca_base_component_priority_list_item_t *)
item)->super.cli_component;
/* Scan through the list of components */
OPAL_LIST_FOREACH(cli, &ompi_coll_base_framework.framework_components, mca_base_component_list_item_t) {
component = cli->cli_component;
priority = check_one_component(comm, component, &module);
if (priority >= 0) {
/* We have a component that indicated that it wants to run
by giving us a module */
avail = OBJ_NEW(avail_coll_t);
avail->ac_priority = priority;
avail->ac_module = module;
/* Put this item on the list in priority order (lowest
priority first). Should it go first? */
for (item2 = opal_list_get_first(selectable);
item2 != opal_list_get_end(selectable);
item2 = opal_list_get_next(item2)) {
avail2 = (avail_coll_t *) item2;
if (avail->ac_priority < avail2->ac_priority) {
opal_list_insert_pos(selectable,
item2,
(opal_list_item_t *) avail);
break;
}
}
if (opal_list_get_end(selectable) == item2) {
opal_list_append(selectable,
(opal_list_item_t *) avail);
}
opal_list_append(selectable, &avail->super);
}