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.
Этот коммит содержится в:
Nathan Hjelm 2013-03-27 21:17:31 +00:00
родитель c041156f60
Коммит 9d4a26f47d
197 изменённых файлов: 1553 добавлений и 5103 удалений

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

@ -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";
}

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

@ -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) {

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

@ -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

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

@ -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

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

@ -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);

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

@ -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;
}

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

@ -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 */

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

@ -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 */

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

@ -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

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

@ -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 */

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

@ -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();
}

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

@ -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);
}

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

@ -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,
return mca_base_framework_components_close(&ompi_bml_base_framework,
(mca_base_component_t*) best_component);
}
}

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

@ -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;
}

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

@ -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

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

@ -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 */

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

@ -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;
}

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

@ -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);

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

@ -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. */

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

@ -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);

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

@ -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;
}

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

@ -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);

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

@ -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);

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

@ -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),

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

@ -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

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

@ -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 */

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

@ -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;
}

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

@ -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,51 +250,27 @@ 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);
}
}
@ -291,6 +280,9 @@ static opal_list_t *check_components(opal_list_t * components,
return NULL;
}
/* Put this list in priority order */
opal_list_sort(selectable, avail_coll_compare);
/* All done */
return selectable;
}
@ -310,13 +302,13 @@ static int check_one_component(ompi_communicator_t * comm,
if (OMPI_SUCCESS == err) {
priority = (priority < 100) ? priority : 100;
opal_output_verbose(10, mca_coll_base_output,
opal_output_verbose(10, ompi_coll_base_framework.framework_output,
"coll:base:comm_select: component available: %s, priority: %d",
component->mca_component_name, priority);
} else {
priority = -1;
opal_output_verbose(10, mca_coll_base_output,
opal_output_verbose(10, ompi_coll_base_framework.framework_output,
"coll:base:comm_select: component not available: %s",
component->mca_component_name);
}

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

@ -38,24 +38,14 @@
#include "ompi/mca/coll/coll.h"
#include "ompi/mca/coll/base/base.h"
/*
* Global variables
*/
bool mca_coll_base_components_available_valid = false;
opal_list_t mca_coll_base_components_available;
/*
* Private functions
*/
static int init_query(const mca_base_component_t * ls,
mca_base_component_priority_list_item_t * entry,
bool enable_progress_threads,
bool enable_mpi_threads);
static int init_query_2_0_0(const mca_base_component_t * ls,
mca_base_component_priority_list_item_t *
entry, bool enable_progress_threads,
bool enable_progress_threads,
bool enable_mpi_threads);
/*
@ -74,65 +64,33 @@ static int init_query_2_0_0(const mca_base_component_t * ls,
int mca_coll_base_find_available(bool enable_progress_threads,
bool enable_mpi_threads)
{
bool found = false;
mca_base_component_priority_list_item_t *entry;
opal_list_item_t *p;
mca_base_component_list_item_t *cli, *next;
const mca_base_component_t *component;
/* Initialize the list */
OBJ_CONSTRUCT(&mca_coll_base_components_available, opal_list_t);
mca_coll_base_components_available_valid = true;
/* The list of components that we should check has already been
established in mca_coll_base_open. */
for (found = false,
p = opal_list_remove_first(&mca_coll_base_components_opened);
p != NULL;
p = opal_list_remove_first(&mca_coll_base_components_opened)) {
component = ((mca_base_component_list_item_t *) p)->cli_component;
OPAL_LIST_FOREACH_SAFE(cli, next, &ompi_coll_base_framework.framework_components, mca_base_component_list_item_t) {
component = cli->cli_component;
/* Call a subroutine to do the work, because the component may
represent different versions of the coll MCA. */
entry = OBJ_NEW(mca_base_component_priority_list_item_t);
entry->super.cli_component = component;
entry->cpli_priority = 0;
if (OMPI_SUCCESS == init_query(component, entry,
enable_progress_threads,
if (OMPI_SUCCESS != init_query(component, enable_progress_threads,
enable_mpi_threads)) {
opal_list_append(&mca_coll_base_components_available,
(opal_list_item_t *) entry);
found = true;
} else {
/* If the component doesn't want to run, then close it.
It's already had its close() method invoked; now close
it out of the DSO repository (if it's there). */
mca_base_component_repository_release(component);
OBJ_RELEASE(entry);
Now close it out and release it from the DSO repository (if it's there). */
opal_list_remove_item(&ompi_coll_base_framework.framework_components, &cli->super);
mca_base_component_close(component, ompi_coll_base_framework.framework_output);
OBJ_RELEASE(cli);
}
/* Free the entry from the "opened" list */
OBJ_RELEASE(p);
}
/* The opened list is now no longer useful and we can free it */
OBJ_DESTRUCT(&mca_coll_base_components_opened);
mca_coll_base_components_opened_valid = false;
/* If we have no collective components available, it's an error.
Thanks for playing! */
if (!found) {
/* Need to free all items in the list */
OBJ_DESTRUCT(&mca_coll_base_components_available);
mca_coll_base_components_available_valid = false;
opal_output_verbose(10, mca_coll_base_output,
if (opal_list_get_size(&ompi_coll_base_framework.framework_components) == 0) {
opal_output_verbose(10, ompi_coll_base_framework.framework_output,
"coll:find_available: no coll components available!");
opal_show_help("help-mca-base", "find-available:none-found", true,
"coll");
@ -150,12 +108,11 @@ int mca_coll_base_find_available(bool enable_progress_threads,
* some information. If it doesn't, close it.
*/
static int init_query(const mca_base_component_t * component,
mca_base_component_priority_list_item_t * entry,
bool enable_progress_threads, bool enable_mpi_threads)
{
int ret;
opal_output_verbose(10, mca_coll_base_output,
opal_output_verbose(10, ompi_coll_base_framework.framework_output,
"coll:find_available: querying coll component %s",
component->mca_component_name);
@ -165,12 +122,12 @@ static int init_query(const mca_base_component_t * component,
if (2 == component->mca_type_major_version &&
0 == component->mca_type_minor_version &&
0 == component->mca_type_release_version) {
ret = init_query_2_0_0(component, entry, enable_progress_threads,
ret = init_query_2_0_0(component, enable_progress_threads,
enable_mpi_threads);
} else {
/* Unrecognized coll API version */
opal_output_verbose(10, mca_coll_base_output,
opal_output_verbose(10, ompi_coll_base_framework.framework_output,
"coll:find_available: unrecognized coll API version (%d.%d.%d, ignored)",
component->mca_type_major_version,
component->mca_type_minor_version,
@ -181,14 +138,11 @@ static int init_query(const mca_base_component_t * component,
/* Query done -- look at the return value to see what happened */
if (OMPI_SUCCESS != ret) {
opal_output_verbose(10, mca_coll_base_output,
opal_output_verbose(10, ompi_coll_base_framework.framework_output,
"coll:find_available: coll component %s is not available",
component->mca_component_name);
if (NULL != component->mca_close_component) {
component->mca_close_component();
}
} else {
opal_output_verbose(10, mca_coll_base_output,
opal_output_verbose(10, ompi_coll_base_framework.framework_output,
"coll:find_available: coll component %s is available",
component->mca_component_name);
}
@ -203,7 +157,6 @@ static int init_query(const mca_base_component_t * component,
* Query a specific component, coll v2.0.0
*/
static int init_query_2_0_0(const mca_base_component_t * component,
mca_base_component_priority_list_item_t * entry,
bool enable_progress_threads,
bool enable_mpi_threads)
{

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

@ -36,19 +36,6 @@
*/
#include "ompi/mca/coll/base/static-components.h"
/*
* Global variables; most of which are loaded by back-ends of MCA
* variables
*/
int mca_coll_base_output = -1;
int mca_coll_base_crossover = 4;
int mca_coll_base_associative = 1;
bool mca_coll_base_components_opened_valid = false;
opal_list_t mca_coll_base_components_opened;
/*
* Ensure all function pointers are NULL'ed out to start with
*/
@ -102,27 +89,5 @@ static void coll_base_module_construct(mca_coll_base_module_t *m)
OBJ_CLASS_INSTANCE(mca_coll_base_module_t, opal_object_t,
coll_base_module_construct, NULL);
/*
* Function for finding and opening either all MCA components, or the one
* that was specifically requested via a MCA parameter.
*/
int mca_coll_base_open(void)
{
/* Open an output stream for this framework */
mca_coll_base_output = opal_output_open(NULL);
/* Open up all available components */
if (OMPI_SUCCESS !=
mca_base_components_open("coll", mca_coll_base_output,
mca_coll_base_static_components,
&mca_coll_base_components_opened, true)) {
return OMPI_ERROR;
}
mca_coll_base_components_opened_valid = true;
/* All done */
return OMPI_SUCCESS;
}
MCA_BASE_FRAMEWORK_DECLARE(ompi, coll, "Collectives", NULL, NULL, NULL,
mca_coll_base_static_components, 0);

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

@ -40,7 +40,7 @@ int mca_coll_demo_allgather_intra(void *sbuf, int scount,
mca_coll_base_module_t *module)
{
mca_coll_demo_module_t *demo_module = (mca_coll_demo_module_t*) module;
opal_output_verbose(10, mca_coll_base_output, "In demo allgather_intra");
opal_output_verbose(10, ompi_coll_base_framework.framework_output, "In demo allgather_intra");
return demo_module->underlying.coll_allgather(sbuf, scount, sdtype, rbuf,
rcount, rdtype, comm,
demo_module->underlying.coll_allgather_module);
@ -62,7 +62,7 @@ int mca_coll_demo_allgather_inter(void *sbuf, int scount,
mca_coll_base_module_t *module)
{
mca_coll_demo_module_t *demo_module = (mca_coll_demo_module_t*) module;
opal_output_verbose(10, mca_coll_base_output, "In demo allgather_inter");
opal_output_verbose(10, ompi_coll_base_framework.framework_output, "In demo allgather_inter");
return demo_module->underlying.coll_allgather(sbuf, scount, sdtype, rbuf,
rcount, rdtype, comm,
demo_module->underlying.coll_allgather_module);

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

@ -41,7 +41,7 @@ int mca_coll_demo_allgatherv_intra(void *sbuf, int scount,
mca_coll_base_module_t *module)
{
mca_coll_demo_module_t *demo_module = (mca_coll_demo_module_t*) module;
opal_output_verbose(10, mca_coll_base_output, "In demo allgatherv_intra");
opal_output_verbose(10, ompi_coll_base_framework.framework_output, "In demo allgatherv_intra");
return demo_module->underlying.coll_allgatherv(sbuf, scount, sdtype,
rbuf, rcounts, disps,
rdtype, comm,
@ -64,7 +64,7 @@ int mca_coll_demo_allgatherv_inter(void *sbuf, int scount,
mca_coll_base_module_t *module)
{
mca_coll_demo_module_t *demo_module = (mca_coll_demo_module_t*) module;
opal_output_verbose(10, mca_coll_base_output, "In demo allgatherv_inter");
opal_output_verbose(10, ompi_coll_base_framework.framework_output, "In demo allgatherv_inter");
return demo_module->underlying.coll_allgatherv(sbuf, scount, sdtype,
rbuf, rcounts, disps,
rdtype, comm,

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

@ -40,7 +40,7 @@ int mca_coll_demo_allreduce_intra(void *sbuf, void *rbuf, int count,
mca_coll_base_module_t *module)
{
mca_coll_demo_module_t *demo_module = (mca_coll_demo_module_t*) module;
opal_output_verbose(10, mca_coll_base_output, "In demo allreduce_intra");
opal_output_verbose(10, ompi_coll_base_framework.framework_output, "In demo allreduce_intra");
return demo_module->underlying.coll_allreduce(sbuf, rbuf, count, dtype,
op, comm,
demo_module->underlying.coll_allreduce_module);
@ -61,7 +61,7 @@ int mca_coll_demo_allreduce_inter(void *sbuf, void *rbuf, int count,
mca_coll_base_module_t *module)
{
mca_coll_demo_module_t *demo_module = (mca_coll_demo_module_t*) module;
opal_output_verbose(10, mca_coll_base_output, "In demo allreduce_inter");
opal_output_verbose(10, ompi_coll_base_framework.framework_output, "In demo allreduce_inter");
return demo_module->underlying.coll_allreduce(sbuf, rbuf, count, dtype,
op, comm,
demo_module->underlying.coll_allreduce_module);

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

@ -41,7 +41,7 @@ int mca_coll_demo_alltoall_intra(void *sbuf, int scount,
mca_coll_base_module_t *module)
{
mca_coll_demo_module_t *demo_module = (mca_coll_demo_module_t*) module;
opal_output_verbose(10, mca_coll_base_output, "In demo alltoall_intra\n");
opal_output_verbose(10, ompi_coll_base_framework.framework_output, "In demo alltoall_intra\n");
return demo_module->underlying.coll_alltoall(sbuf, scount, sdtype,
rbuf, rcount, rdtype,
comm,
@ -64,7 +64,7 @@ int mca_coll_demo_alltoall_inter(void *sbuf, int scount,
mca_coll_base_module_t *module)
{
mca_coll_demo_module_t *demo_module = (mca_coll_demo_module_t*) module;
opal_output_verbose(10, mca_coll_base_output, "In demo alltoall_inter\n");
opal_output_verbose(10, ompi_coll_base_framework.framework_output, "In demo alltoall_inter\n");
return demo_module->underlying.coll_alltoall(sbuf, scount, sdtype,
rbuf, rcount, rdtype,
comm,

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

@ -42,7 +42,7 @@ mca_coll_demo_alltoallv_intra(void *sbuf, int *scounts, int *sdisps,
mca_coll_base_module_t *module)
{
mca_coll_demo_module_t *demo_module = (mca_coll_demo_module_t*) module;
opal_output_verbose(10, mca_coll_base_output, "In demo alltoallv_intra");
opal_output_verbose(10, ompi_coll_base_framework.framework_output, "In demo alltoallv_intra");
return demo_module->underlying.coll_alltoallv(sbuf, scounts, sdisps,
sdtype, rbuf, rcounts,
rdisps, rdtype, comm,
@ -66,7 +66,7 @@ mca_coll_demo_alltoallv_inter(void *sbuf, int *scounts, int *sdisps,
mca_coll_base_module_t *module)
{
mca_coll_demo_module_t *demo_module = (mca_coll_demo_module_t*) module;
opal_output_verbose(10, mca_coll_base_output, "In demo alltoallv_inter");
opal_output_verbose(10, ompi_coll_base_framework.framework_output, "In demo alltoallv_inter");
return demo_module->underlying.coll_alltoallv(sbuf, scounts, sdisps,
sdtype, rbuf, rcounts,
rdisps, rdtype, comm,

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

@ -41,7 +41,7 @@ int mca_coll_demo_alltoallw_intra(void *sbuf, int *scounts, int *sdisps,
mca_coll_base_module_t *module)
{
mca_coll_demo_module_t *demo_module = (mca_coll_demo_module_t*) module;
opal_output_verbose(10, mca_coll_base_output, "In demo alltoallw_intra");
opal_output_verbose(10, ompi_coll_base_framework.framework_output, "In demo alltoallw_intra");
return demo_module->underlying.coll_alltoallw(sbuf, scounts, sdisps,
sdtypes, rbuf, rcounts,
rdisps, rdtypes, comm,
@ -64,7 +64,7 @@ int mca_coll_demo_alltoallw_inter(void *sbuf, int *scounts, int *sdisps,
mca_coll_base_module_t *module)
{
mca_coll_demo_module_t *demo_module = (mca_coll_demo_module_t*) module;
opal_output_verbose(10, mca_coll_base_output, "In demo alltoallw_inter");
opal_output_verbose(10, ompi_coll_base_framework.framework_output, "In demo alltoallw_inter");
return demo_module->underlying.coll_alltoallw(sbuf, scounts, sdisps,
sdtypes, rbuf, rcounts,
rdisps, rdtypes, comm,

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

@ -37,7 +37,7 @@ int mca_coll_demo_barrier_intra(struct ompi_communicator_t *comm,
mca_coll_base_module_t *module)
{
mca_coll_demo_module_t *demo_module = (mca_coll_demo_module_t*) module;
opal_output_verbose(10, mca_coll_base_output, "In demo barrier_intra");
opal_output_verbose(10, ompi_coll_base_framework.framework_output, "In demo barrier_intra");
return demo_module->underlying.coll_barrier(comm,
demo_module->underlying.coll_barrier_module);
}
@ -54,7 +54,7 @@ int mca_coll_demo_barrier_inter(struct ompi_communicator_t *comm,
mca_coll_base_module_t *module)
{
mca_coll_demo_module_t *demo_module = (mca_coll_demo_module_t*) module;
opal_output_verbose(10, mca_coll_base_output, "In demo barrier_inter");
opal_output_verbose(10, ompi_coll_base_framework.framework_output, "In demo barrier_inter");
return demo_module->underlying.coll_barrier(comm,
demo_module->underlying.coll_barrier_module);
}

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

@ -39,7 +39,7 @@ int mca_coll_demo_bcast_intra(void *buff, int count,
mca_coll_base_module_t *module)
{
mca_coll_demo_module_t *demo_module = (mca_coll_demo_module_t*) module;
opal_output_verbose(10, mca_coll_base_output, "In demo bcast_intra");
opal_output_verbose(10, ompi_coll_base_framework.framework_output, "In demo bcast_intra");
return demo_module->underlying.coll_bcast(buff, count, datatype,
root, comm,
demo_module->underlying.coll_bcast_module);
@ -59,7 +59,7 @@ int mca_coll_demo_bcast_inter(void *buff, int count,
mca_coll_base_module_t *module)
{
mca_coll_demo_module_t *demo_module = (mca_coll_demo_module_t*) module;
opal_output_verbose(10, mca_coll_base_output, "In demo bcast_inter");
opal_output_verbose(10, ompi_coll_base_framework.framework_output, "In demo bcast_inter");
return demo_module->underlying.coll_bcast(buff, count, datatype,
root, comm,
demo_module->underlying.coll_bcast_module);

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

@ -40,7 +40,7 @@ int mca_coll_demo_exscan_intra(void *sbuf, void *rbuf, int count,
mca_coll_base_module_t *module)
{
mca_coll_demo_module_t *demo_module = (mca_coll_demo_module_t*) module;
opal_output_verbose(10, mca_coll_base_output, "In demo exscan_intra");
opal_output_verbose(10, ompi_coll_base_framework.framework_output, "In demo exscan_intra");
return demo_module->underlying.coll_exscan(sbuf, rbuf, count, dtype,
op, comm,
demo_module->underlying.coll_exscan_module);

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

@ -40,7 +40,7 @@ int mca_coll_demo_gather_intra(void *sbuf, int scount,
mca_coll_base_module_t *module)
{
mca_coll_demo_module_t *demo_module = (mca_coll_demo_module_t*) module;
opal_output_verbose(10, mca_coll_base_output, "In demo gather_intra");
opal_output_verbose(10, ompi_coll_base_framework.framework_output, "In demo gather_intra");
return demo_module->underlying.coll_gather(sbuf, scount, sdtype,
rbuf, rcount, rdtype,
root, comm,
@ -63,7 +63,7 @@ int mca_coll_demo_gather_inter(void *sbuf, int scount,
mca_coll_base_module_t *module)
{
mca_coll_demo_module_t *demo_module = (mca_coll_demo_module_t*) module;
opal_output_verbose(10, mca_coll_base_output, "In demo gather_inter");
opal_output_verbose(10, ompi_coll_base_framework.framework_output, "In demo gather_inter");
return demo_module->underlying.coll_gather(sbuf, scount, sdtype,
rbuf, rcount, rdtype,
root, comm,

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

@ -41,7 +41,7 @@ int mca_coll_demo_gatherv_intra(void *sbuf, int scount,
mca_coll_base_module_t *module)
{
mca_coll_demo_module_t *demo_module = (mca_coll_demo_module_t*) module;
opal_output_verbose(10, mca_coll_base_output, "In demo gatherv_intra");
opal_output_verbose(10, ompi_coll_base_framework.framework_output, "In demo gatherv_intra");
return demo_module->underlying.coll_gatherv(sbuf, scount, sdtype,
rbuf, rcounts, disps,
rdtype, root, comm,
@ -64,7 +64,7 @@ int mca_coll_demo_gatherv_inter(void *sbuf, int scount,
mca_coll_base_module_t *module)
{
mca_coll_demo_module_t *demo_module = (mca_coll_demo_module_t*) module;
opal_output_verbose(10, mca_coll_base_output, "In demo gatherv_inter");
opal_output_verbose(10, ompi_coll_base_framework.framework_output, "In demo gatherv_inter");
return demo_module->underlying.coll_gatherv(sbuf, scount, sdtype,
rbuf, rcounts, disps,
rdtype, root, comm,

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

@ -40,7 +40,7 @@ int mca_coll_demo_reduce_intra(void *sbuf, void *rbuf, int count,
mca_coll_base_module_t *module)
{
mca_coll_demo_module_t *demo_module = (mca_coll_demo_module_t*) module;
opal_output_verbose(10, mca_coll_base_output, "In demo reduce_intra");
opal_output_verbose(10, ompi_coll_base_framework.framework_output, "In demo reduce_intra");
return demo_module->underlying.coll_reduce(sbuf, rbuf, count, dtype,
op, root, comm,
demo_module->underlying.coll_reduce_module);
@ -61,7 +61,7 @@ int mca_coll_demo_reduce_inter(void *sbuf, void *rbuf, int count,
mca_coll_base_module_t *module)
{
mca_coll_demo_module_t *demo_module = (mca_coll_demo_module_t*) module;
opal_output_verbose(10, mca_coll_base_output, "In demo reduce_inter");
opal_output_verbose(10, ompi_coll_base_framework.framework_output, "In demo reduce_inter");
return demo_module->underlying.coll_reduce(sbuf, rbuf, count, dtype,
op, root, comm,
demo_module->underlying.coll_reduce_module);

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

@ -40,7 +40,7 @@ int mca_coll_demo_reduce_scatter_intra(void *sbuf, void *rbuf, int *rcounts,
mca_coll_base_module_t *module)
{
mca_coll_demo_module_t *demo_module = (mca_coll_demo_module_t*) module;
opal_output_verbose(10, mca_coll_base_output, "In demo scatter_intra");
opal_output_verbose(10, ompi_coll_base_framework.framework_output, "In demo scatter_intra");
return demo_module->underlying.coll_reduce_scatter(sbuf, rbuf, rcounts,
dtype, op, comm,
demo_module->underlying.coll_reduce_scatter_module);
@ -61,7 +61,7 @@ int mca_coll_demo_reduce_scatter_inter(void *sbuf, void *rbuf, int *rcounts,
mca_coll_base_module_t *module)
{
mca_coll_demo_module_t *demo_module = (mca_coll_demo_module_t*) module;
opal_output_verbose(10, mca_coll_base_output, "In demo scatter_inter");
opal_output_verbose(10, ompi_coll_base_framework.framework_output, "In demo scatter_inter");
return demo_module->underlying.coll_reduce_scatter(sbuf, rbuf, rcounts,
dtype, op, comm,
demo_module->underlying.coll_reduce_scatter_module);

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

@ -40,7 +40,7 @@ int mca_coll_demo_scan_intra(void *sbuf, void *rbuf, int count,
mca_coll_base_module_t *module)
{
mca_coll_demo_module_t *demo_module = (mca_coll_demo_module_t*) module;
opal_output_verbose(10, mca_coll_base_output, "In demo scan_intra");
opal_output_verbose(10, ompi_coll_base_framework.framework_output, "In demo scan_intra");
return demo_module->underlying.coll_scan(sbuf, rbuf, count,
dtype, op, comm,
demo_module->underlying.coll_scan_module);

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

@ -42,7 +42,7 @@ int mca_coll_demo_scatter_intra(void *sbuf, int scount,
mca_coll_base_module_t *module)
{
mca_coll_demo_module_t *demo_module = (mca_coll_demo_module_t*) module;
opal_output_verbose(10, mca_coll_base_output, "In demo scatter_intra");
opal_output_verbose(10, ompi_coll_base_framework.framework_output, "In demo scatter_intra");
return demo_module->underlying.coll_scatter(sbuf, scount, sdtype,
rbuf, rcount, rdtype,
root, comm,
@ -66,7 +66,7 @@ int mca_coll_demo_scatter_inter(void *sbuf, int scount,
mca_coll_base_module_t *module)
{
mca_coll_demo_module_t *demo_module = (mca_coll_demo_module_t*) module;
opal_output_verbose(10, mca_coll_base_output, "In demo scatter_inter");
opal_output_verbose(10, ompi_coll_base_framework.framework_output, "In demo scatter_inter");
return demo_module->underlying.coll_scatter(sbuf, scount, sdtype,
rbuf, rcount, rdtype,
root, comm,

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

@ -41,7 +41,7 @@ int mca_coll_demo_scatterv_intra(void *sbuf, int *scounts,
mca_coll_base_module_t *module)
{
mca_coll_demo_module_t *demo_module = (mca_coll_demo_module_t*) module;
opal_output_verbose(10, mca_coll_base_output, "In demo scatterv_intra");
opal_output_verbose(10, ompi_coll_base_framework.framework_output, "In demo scatterv_intra");
return demo_module->underlying.coll_scatterv(sbuf, scounts, disps,
sdtype, rbuf, rcount,
rdtype, root, comm,
@ -64,7 +64,7 @@ int mca_coll_demo_scatterv_inter(void *sbuf, int *scounts,
mca_coll_base_module_t *module)
{
mca_coll_demo_module_t *demo_module = (mca_coll_demo_module_t*) module;
opal_output_verbose(10, mca_coll_base_output, "In demo scatterv_inter");
opal_output_verbose(10, ompi_coll_base_framework.framework_output, "In demo scatterv_inter");
return demo_module->underlying.coll_scatterv(sbuf, scounts, disps,
sdtype, rbuf, rcount,
rdtype, root, comm,

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

@ -401,11 +401,11 @@ static int ml_open(void)
/* Init memory structures (no real memory is allocated) */
OBJ_CONSTRUCT(&cs->memory_manager, mca_coll_ml_lmngr_t);
if (OMPI_SUCCESS != (rc = mca_sbgp_base_open())) {
if (OMPI_SUCCESS != (rc = mca_base_framework_open(&ompi_sbgp_base_framework, 0))) {
fprintf(stderr," failure in open mca_sbgp_base_open \n");
return rc;
}
if (OMPI_SUCCESS != (rc = mca_bcol_base_open())) {
if (OMPI_SUCCESS != (rc = mca_base_framework_open(&ompi_bcol_base_framework, 0))) {
fprintf(stderr," failure in open mca_bcol_base_open \n");
return rc;
}

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

@ -132,7 +132,7 @@ int mca_coll_sm_init_query(bool enable_progress_threads,
}
/* Don't do much here because we don't really want to allocate any
shared memory until this component is selected to be used. */
opal_output_verbose(10, mca_coll_base_output,
opal_output_verbose(10, ompi_coll_base_framework.framework_output,
"coll:sm:init_query: pick me! pick me!");
return OMPI_SUCCESS;
}
@ -153,7 +153,7 @@ mca_coll_sm_comm_query(struct ompi_communicator_t *comm, int *priority)
are not on this node, then we don't want to run */
if (OMPI_COMM_IS_INTER(comm) || 1 == ompi_comm_size(comm) ||
!have_local_peers(comm->c_local_group, ompi_comm_size(comm))) {
opal_output_verbose(10, mca_coll_base_output,
opal_output_verbose(10, ompi_coll_base_framework.framework_output,
"coll:sm:comm_query (%d/%s): intercomm, comm is too small, or not all peers local; disqualifying myself", comm->c_contextid, comm->c_name);
return NULL;
}
@ -162,7 +162,7 @@ mca_coll_sm_comm_query(struct ompi_communicator_t *comm, int *priority)
* than or equal to 0, then the module is unavailable. */
*priority = mca_coll_sm_component.sm_priority;
if (mca_coll_sm_component.sm_priority <= 0) {
opal_output_verbose(10, mca_coll_base_output,
opal_output_verbose(10, ompi_coll_base_framework.framework_output,
"coll:sm:comm_query (%d/%s): priority too low; disqualifying myself", comm->c_contextid, comm->c_name);
return NULL;
}
@ -192,7 +192,7 @@ mca_coll_sm_comm_query(struct ompi_communicator_t *comm, int *priority)
sm_module->super.coll_scatter = NULL;
sm_module->super.coll_scatterv = NULL;
opal_output_verbose(10, mca_coll_base_output,
opal_output_verbose(10, ompi_coll_base_framework.framework_output,
"coll:sm:comm_query (%d/%s): pick me! pick me!",
comm->c_contextid, comm->c_name);
return &(sm_module->super);
@ -207,7 +207,7 @@ static int sm_module_enable(mca_coll_base_module_t *module,
{
if (NULL == comm->c_coll.coll_reduce ||
NULL == comm->c_coll.coll_reduce_module) {
opal_output_verbose(10, mca_coll_base_output,
opal_output_verbose(10, ompi_coll_base_framework.framework_output,
"coll:sm:enable (%d/%s): no underlying reduce; disqualifying myself",
comm->c_contextid, comm->c_name);
return OMPI_ERROR;
@ -247,7 +247,7 @@ int ompi_coll_sm_lazy_enable(mca_coll_base_module_t *module,
malloc(sizeof(opal_hwloc_base_memory_segment_t) *
c->sm_comm_num_segments * 3);
if (NULL == maffinity) {
opal_output_verbose(10, mca_coll_base_output,
opal_output_verbose(10, ompi_coll_base_framework.framework_output,
"coll:sm:enable (%d/%s): malloc failed (1)",
comm->c_contextid, comm->c_name);
return OMPI_ERR_OUT_OF_RESOURCE;
@ -277,7 +277,7 @@ int ompi_coll_sm_lazy_enable(mca_coll_base_module_t *module,
#if OPAL_HAVE_HWLOC
free(maffinity);
#endif
opal_output_verbose(10, mca_coll_base_output,
opal_output_verbose(10, ompi_coll_base_framework.framework_output,
"coll:sm:enable (%d/%s): malloc failed (2)",
comm->c_contextid, comm->c_name);
return OMPI_ERR_TEMP_OUT_OF_RESOURCE;
@ -461,7 +461,7 @@ int ompi_coll_sm_lazy_enable(mca_coll_base_module_t *module,
opal_atomic_add(&(data->sm_bootstrap_meta->module_seg->seg_inited), 1);
/* Wait for everyone in this communicator to attach and setup */
opal_output_verbose(10, mca_coll_base_output,
opal_output_verbose(10, ompi_coll_base_framework.framework_output,
"coll:sm:enable (%d/%s): waiting for peers to attach",
comm->c_contextid, comm->c_name);
SPIN_CONDITION(size == data->sm_bootstrap_meta->module_seg->seg_inited, seg_init_exit);
@ -469,7 +469,7 @@ int ompi_coll_sm_lazy_enable(mca_coll_base_module_t *module,
/* Once we're all here, remove the mmap file; it's not needed anymore */
if (0 == rank) {
unlink(data->sm_bootstrap_meta->shmem_ds.seg_name);
opal_output_verbose(10, mca_coll_base_output,
opal_output_verbose(10, ompi_coll_base_framework.framework_output,
"coll:sm:enable (%d/%s): removed mmap file %s",
comm->c_contextid, comm->c_name,
data->sm_bootstrap_meta->shmem_ds.seg_name);
@ -477,7 +477,7 @@ int ompi_coll_sm_lazy_enable(mca_coll_base_module_t *module,
/* All done */
opal_output_verbose(10, mca_coll_base_output,
opal_output_verbose(10, ompi_coll_base_framework.framework_output,
"coll:sm:enable (%d/%s): success!",
comm->c_contextid, comm->c_name);
return OMPI_SUCCESS;
@ -533,7 +533,7 @@ static int bootstrap_comm(ompi_communicator_t *comm,
asprintf(&shortpath, "coll-sm-cid-%d-name-%s.mmap", comm->c_contextid,
OMPI_NAME_PRINT(lowest_name));
if (NULL == shortpath) {
opal_output_verbose(10, mca_coll_base_output,
opal_output_verbose(10, ompi_coll_base_framework.framework_output,
"coll:sm:enable:bootstrap comm (%d/%s): asprintf failed",
comm->c_contextid, comm->c_name);
return OMPI_ERR_OUT_OF_RESOURCE;
@ -542,7 +542,7 @@ static int bootstrap_comm(ompi_communicator_t *comm,
shortpath, NULL);
free(shortpath);
if (NULL == fullpath) {
opal_output_verbose(10, mca_coll_base_output,
opal_output_verbose(10, ompi_coll_base_framework.framework_output,
"coll:sm:enable:bootstrap comm (%d/%s): opal_os_path failed",
comm->c_contextid, comm->c_name);
return OMPI_ERR_OUT_OF_RESOURCE;
@ -573,7 +573,7 @@ static int bootstrap_comm(ompi_communicator_t *comm,
(num_in_use * control_size) +
(num_segments * (comm_size * control_size * 2)) +
(num_segments * (comm_size * frag_size));
opal_output_verbose(10, mca_coll_base_output,
opal_output_verbose(10, ompi_coll_base_framework.framework_output,
"coll:sm:enable:bootstrap comm (%d/%s): attaching to %" PRIsize_t " byte mmap: %s",
comm->c_contextid, comm->c_name, size, fullpath);
data->sm_bootstrap_meta =
@ -581,7 +581,7 @@ static int bootstrap_comm(ompi_communicator_t *comm,
sizeof(mca_common_sm_seg_header_t),
sizeof(void*));
if (NULL == data->sm_bootstrap_meta) {
opal_output_verbose(10, mca_coll_base_output,
opal_output_verbose(10, ompi_coll_base_framework.framework_output,
"coll:sm:enable:bootstrap comm (%d/%s): mca_common_sm_init_group failed",
comm->c_contextid, comm->c_name);
return OMPI_ERR_OUT_OF_RESOURCE;

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

@ -22,8 +22,7 @@ headers += \
base/base.h
libmca_crcp_la_SOURCES += \
base/crcp_base_open.c \
base/crcp_base_close.c \
base/crcp_base_frame.c \
base/crcp_base_select.c \
base/crcp_base_fns.c

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

@ -20,6 +20,7 @@
#include "ompi_config.h"
#include "opal/mca/base/base.h"
#include "ompi/constants.h"
#include "ompi/mca/crcp/crcp.h"
@ -30,16 +31,6 @@
BEGIN_C_DECLS
/**
* Initialize the CRCP MCA framework
*
* @retval OMPI_SUCCESS Upon success
* @retval OMPI_ERROR Upon failures
*
* This function is invoked during ompi_init();
*/
OMPI_DECLSPEC int ompi_crcp_base_open(void);
/**
* Select an available component.
*
@ -50,16 +41,6 @@ BEGIN_C_DECLS
*/
OMPI_DECLSPEC int ompi_crcp_base_select(void);
/**
* Finalize the CRCP MCA framework
*
* @retval OMPI_SUCCESS Upon success
* @retval OMPI_ERROR Upon failures
*
* This function is invoked during ompi_finalize();
*/
OMPI_DECLSPEC int ompi_crcp_base_close(void);
/**
* Quiesce Interface (For MPI Ext.)
*/
@ -208,10 +189,7 @@ BEGIN_C_DECLS
ompi_crcp_base_none_btl_ft_event(int state,
ompi_crcp_base_btl_state_t*);
/* Utility Functions */
OMPI_DECLSPEC extern int ompi_crcp_base_output;
OMPI_DECLSPEC extern opal_list_t ompi_crcp_base_components_available;
OMPI_DECLSPEC extern mca_base_framework_t ompi_crcp_base_framework;
OMPI_DECLSPEC extern ompi_crcp_base_component_t ompi_crcp_base_selected_component;
OMPI_DECLSPEC extern ompi_crcp_base_module_t ompi_crcp;

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

@ -17,12 +17,25 @@
#include "ompi_config.h"
#include "opal/mca/mca.h"
#include "opal/util/output.h"
#include "opal/mca/base/base.h"
#include "ompi/mca/crcp/crcp.h"
#include "ompi/mca/crcp/base/base.h"
int ompi_crcp_base_close(void)
#include "ompi/mca/crcp/base/static-components.h"
/*
* Globals
*/
OMPI_DECLSPEC ompi_crcp_base_module_t ompi_crcp = {
NULL, /* crcp_init */
NULL /* crcp_finalize */
};
ompi_crcp_base_component_t ompi_crcp_base_selected_component;
static int ompi_crcp_base_close(void)
{
/* Close the selected component */
if( NULL != ompi_crcp.crcp_finalize ) {
@ -30,13 +43,8 @@ int ompi_crcp_base_close(void)
}
/* Close all available modules that are open */
mca_base_components_close(ompi_crcp_base_output,
&ompi_crcp_base_components_available,
NULL);
/* Close the framework output */
opal_output_close (ompi_crcp_base_output);
ompi_crcp_base_output = -1;
return OMPI_SUCCESS;
return mca_base_framework_components_close(&ompi_crcp_base_framework, NULL);
}
MCA_BASE_FRAMEWORK_DECLARE(ompi, crcp, NULL, NULL, NULL, ompi_crcp_base_close,
mca_crcp_base_static_components, 0);

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

@ -1,67 +0,0 @@
/*
* Copyright (c) 2004-2007 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* 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 "opal/mca/mca.h"
#include "opal/util/output.h"
#include "opal/mca/base/base.h"
#include "ompi/mca/crcp/crcp.h"
#include "ompi/mca/crcp/base/base.h"
#include "ompi/mca/crcp/base/static-components.h"
/*
* Globals
*/
OMPI_DECLSPEC int ompi_crcp_base_output = -1;
OMPI_DECLSPEC ompi_crcp_base_module_t ompi_crcp = {
NULL, /* crcp_init */
NULL /* crcp_finalize */
};
opal_list_t ompi_crcp_base_components_available;
ompi_crcp_base_component_t ompi_crcp_base_selected_component;
/**
* Function for finding and opening either all MCA components,
* or the one that was specifically requested via a MCA parameter.
*/
int ompi_crcp_base_open(void)
{
ompi_crcp_base_output = opal_output_open(NULL);
/*
* Which CRCP component to open
* - NULL or "" = auto-select
* - "none" = Empty component
* - ow. select that specific component
* Note: Set the default to NULL here so ompi_info will work correctly,
* The 'real' default is set in base_select.c
*/
/* Open up all available components */
if (OPAL_SUCCESS !=
mca_base_components_open("crcp",
ompi_crcp_base_output,
mca_crcp_base_static_components,
&ompi_crcp_base_components_available,
true)) {
return OMPI_ERROR;
}
return OMPI_SUCCESS;
}

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

@ -141,7 +141,7 @@ int ompi_crcp_base_select(void)
}
if(0 == strncmp(include_list, "none", strlen("none")) ){
opal_output_verbose(10, ompi_crcp_base_output,
opal_output_verbose(10, ompi_crcp_base_framework.framework_output,
"crcp:select: Using %s component",
include_list);
best_component = &none_component;
@ -149,7 +149,7 @@ int ompi_crcp_base_select(void)
/* JJH: Todo: Check if none is in the list */
/* Close all components since none will be used */
mca_base_components_close(0, /* Pass 0 to keep this from closing the output handle */
&ompi_crcp_base_components_available,
&ompi_crcp_base_framework.framework_components,
NULL);
goto skip_select;
}
@ -157,8 +157,8 @@ int ompi_crcp_base_select(void)
/*
* Select the best component
*/
if( OPAL_SUCCESS != mca_base_select("crcp", ompi_crcp_base_output,
&ompi_crcp_base_components_available,
if( OPAL_SUCCESS != mca_base_select("crcp", ompi_crcp_base_framework.framework_output,
&ompi_crcp_base_framework.framework_components,
(mca_base_module_t **) &best_module,
(mca_base_component_t **) &best_component) ) {
/* This will only happen if no component was selected */

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

@ -120,7 +120,7 @@ static int crcp_bkmrk_open(void)
opal_output_set_verbosity(mca_crcp_bkmrk_component.super.output_handle,
mca_crcp_bkmrk_component.super.verbose);
} else {
mca_crcp_bkmrk_component.super.output_handle = ompi_crcp_base_output;
mca_crcp_bkmrk_component.super.output_handle = ompi_crcp_base_framework.framework_output;
}
/*

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

@ -22,8 +22,7 @@ headers += \
base/base.h
libmca_dpm_la_SOURCES += \
base/dpm_base_open.c \
base/dpm_base_close.c \
base/dpm_base_frame.c \
base/dpm_base_select.c \
base/dpm_base_null_fns.c \
base/dpm_base_common_fns.c

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

@ -37,16 +37,6 @@ struct ompi_dpm_base_disconnect_obj {
};
typedef struct ompi_dpm_base_disconnect_obj ompi_dpm_base_disconnect_obj;
/**
* Initialize the DPM MCA framework
*
* @retval OMPI_SUCCESS Upon success
* @retval OMPI_ERROR Upon failures
*
* This function is invoked during ompi_init();
*/
OMPI_DECLSPEC int ompi_dpm_base_open(void);
/**
* Select an available component.
*
@ -57,16 +47,6 @@ OMPI_DECLSPEC int ompi_dpm_base_open(void);
*/
OMPI_DECLSPEC int ompi_dpm_base_select(void);
/**
* Finalize the DPM MCA framework
*
* @retval OMPI_SUCCESS Upon success
* @retval OMPI_ERROR Upon failures
*
* This function is invoked during ompi_finalize();
*/
OMPI_DECLSPEC int ompi_dpm_base_close(void);
/* Internal support functions */
OMPI_DECLSPEC char* ompi_dpm_base_dyn_init (void);
OMPI_DECLSPEC int ompi_dpm_base_dyn_finalize (void);
@ -94,11 +74,11 @@ int ompi_dpm_base_null_route_to_port(char *rml_uri, ompi_process_name_t *rproc);
int ompi_dpm_base_null_close_port(char *port_name);
/* useful globals */
OMPI_DECLSPEC extern int ompi_dpm_base_output;
OMPI_DECLSPEC extern opal_list_t ompi_dpm_base_components_available;
OMPI_DECLSPEC extern ompi_dpm_base_component_t ompi_dpm_base_selected_component;
OMPI_DECLSPEC extern ompi_dpm_base_module_t ompi_dpm;
OMPI_DECLSPEC extern mca_base_framework_t ompi_dpm_base_framework;
END_C_DECLS
#endif /* OMPI_MCA_DPM_BASE_H */

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

@ -1,42 +0,0 @@
/*
* Copyright (c) 2004-2007 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* 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 "opal/mca/mca.h"
#include "opal/mca/base/base.h"
#include "ompi/mca/dpm/dpm.h"
#include "ompi/mca/dpm/base/base.h"
int ompi_dpm_base_close(void)
{
/* Close the selected component */
if( NULL != ompi_dpm.finalize ) {
ompi_dpm.finalize();
}
/* Close all available modules that are open */
mca_base_components_close(ompi_dpm_base_output,
&ompi_dpm_base_components_available,
NULL);
/* Close the framework output */
opal_output_close (ompi_dpm_base_output);
ompi_dpm_base_output = -1;
return OMPI_SUCCESS;
}

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

@ -28,7 +28,6 @@
/*
* Globals
*/
OMPI_DECLSPEC int ompi_dpm_base_output = -1;
OMPI_DECLSPEC ompi_dpm_base_module_t ompi_dpm = {
NULL,
ompi_dpm_base_null_connect_accept,
@ -43,27 +42,18 @@ OMPI_DECLSPEC ompi_dpm_base_module_t ompi_dpm = {
ompi_dpm_base_null_close_port,
NULL
};
opal_list_t ompi_dpm_base_components_available;
ompi_dpm_base_component_t ompi_dpm_base_selected_component;
/**
* Function for finding and opening either all MCA components,
* or the one that was specifically requested via a MCA parameter.
*/
int ompi_dpm_base_open(void)
static int ompi_dpm_base_close(void)
{
/* Debugging/Verbose output */
ompi_dpm_base_output = opal_output_open(NULL);
/* Open up all available components */
if (OPAL_SUCCESS !=
mca_base_components_open("dpm",
ompi_dpm_base_output,
mca_dpm_base_static_components,
&ompi_dpm_base_components_available,
true)) {
return OMPI_ERROR;
/* Close the selected component */
if( NULL != ompi_dpm.finalize ) {
ompi_dpm.finalize();
}
return OMPI_SUCCESS;
/* Close all available modules that are open */
return mca_base_framework_components_close(&ompi_dpm_base_framework, NULL);
}
MCA_BASE_FRAMEWORK_DECLARE(ompi, dpm, NULL, NULL, NULL, ompi_dpm_base_close,
mca_dpm_base_static_components, 0);

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

@ -36,8 +36,8 @@ int ompi_dpm_base_select(void)
/*
* Select the best component
*/
if( OPAL_SUCCESS != (ret = mca_base_select("dpm", ompi_dpm_base_output,
&ompi_dpm_base_components_available,
if( OPAL_SUCCESS != (ret = mca_base_select("dpm", ompi_dpm_base_framework.framework_output,
&ompi_dpm_base_framework.framework_components,
(mca_base_module_t **) &best_module,
(mca_base_component_t **) &best_component))) {
/* it is okay not to find any executable components */

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

@ -148,7 +148,7 @@ static int connect_accept ( ompi_communicator_t *comm, int root,
opal_list_item_t *item;
orte_namelist_t *nm;
OPAL_OUTPUT_VERBOSE((1, ompi_dpm_base_output,
OPAL_OUTPUT_VERBOSE((1, ompi_dpm_base_framework.framework_output,
"%s dpm:orte:connect_accept with port %s %s",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
port_string, send_first ? "sending first" : "recv first"));
@ -275,7 +275,7 @@ static int connect_accept ( ompi_communicator_t *comm, int root,
goto exit;
}
OPAL_OUTPUT_VERBOSE((3, ompi_dpm_base_output,
OPAL_OUTPUT_VERBOSE((3, ompi_dpm_base_framework.framework_output,
"%s dpm:orte:connect_accept adding %s to proc list",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
ORTE_NAME_PRINT(&proc_list[i]->proc_name)));
@ -308,13 +308,13 @@ static int connect_accept ( ompi_communicator_t *comm, int root,
/* Exchange the number and the list of processes in the groups */
if ( send_first ) {
OPAL_OUTPUT_VERBOSE((3, ompi_dpm_base_output,
OPAL_OUTPUT_VERBOSE((3, ompi_dpm_base_framework.framework_output,
"%s dpm:orte:connect_accept sending first to %s",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
ORTE_NAME_PRINT(&port)));
rc = orte_rml.send_buffer(&port, nbuf, tag, 0);
/* setup to recv */
OPAL_OUTPUT_VERBOSE((3, ompi_dpm_base_output,
OPAL_OUTPUT_VERBOSE((3, ompi_dpm_base_framework.framework_output,
"%s dpm:orte:connect_accept waiting for response",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME)));
waiting_for_recv = true;
@ -322,13 +322,13 @@ static int connect_accept ( ompi_communicator_t *comm, int root,
ORTE_RML_NON_PERSISTENT, recv_cb, NULL);
/* wait for response */
ORTE_WAIT_FOR_COMPLETION(waiting_for_recv);
OPAL_OUTPUT_VERBOSE((3, ompi_dpm_base_output,
OPAL_OUTPUT_VERBOSE((3, ompi_dpm_base_framework.framework_output,
"%s dpm:orte:connect_accept got data from %s",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
ORTE_NAME_PRINT(&carport)));
} else {
OPAL_OUTPUT_VERBOSE((3, ompi_dpm_base_output,
OPAL_OUTPUT_VERBOSE((3, ompi_dpm_base_framework.framework_output,
"%s dpm:orte:connect_accept recving first",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME)));
/* setup to recv */
@ -338,7 +338,7 @@ static int connect_accept ( ompi_communicator_t *comm, int root,
/* wait for response */
ORTE_WAIT_FOR_COMPLETION(waiting_for_recv);
/* now send our info */
OPAL_OUTPUT_VERBOSE((3, ompi_dpm_base_output,
OPAL_OUTPUT_VERBOSE((3, ompi_dpm_base_framework.framework_output,
"%s dpm:orte:connect_accept sending info to %s",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
ORTE_NAME_PRINT(&carport)));
@ -359,7 +359,7 @@ static int connect_accept ( ompi_communicator_t *comm, int root,
rnamebuflen_int = (int)rnamebuflen;
/* bcast the buffer-length to all processes in the local comm */
OPAL_OUTPUT_VERBOSE((3, ompi_dpm_base_output,
OPAL_OUTPUT_VERBOSE((3, ompi_dpm_base_framework.framework_output,
"%s dpm:orte:connect_accept bcast buffer length",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME)));
rc = comm->c_coll.coll_bcast (&rnamebuflen_int, 1, MPI_INT, root, comm,
@ -383,7 +383,7 @@ static int connect_accept ( ompi_communicator_t *comm, int root,
adds processes, which were not known yet to our
process pool.
*/
OPAL_OUTPUT_VERBOSE((3, ompi_dpm_base_output,
OPAL_OUTPUT_VERBOSE((3, ompi_dpm_base_framework.framework_output,
"%s dpm:orte:connect_accept bcast proc list",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME)));
rc = comm->c_coll.coll_bcast (rnamebuf, rnamebuflen_int, MPI_BYTE, root, comm,
@ -419,7 +419,7 @@ static int connect_accept ( ompi_communicator_t *comm, int root,
goto exit;
}
OPAL_OUTPUT_VERBOSE((3, ompi_dpm_base_output,
OPAL_OUTPUT_VERBOSE((3, ompi_dpm_base_framework.framework_output,
"%s dpm:orte:connect_accept unpacked %d new procs",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), new_proc_len));
@ -445,7 +445,7 @@ static int connect_accept ( ompi_communicator_t *comm, int root,
name = OBJ_NEW(orte_namelist_t);
name->name = rprocs[i]->proc_name;
opal_list_append(&all_procs, &name->super);
OPAL_OUTPUT_VERBOSE((3, ompi_dpm_base_output,
OPAL_OUTPUT_VERBOSE((3, ompi_dpm_base_framework.framework_output,
"%s dpm:orte:connect_accept send first adding %s to allgather list",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
ORTE_NAME_PRINT(&name->name)));
@ -454,7 +454,7 @@ static int connect_accept ( ompi_communicator_t *comm, int root,
name = OBJ_NEW(orte_namelist_t);
name->name = ompi_group_peer_lookup(group, i)->proc_name;
opal_list_append(&all_procs, &name->super);
OPAL_OUTPUT_VERBOSE((3, ompi_dpm_base_output,
OPAL_OUTPUT_VERBOSE((3, ompi_dpm_base_framework.framework_output,
"%s dpm:orte:connect_accept send first adding %s to allgather list",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
ORTE_NAME_PRINT(&name->name)));
@ -465,7 +465,7 @@ static int connect_accept ( ompi_communicator_t *comm, int root,
name = OBJ_NEW(orte_namelist_t);
name->name = ompi_group_peer_lookup(group, i)->proc_name;
opal_list_append(&all_procs, &name->super);
OPAL_OUTPUT_VERBOSE((3, ompi_dpm_base_output,
OPAL_OUTPUT_VERBOSE((3, ompi_dpm_base_framework.framework_output,
"%s dpm:orte:connect_accept recv first adding %s to allgather list",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
ORTE_NAME_PRINT(&name->name)));
@ -474,7 +474,7 @@ static int connect_accept ( ompi_communicator_t *comm, int root,
name = OBJ_NEW(orte_namelist_t);
name->name = rprocs[i]->proc_name;
opal_list_append(&all_procs, &name->super);
OPAL_OUTPUT_VERBOSE((3, ompi_dpm_base_output,
OPAL_OUTPUT_VERBOSE((3, ompi_dpm_base_framework.framework_output,
"%s dpm:orte:connect_accept recv first adding %s to allgather list",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
ORTE_NAME_PRINT(&name->name)));
@ -482,7 +482,7 @@ static int connect_accept ( ompi_communicator_t *comm, int root,
}
OPAL_OUTPUT_VERBOSE((3, ompi_dpm_base_output,
OPAL_OUTPUT_VERBOSE((3, ompi_dpm_base_framework.framework_output,
"%s dpm:orte:connect_accept executing modex",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME)));
@ -509,7 +509,7 @@ static int connect_accept ( ompi_communicator_t *comm, int root,
}
OBJ_DESTRUCT(&modex);
OPAL_OUTPUT_VERBOSE((3, ompi_dpm_base_output,
OPAL_OUTPUT_VERBOSE((3, ompi_dpm_base_framework.framework_output,
"%s dpm:orte:connect_accept modex complete",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME)));
@ -520,7 +520,7 @@ static int connect_accept ( ompi_communicator_t *comm, int root,
OBJ_DESTRUCT(&all_procs);
*/
OPAL_OUTPUT_VERBOSE((3, ompi_dpm_base_output,
OPAL_OUTPUT_VERBOSE((3, ompi_dpm_base_framework.framework_output,
"%s dpm:orte:connect_accept adding procs",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME)));
@ -529,7 +529,7 @@ static int connect_accept ( ompi_communicator_t *comm, int root,
goto exit;
}
OPAL_OUTPUT_VERBOSE((3, ompi_dpm_base_output,
OPAL_OUTPUT_VERBOSE((3, ompi_dpm_base_framework.framework_output,
"%s dpm:orte:connect_accept new procs added",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME)));
}
@ -539,7 +539,7 @@ static int connect_accept ( ompi_communicator_t *comm, int root,
OBJ_RELEASE(nbuf);
}
OPAL_OUTPUT_VERBOSE((3, ompi_dpm_base_output,
OPAL_OUTPUT_VERBOSE((3, ompi_dpm_base_framework.framework_output,
"%s dpm:orte:connect_accept allocating group size %d",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), rsize));
@ -557,7 +557,7 @@ static int connect_accept ( ompi_communicator_t *comm, int root,
/* increment proc reference counters */
ompi_group_increment_proc_count(new_group_pointer);
OPAL_OUTPUT_VERBOSE((3, ompi_dpm_base_output,
OPAL_OUTPUT_VERBOSE((3, ompi_dpm_base_framework.framework_output,
"%s dpm:orte:connect_accept setting up communicator",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME)));
@ -583,7 +583,7 @@ static int connect_accept ( ompi_communicator_t *comm, int root,
OBJ_RELEASE(new_group_pointer);
new_group_pointer = MPI_GROUP_NULL;
OPAL_OUTPUT_VERBOSE((3, ompi_dpm_base_output,
OPAL_OUTPUT_VERBOSE((3, ompi_dpm_base_framework.framework_output,
"%s dpm:orte:connect_accept allocate comm_cid",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME)));
@ -599,7 +599,7 @@ static int connect_accept ( ompi_communicator_t *comm, int root,
goto exit;
}
OPAL_OUTPUT_VERBOSE((3, ompi_dpm_base_output,
OPAL_OUTPUT_VERBOSE((3, ompi_dpm_base_framework.framework_output,
"%s dpm:orte:connect_accept activate comm",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME)));
@ -639,7 +639,7 @@ static int connect_accept ( ompi_communicator_t *comm, int root,
}
*newcomm = newcomp;
OPAL_OUTPUT_VERBOSE((3, ompi_dpm_base_output,
OPAL_OUTPUT_VERBOSE((3, ompi_dpm_base_framework.framework_output,
"%s dpm:orte:connect_accept complete",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME)));
@ -1557,7 +1557,7 @@ static int dyn_init(void)
return OMPI_SUCCESS;
}
OPAL_OUTPUT_VERBOSE((1, ompi_dpm_base_output,
OPAL_OUTPUT_VERBOSE((1, ompi_dpm_base_framework.framework_output,
"%s dpm:orte:dyn_init with port %s",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
port_name));

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

@ -21,8 +21,7 @@ headers += \
base/base.h
libmca_fbtl_la_SOURCES += \
base/fbtl_base_close.c \
base/fbtl_base_frame.c \
base/fbtl_base_file_select.c \
base/fbtl_base_file_unselect.c \
base/fbtl_base_find_available.c \
base/fbtl_base_open.c
base/fbtl_base_find_available.c

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

@ -30,17 +30,12 @@
#include "ompi_config.h"
#include "mpi.h"
#include "opal/class/opal_list.h"
#include "ompi/mca/fbtl/fbtl.h"
#include "opal/mca/mca.h"
#include "opal/mca/base/base.h"
BEGIN_C_DECLS
OMPI_DECLSPEC int mca_fbtl_base_open(void);
OMPI_DECLSPEC int mca_fbtl_base_close(void);
OMPI_DECLSPEC int mca_fbtl_base_file_select(struct mca_io_ompio_file_t *file,
mca_base_component_t *preferred);
@ -56,14 +51,7 @@ OMPI_DECLSPEC int mca_fbtl_base_get_param (struct mca_io_ompio_file_t *file, int
* Globals
*/
OMPI_DECLSPEC extern int mca_fbtl_base_param;
OMPI_DECLSPEC extern int mca_fbtl_base_output;
OMPI_DECLSPEC extern bool mca_fbtl_base_components_opened_valid;
OMPI_DECLSPEC extern bool mca_fbtl_base_components_available_valid;
OMPI_DECLSPEC extern opal_list_t mca_fbtl_base_components_opened;
OMPI_DECLSPEC extern opal_list_t mca_fbtl_base_components_available;
OMPI_DECLSPEC extern mca_base_framework_t ompi_fbtl_base_framework;
END_C_DECLS

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

@ -1,57 +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 (c) 2008-2011 University of Houston. All rights reserved.
* $COPYRIGHTOB$
*
* 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/fbtl/fbtl.h"
#include "ompi/mca/fbtl/base/base.h"
int mca_fbtl_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_fbtl_base_components_opened_valid) {
mca_base_components_close(mca_fbtl_base_output,
&mca_fbtl_base_components_opened, NULL);
OBJ_DESTRUCT(&mca_fbtl_base_components_opened);
mca_fbtl_base_components_opened_valid = false;
} else if (mca_fbtl_base_components_available_valid) {
mca_base_components_close(mca_fbtl_base_output,
&mca_fbtl_base_components_available, NULL);
OBJ_DESTRUCT(&mca_fbtl_base_components_available);
mca_fbtl_base_components_available_valid = false;
}
/* Close the framework output */
opal_output_close (mca_fbtl_base_output);
mca_fbtl_base_output = -1;
/* All done */
return OMPI_SUCCESS;
}

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

@ -68,22 +68,14 @@ int mca_fbtl_base_file_select (struct mca_io_ompio_file_t *file,
int priority;
int best_priority;
opal_list_item_t *item;
opal_list_item_t *next_item;
mca_base_component_priority_list_item_t *selectable_item;
char **name_array;
int num_names;
mca_base_component_priority_list_item_t *cpli;
mca_base_component_list_item_t *cli;
mca_fbtl_base_component_t *component;
mca_fbtl_base_component_t *best_component;
mca_fbtl_base_module_t *module;
opal_list_t queried;
queried_module_t *om;
opal_list_t *selectable;
char *str;
int err = MPI_SUCCESS;
int i;
bool was_selectable_constructed = false;
const char **names_value, *names;
/* Check and see if a preferred component was provided. If it was
provided then it should be used (if possible) */
@ -95,7 +87,7 @@ int mca_fbtl_base_file_select (struct mca_io_ompio_file_t *file,
str = &(preferred->mca_component_name[0]);
opal_output_verbose(10, mca_fbtl_base_output,
opal_output_verbose(10, ompi_fbtl_base_framework.framework_output,
"fbtl:base:file_select: Checking preferred component: %s",
str);
@ -136,83 +128,13 @@ int mca_fbtl_base_file_select (struct mca_io_ompio_file_t *file,
* use that for this file
*/
/* Check if anything was requested by means on the name parameters */
names_value = NULL;
mca_base_var_get_value(mca_fbtl_base_param, &names_value, NULL, NULL);
names = names_value ? names_value[0] : NULL;
if (NULL != names && 0 < strlen(names)) {
name_array = opal_argv_split (names, ',');
num_names = opal_argv_count (name_array);
opal_output_verbose(10, mca_fbtl_base_output,
"fbtl:base:file_Select: Checking all available module");
/* since there are somethings which the mca requested through the
if the intersection is NULL, then we barf saying that the requested
modules are not being available */
selectable = OBJ_NEW(opal_list_t);
was_selectable_constructed = true;
/* go through the compoents_available list and check against the names
* to see whether this can be added or not */
for (item = opal_list_get_first(&mca_fbtl_base_components_available);
item != opal_list_get_end(&mca_fbtl_base_components_available);
item = opal_list_get_next(item)) {
/* convert the opal_list_item_t returned into the proper type */
cpli = (mca_base_component_priority_list_item_t *) item;
component = (mca_fbtl_base_component_t *) cpli->super.cli_component;
opal_output_verbose(10, mca_fbtl_base_output,
"select: initialising %s component %s",
component->fbtlm_version.mca_type_name,
component->fbtlm_version.mca_component_name);
/* check if this name is present in the mca_base_var */
for (i=0; i < num_names; i++) {
if (0 == strcmp(name_array[i], component->fbtlm_version.mca_component_name)) {
/* this is present, and should be added o the selectable list */
/* We need to create a seperate object to initialise this list with
* since we cannot have the same item in 2 lists */
selectable_item = OBJ_NEW (mca_base_component_priority_list_item_t);
*selectable_item = *cpli;
opal_list_append (selectable, (opal_list_item_t *)selectable_item);
break;
}
}
}
/* check for a NULL intersection between the available list and the
* list which was asked for */
if (0 == opal_list_get_size(selectable)) {
was_selectable_constructed = true;
OBJ_RELEASE (selectable);
opal_output_verbose (10, mca_fbtl_base_output,
"fbtl:base:file_select: preferred modules were not available");
return OMPI_ERROR;
}
} else { /* if there was no name_array, then we need to simply initialize
selectable to mca_fbtl_base_components_available */
selectable = &mca_fbtl_base_components_available;
}
best_component = NULL;
best_priority = -1;
OBJ_CONSTRUCT(&queried, opal_list_t);
for (item = opal_list_get_first(selectable);
item != opal_list_get_end(selectable);
item = opal_list_get_next(item)) {
/*
* convert the opal_list_item_t returned into the proper type
*/
cpli = (mca_base_component_priority_list_item_t *) item;
component = (mca_fbtl_base_component_t *) cpli->super.cli_component;
opal_output_verbose(10, mca_fbtl_base_output,
OPAL_LIST_FOREACH(cli, &ompi_fbtl_base_framework.framework_components, mca_base_component_list_item_t) {
component = (mca_fbtl_base_component_t *) cli->cli_component;
opal_output_verbose(10, ompi_fbtl_base_framework.framework_output,
"select: initialising %s component %s",
component->fbtlm_version.mca_type_name,
component->fbtlm_version.mca_component_name);
@ -221,7 +143,7 @@ int mca_fbtl_base_file_select (struct mca_io_ompio_file_t *file,
* we can call the query function only if there is a function :-)
*/
if (NULL == component->fbtlm_file_query) {
opal_output_verbose(10, mca_fbtl_base_output,
opal_output_verbose(10, ompi_fbtl_base_framework.framework_output,
"select: no query, ignoring the component");
} else {
/*
@ -234,10 +156,10 @@ int mca_fbtl_base_file_select (struct mca_io_ompio_file_t *file,
/*
* query did not return any action which can be used
*/
opal_output_verbose(10, mca_fbtl_base_output,
opal_output_verbose(10, ompi_fbtl_base_framework.framework_output,
"select: query returned failure");
} else {
opal_output_verbose(10, mca_fbtl_base_output,
opal_output_verbose(10, ompi_fbtl_base_framework.framework_output,
"select: query returned priority %d",
priority);
/*
@ -263,25 +185,6 @@ int mca_fbtl_base_file_select (struct mca_io_ompio_file_t *file,
} /* end else of if (NULL == component->fbtlm_init) */
} /* end for ... end of traversal */
/* We have to remove empty out the selectable list if the selectable
* list was constructed as a duplicate and not as a pointer to the
* mca_base_components_available list. So, check and destroy */
if (was_selectable_constructed) {
/* remove all the items first */
for (item = opal_list_get_first(&mca_fbtl_base_components_available);
item != opal_list_get_end(&mca_fbtl_base_components_available);
item = next_item) {
next_item = opal_list_get_next(item);
OBJ_RELEASE (item);
}
/* release the list itself */
OBJ_RELEASE (selectable);
was_selectable_constructed = false;
}
/*
* Now we have alist of components which successfully returned
* their module struct. One of these components has the best
@ -305,9 +208,7 @@ int mca_fbtl_base_file_select (struct mca_io_ompio_file_t *file,
* unquery() those components which have not been selected and
* init() the component which was selected
*/
for (item = opal_list_remove_first(&queried);
NULL != item;
item = opal_list_remove_first(&queried)) {
while (NULL != (item = opal_list_remove_first(&queried))) {
om = (queried_module_t *) item;
if (om->om_component == best_component) {
/*
@ -340,7 +241,7 @@ int mca_fbtl_base_file_select (struct mca_io_ompio_file_t *file,
* unquery. Hence this check is necessary
*/
(void) om->om_component->fbtlm_file_unquery(file);
opal_output_verbose(10, mca_fbtl_base_output,
opal_output_verbose(10, ompi_fbtl_base_framework.framework_output,
"select: component %s is not selected",
om->om_component->fbtlm_version.mca_component_name);
} /* end if */
@ -348,7 +249,7 @@ int mca_fbtl_base_file_select (struct mca_io_ompio_file_t *file,
OBJ_RELEASE(om);
} /* traversing through the entire list */
opal_output_verbose(10, mca_fbtl_base_output,
opal_output_verbose(10, ompi_fbtl_base_framework.framework_output,
"select: component %s selected",
best_component->fbtlm_version.mca_component_name);

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

@ -27,81 +27,41 @@
#include "opal/class/opal_list.h"
#include "opal/mca/mca.h"
#include "opal/mca/base/base.h"
#include "opal/mca/base/mca_base_component_repository.h"
#include "ompi/mca/fbtl/fbtl.h"
#include "ompi/mca/fbtl/base/base.h"
opal_list_t mca_fbtl_base_modules_available;
bool mca_fbtl_base_modules_available_valid = false;
static int init_query(const mca_base_component_t *m,
mca_base_component_priority_list_item_t *entry,
bool enable_progress_threads,
bool enable_mpi_threads);
static int init_query_2_0_0(const mca_base_component_t *component,
mca_base_component_priority_list_item_t *entry,
bool enable_progress_threads,
bool enable_mpi_threads);
int mca_fbtl_base_find_available(bool enable_progress_threads,
bool enable_mpi_threads)
{
bool found = false;
mca_base_component_priority_list_item_t *entry;
opal_list_item_t *p;
/* Initialize the list */
OBJ_CONSTRUCT(&mca_fbtl_base_components_available, opal_list_t);
mca_fbtl_base_components_available_valid = true;
mca_base_component_list_item_t *cli, *next;
/* The list of components which we should check is already present
in mca_fbtl_base_components_opened, which was established in
mca_fbtl_base_open */
for (found = false,
p = opal_list_remove_first (&mca_fbtl_base_components_opened);
NULL != p;
p = opal_list_remove_first (&mca_fbtl_base_components_opened)) {
entry = OBJ_NEW(mca_base_component_priority_list_item_t);
entry->super.cli_component =
((mca_base_component_list_item_t *)p)->cli_component;
OPAL_LIST_FOREACH_SAFE(cli, next, &ompi_fbtl_base_framework.framework_components, mca_base_component_list_item_t) {
/* Now for this entry, we have to determine the thread level. Call
a subroutine to do the job for us */
if (OMPI_SUCCESS == init_query(entry->super.cli_component, entry,
if (OMPI_SUCCESS != init_query(cli->cli_component,
enable_progress_threads,
enable_mpi_threads)) {
/* Save the results in the list. The priority is not relvant at
this point in time. But we save the thread arguments so that
the initial selection algorithm can negotiate overall thread
level for this process */
entry->cpli_priority = 0;
opal_list_append (&mca_fbtl_base_components_available,
(opal_list_item_t *) entry);
found = true;
} else {
/* The component does not want to run, so close it. Its close()
has already been invoked. Close it out of the DSO repository
(if it is there in the repository) */
mca_base_component_repository_release(entry->super.cli_component);
OBJ_RELEASE(entry);
mca_base_component_close(cli->cli_component, ompi_fbtl_base_framework.framework_output);
opal_list_remove_item(&ompi_fbtl_base_framework.framework_components, &cli->super);
OBJ_RELEASE(cli);
}
/* Free entry from the "opened" list */
OBJ_RELEASE(p);
}
/* The opened list is no longer necessary, so we can free it */
OBJ_DESTRUCT (&mca_fbtl_base_components_opened);
mca_fbtl_base_components_opened_valid = false;
/* There should atleast be one fbtl component which was available */
if (false == found) {
/* Need to free all items in the list */
OBJ_DESTRUCT(&mca_fbtl_base_components_available);
mca_fbtl_base_components_available_valid = false;
opal_output_verbose (10, mca_fbtl_base_output,
if (0 == opal_list_get_size(&ompi_fbtl_base_framework.framework_components)) {
opal_output_verbose (10, ompi_fbtl_base_framework.framework_output,
"fbtl:find_available: no fbtl components available!");
return OMPI_ERROR;
}
@ -112,13 +72,12 @@ int mca_fbtl_base_find_available(bool enable_progress_threads,
static int init_query(const mca_base_component_t *m,
mca_base_component_priority_list_item_t *entry,
bool enable_progress_threads,
bool enable_mpi_threads)
{
int ret;
opal_output_verbose(10, mca_fbtl_base_output,
opal_output_verbose(10, ompi_fbtl_base_framework.framework_output,
"fbtl:find_available: querying fbtl component %s",
m->mca_component_name);
@ -126,11 +85,11 @@ static int init_query(const mca_base_component_t *m,
if (2 == m->mca_type_major_version &&
0 == m->mca_type_minor_version &&
0 == m->mca_type_release_version) {
ret = init_query_2_0_0(m, entry, enable_progress_threads,
ret = init_query_2_0_0(m, enable_progress_threads,
enable_mpi_threads);
} else {
/* unrecognised API version */
opal_output_verbose(10, mca_fbtl_base_output,
opal_output_verbose(10, ompi_fbtl_base_framework.framework_output,
"fbtl:find_available:unrecognised fbtl API version (%d.%d.%d)",
m->mca_type_major_version,
m->mca_type_minor_version,
@ -140,14 +99,11 @@ static int init_query(const mca_base_component_t *m,
/* Query done -- look at return value to see what happened */
if (OMPI_SUCCESS != ret) {
opal_output_verbose(10, mca_fbtl_base_output,
opal_output_verbose(10, ompi_fbtl_base_framework.framework_output,
"fbtl:find_available fbtl component %s is not available",
m->mca_component_name);
if (NULL != m->mca_close_component) {
m->mca_close_component();
}
} else {
opal_output_verbose(10, mca_fbtl_base_output,
opal_output_verbose(10, ompi_fbtl_base_framework.framework_output,
"fbtl:find_avalable: fbtl component %s is available",
m->mca_component_name);
@ -158,7 +114,6 @@ static int init_query(const mca_base_component_t *m,
static int init_query_2_0_0(const mca_base_component_t *component,
mca_base_component_priority_list_item_t *entry,
bool enable_progress_threads,
bool enable_mpi_threads)
{

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

@ -39,41 +39,8 @@
* Global variables; most of which are loaded by back-ends of MCA
* variables
*/
int mca_fbtl_base_param = -1;
int mca_fbtl_base_output = -1;
opal_list_t mca_fbtl_base_components_opened;
opal_list_t mca_fbtl_base_components_available;
bool mca_fbtl_base_components_available_valid = false;
bool mca_fbtl_base_components_opened_valid = false;
mca_fbtl_base_component_t mca_fbtl_base_selected_component;
mca_fbtl_base_module_t mca_fbtl;
/*
* Function for finding and opening either all MCA components, or the one
* that was specifically requested via a MCA parameter.
*/
int mca_fbtl_base_open(void)
{
/* Open an output stream for this framework */
mca_fbtl_base_output = opal_output_open(NULL);
/* Open up all available components */
if (OMPI_SUCCESS !=
mca_base_components_open("fbtl", mca_fbtl_base_output,
mca_fbtl_base_static_components,
&mca_fbtl_base_components_opened, true)) {
return OMPI_ERROR;
}
mca_fbtl_base_components_opened_valid = true;
/* Find the index of the MCA "fbtl" param for selection */
mca_fbtl_base_param = mca_base_var_find("ompi", "fbtl", NULL, NULL);
return OMPI_SUCCESS;
}
MCA_BASE_FRAMEWORK_DECLARE(ompi, fbtl, NULL, NULL, NULL, NULL,
mca_fbtl_base_static_components, 0);

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

@ -21,8 +21,7 @@ headers += \
base/base.h
libmca_fcoll_la_SOURCES += \
base/fcoll_base_close.c \
base/fcoll_base_frame.c \
base/fcoll_base_file_select.c \
base/fcoll_base_file_unselect.c \
base/fcoll_base_find_available.c \
base/fcoll_base_open.c
base/fcoll_base_find_available.c

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

@ -30,17 +30,11 @@
#include "ompi_config.h"
#include "mpi.h"
#include "opal/class/opal_list.h"
#include "opal/mca/base/base.h"
#include "ompi/mca/fcoll/fcoll.h"
#include "opal/mca/mca.h"
BEGIN_C_DECLS
OMPI_DECLSPEC int mca_fcoll_base_open(void);
OMPI_DECLSPEC int mca_fcoll_base_close(void);
OMPI_DECLSPEC int mca_fcoll_base_file_select(struct mca_io_ompio_file_t *file,
mca_base_component_t *preferred);
OMPI_DECLSPEC int mca_fcoll_base_query_table (struct mca_io_ompio_file_t *file,
@ -56,15 +50,7 @@ OMPI_DECLSPEC int mca_fcoll_base_get_param (struct mca_io_ompio_file_t *file, in
/*
* Globals
*/
OMPI_DECLSPEC extern int mca_fcoll_base_param;
OMPI_DECLSPEC extern int mca_fcoll_base_output;
OMPI_DECLSPEC extern bool mca_fcoll_base_components_opened_valid;
OMPI_DECLSPEC extern bool mca_fcoll_base_components_available_valid;
OMPI_DECLSPEC extern opal_list_t mca_fcoll_base_components_opened;
OMPI_DECLSPEC extern opal_list_t mca_fcoll_base_components_available;
OMPI_DECLSPEC extern mca_base_framework_t ompi_fcoll_base_framework;
END_C_DECLS

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

@ -1,58 +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 (c) 2008-2011 University of Houston. All rights reserved.
* $COPYRIGHTOB$
*
* 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/fcoll/fcoll.h"
#include "ompi/mca/fcoll/base/base.h"
#include "opal/util/output.h"
int mca_fcoll_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_fcoll_base_components_opened_valid) {
mca_base_components_close(mca_fcoll_base_output,
&mca_fcoll_base_components_opened, NULL);
OBJ_DESTRUCT(&mca_fcoll_base_components_opened);
mca_fcoll_base_components_opened_valid = false;
} else if (mca_fcoll_base_components_available_valid) {
mca_base_components_close(mca_fcoll_base_output,
&mca_fcoll_base_components_available, NULL);
OBJ_DESTRUCT(&mca_fcoll_base_components_available);
mca_fcoll_base_components_available_valid = false;
}
/* Close the framework output */
opal_output_close (mca_fcoll_base_output);
mca_fcoll_base_output = -1;
/* All done */
return OMPI_SUCCESS;
}

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

@ -68,21 +68,13 @@ int mca_fcoll_base_file_select (struct mca_io_ompio_file_t *file,
int priority;
int best_priority;
opal_list_item_t *item;
opal_list_item_t *next_item;
char **name_array;
int num_names;
mca_base_component_priority_list_item_t *cpli;
mca_base_component_list_item_t *cli;
mca_fcoll_base_component_t *component;
mca_fcoll_base_component_t *best_component;
mca_fcoll_base_module_t *module;
opal_list_t queried;
queried_module_t *om;
opal_list_t *selectable;
char *str;
int err = MPI_SUCCESS;
int i;
bool was_selectable_constructed = false;
const char **names_value, *names;
/* Check and see if a preferred component was provided. If it was
provided then it should be used (if possible) */
@ -90,12 +82,9 @@ int mca_fcoll_base_file_select (struct mca_io_ompio_file_t *file,
/* We have a preferred component. Check if it is available
and if so, whether it wants to run */
str = &(preferred->mca_component_name[0]);
opal_output_verbose(10, mca_fcoll_base_output,
opal_output_verbose(10, ompi_fcoll_base_framework.framework_output,
"fcoll:base:file_select: Checking preferred component: %s",
str);
preferred->mca_component_name);
/* query the component for its priority and get its module
structure. This is necessary to proceed */
@ -134,92 +123,13 @@ int mca_fcoll_base_file_select (struct mca_io_ompio_file_t *file,
* use that for this file
*/
/* Check if anything was requested by means on the name parameters */
names_value = NULL;
mca_base_var_get_value (mca_fcoll_base_param, &names_value, NULL, NULL);
names = names_value ? names_value[0] : NULL;
if (NULL != names && 0 < strlen(names)) {
name_array = opal_argv_split (names, ',');
num_names = opal_argv_count (name_array);
opal_output_verbose(10, mca_fcoll_base_output,
"fcoll:base:file_Select: Checking all available module");
/* since there are somethings which the mca requested through the
if the intersection is NULL, then we barf saying that the requested
modules are not being available */
selectable = OBJ_NEW(opal_list_t);
was_selectable_constructed = true;
/* go through the compoents_available list and check against the names
* to see whether this can be added or not */
for (item = opal_list_get_first(&mca_fcoll_base_components_available);
item != opal_list_get_end(&mca_fcoll_base_components_available);
item = opal_list_get_next(item)) {
/* convert the opal_list_item_t returned into the proper type */
cpli = (mca_base_component_priority_list_item_t *) item;
component = (mca_fcoll_base_component_t *) cpli->super.cli_component;
opal_output_verbose(10, mca_fcoll_base_output,
"select: initialising %s component %s",
component->fcollm_version.mca_type_name,
component->fcollm_version.mca_component_name);
/* check if this name is present in the mca_base_var */
for (i=0; i < num_names; i++) {
if (0 == strcmp(name_array[i], component->fcollm_version.mca_component_name)) {
/* this is present, and should be added o the selectable list */
/* We need to create a seperate object to initialise this list with
* since we cannot have the same item in 2 lists */
module = component->fcollm_file_query (file, &priority);
if (NULL != module &&
NULL != module->fcoll_module_init) {
file->f_fcoll = module;
file->f_fcoll_component = (mca_base_component_t *)component;
return module->fcoll_module_init(file);
}
/*
selectable_item = OBJ_NEW (mca_base_component_priority_list_item_t);
*selectable_item = *cpli;
opal_list_append (selectable, (opal_list_item_t *)selectable_item);
break;*/
}
}
}
/* check for a NULL intersection between the available list and the
* list which was asked for */
if (0 == opal_list_get_size(selectable)) {
was_selectable_constructed = true;
OBJ_RELEASE (selectable);
opal_output_verbose (10, mca_fcoll_base_output,
"fcoll:base:file_select: preferred modules were not available");
return OMPI_ERROR;
}
} else { /* if there was no name_array, then we need to simply initialize
selectable to mca_fcoll_base_components_available */
selectable = &mca_fcoll_base_components_available;
}
best_component = NULL;
best_priority = -1;
OBJ_CONSTRUCT(&queried, opal_list_t);
for (item = opal_list_get_first(selectable);
item != opal_list_get_end(selectable);
item = opal_list_get_next(item)) {
/*
* convert the opal_list_item_t returned into the proper type
*/
cpli = (mca_base_component_priority_list_item_t *) item;
component = (mca_fcoll_base_component_t *) cpli->super.cli_component;
opal_output_verbose(10, mca_fcoll_base_output,
OPAL_LIST_FOREACH(cli, &ompi_fcoll_base_framework.framework_components, mca_base_component_list_item_t) {
component = (mca_fcoll_base_component_t *) cli->cli_component;
opal_output_verbose(10, ompi_fcoll_base_framework.framework_output,
"select: initialising %s component %s",
component->fcollm_version.mca_type_name,
component->fcollm_version.mca_component_name);
@ -228,7 +138,7 @@ int mca_fcoll_base_file_select (struct mca_io_ompio_file_t *file,
* we can call the query function only if there is a function :-)
*/
if (NULL == component->fcollm_file_query) {
opal_output_verbose(10, mca_fcoll_base_output,
opal_output_verbose(10, ompi_fcoll_base_framework.framework_output,
"select: no query, ignoring the component");
} else {
/*
@ -241,10 +151,10 @@ int mca_fcoll_base_file_select (struct mca_io_ompio_file_t *file,
/*
* query did not return any action which can be used
*/
opal_output_verbose(10, mca_fcoll_base_output,
opal_output_verbose(10, ompi_fcoll_base_framework.framework_output,
"select: query returned failure");
} else {
opal_output_verbose(10, mca_fcoll_base_output,
opal_output_verbose(10, ompi_fcoll_base_framework.framework_output,
"select: query returned priority %d",
priority);
/*
@ -270,25 +180,6 @@ int mca_fcoll_base_file_select (struct mca_io_ompio_file_t *file,
} /* end else of if (NULL == component->fcollm_init) */
} /* end for ... end of traversal */
/* We have to remove empty out the selectable list if the selectable
* list was constructed as a duplicate and not as a pointer to the
* mca_base_components_available list. So, check and destroy */
if (was_selectable_constructed) {
/* remove all the items first */
for (item = opal_list_get_first(&mca_fcoll_base_components_available);
item != opal_list_get_end(&mca_fcoll_base_components_available);
item = next_item) {
next_item = opal_list_get_next(item);
OBJ_RELEASE (item);
}
/* release the list itself */
OBJ_RELEASE (selectable);
was_selectable_constructed = false;
}
/*
* Now we have alist of components which successfully returned
* their module struct. One of these components has the best
@ -311,9 +202,7 @@ int mca_fcoll_base_file_select (struct mca_io_ompio_file_t *file,
* unquery() those components which have not been selected and
* init() the component which was selected
*/
for (item = opal_list_remove_first(&queried);
NULL != item;
item = opal_list_remove_first(&queried)) {
while (NULL != (item = opal_list_remove_first(&queried))) {
om = (queried_module_t *) item;
if (om->om_component == best_component) {
/*
@ -349,7 +238,7 @@ int mca_fcoll_base_file_select (struct mca_io_ompio_file_t *file,
* unquery. Hence this check is necessary
*/
(void) om->om_component->fcollm_file_unquery(file);
opal_output_verbose(10, mca_fcoll_base_output,
opal_output_verbose(10, ompi_fcoll_base_framework.framework_output,
"select: component %s is not selected",
om->om_component->fcollm_version.mca_component_name);
} /* end if */
@ -357,7 +246,7 @@ int mca_fcoll_base_file_select (struct mca_io_ompio_file_t *file,
OBJ_RELEASE(om);
} /* traversing through the entire list */
opal_output_verbose(10, mca_fcoll_base_output,
opal_output_verbose(10, ompi_fcoll_base_framework.framework_output,
"select: component %s selected",
best_component->fcollm_version.mca_component_name);

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

@ -24,85 +24,45 @@
#include "mpi.h"
#include "ompi/constants.h"
#include "opal/class/opal_list.h"
#include "opal/mca/mca.h"
#include "opal/mca/base/base.h"
#include "opal/mca/base/mca_base_component_repository.h"
#include "ompi/mca/fcoll/fcoll.h"
#include "ompi/mca/fcoll/base/base.h"
#include "opal/util/output.h"
opal_list_t mca_fcoll_base_modules_available;
bool mca_fcoll_base_modules_available_valid = false;
static int init_query(const mca_base_component_t *m,
mca_base_component_priority_list_item_t *entry,
bool enable_progress_threads,
bool enable_mpi_threads);
static int init_query_2_0_0(const mca_base_component_t *component,
mca_base_component_priority_list_item_t *entry,
bool enable_progress_threads,
bool enable_mpi_threads);
int mca_fcoll_base_find_available(bool enable_progress_threads,
bool enable_mpi_threads)
{
bool found = false;
mca_base_component_priority_list_item_t *entry;
opal_list_item_t *p;
/* Initialize the list */
OBJ_CONSTRUCT(&mca_fcoll_base_components_available, opal_list_t);
mca_fcoll_base_components_available_valid = true;
mca_base_component_list_item_t *cli, *next;
/* The list of components which we should check is already present
in mca_fcoll_base_components_opened, which was established in
mca_fcoll_base_open */
for (found = false,
p = opal_list_remove_first (&mca_fcoll_base_components_opened);
NULL != p;
p = opal_list_remove_first (&mca_fcoll_base_components_opened)) {
entry = OBJ_NEW(mca_base_component_priority_list_item_t);
entry->super.cli_component =
((mca_base_component_list_item_t *)p)->cli_component;
OPAL_LIST_FOREACH_SAFE(cli, next, &ompi_fcoll_base_framework.framework_components, mca_base_component_list_item_t) {
/* Now for this entry, we have to determine the thread level. Call
a subroutine to do the job for us */
if (OMPI_SUCCESS == init_query(entry->super.cli_component, entry,
if (OMPI_SUCCESS != init_query(cli->cli_component,
enable_progress_threads,
enable_mpi_threads)) {
/* Save the results in the list. The priority is not relvant at
this point in time. But we save the thread arguments so that
the initial selection algorithm can negotiate overall thread
level for this process */
entry->cpli_priority = 0;
opal_list_append (&mca_fcoll_base_components_available,
(opal_list_item_t *) entry);
found = true;
} else {
/* The component does not want to run, so close it. Its close()
has already been invoked. Close it out of the DSO repository
(if it is there in the repository) */
mca_base_component_repository_release(entry->super.cli_component);
OBJ_RELEASE(entry);
opal_list_remove_item(&ompi_fcoll_base_framework.framework_components, &cli->super);
mca_base_component_close(cli->cli_component, ompi_fcoll_base_framework.framework_output);;
OBJ_RELEASE(cli);
}
/* Free entry from the "opened" list */
OBJ_RELEASE(p);
}
/* The opened list is no longer necessary, so we can free it */
OBJ_DESTRUCT (&mca_fcoll_base_components_opened);
mca_fcoll_base_components_opened_valid = false;
/* There should atleast be one fcoll component which was available */
if (false == found) {
/* Need to free all items in the list */
OBJ_DESTRUCT(&mca_fcoll_base_components_available);
mca_fcoll_base_components_available_valid = false;
opal_output_verbose (10, mca_fcoll_base_output,
if (0 == opal_list_get_size(&ompi_fcoll_base_framework.framework_components)) {
opal_output_verbose (10, ompi_fcoll_base_framework.framework_output,
"fcoll:find_available: no fcoll components available!");
return OMPI_ERROR;
}
@ -113,13 +73,12 @@ int mca_fcoll_base_find_available(bool enable_progress_threads,
static int init_query(const mca_base_component_t *m,
mca_base_component_priority_list_item_t *entry,
bool enable_progress_threads,
bool enable_mpi_threads)
{
int ret;
opal_output_verbose(10, mca_fcoll_base_output,
opal_output_verbose(10, ompi_fcoll_base_framework.framework_output,
"fcoll:find_available: querying fcoll component %s",
m->mca_component_name);
@ -127,11 +86,11 @@ static int init_query(const mca_base_component_t *m,
if (2 == m->mca_type_major_version &&
0 == m->mca_type_minor_version &&
0 == m->mca_type_release_version) {
ret = init_query_2_0_0(m, entry, enable_progress_threads,
ret = init_query_2_0_0(m, enable_progress_threads,
enable_mpi_threads);
} else {
/* unrecognised API version */
opal_output_verbose(10, mca_fcoll_base_output,
opal_output_verbose(10, ompi_fcoll_base_framework.framework_output,
"fcoll:find_available:unrecognised fcoll API version (%d.%d.%d)",
m->mca_type_major_version,
m->mca_type_minor_version,
@ -141,14 +100,11 @@ static int init_query(const mca_base_component_t *m,
/* Query done -- look at return value to see what happened */
if (OMPI_SUCCESS != ret) {
opal_output_verbose(10, mca_fcoll_base_output,
opal_output_verbose(10, ompi_fcoll_base_framework.framework_output,
"fcoll:find_available fcoll component %s is not available",
m->mca_component_name);
if (NULL != m->mca_close_component) {
m->mca_close_component();
}
} else {
opal_output_verbose(10, mca_fcoll_base_output,
opal_output_verbose(10, ompi_fcoll_base_framework.framework_output,
"fcoll:find_avalable: fcoll component %s is available",
m->mca_component_name);
@ -159,7 +115,6 @@ static int init_query(const mca_base_component_t *m,
static int init_query_2_0_0(const mca_base_component_t *component,
mca_base_component_priority_list_item_t *entry,
bool enable_progress_threads,
bool enable_mpi_threads)
{

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

@ -39,41 +39,6 @@
* Global variables; most of which are loaded by back-ends of MCA
* variables
*/
int mca_fcoll_base_param = -1;
int mca_fcoll_base_output = -1;
opal_list_t mca_fcoll_base_components_opened;
opal_list_t mca_fcoll_base_components_available;
bool mca_fcoll_base_components_available_valid = false;
bool mca_fcoll_base_components_opened_valid = false;
mca_fcoll_base_component_t mca_fcoll_base_selected_component;
mca_fcoll_base_module_t mca_fcoll;
/*
* Function for finding and opening either all MCA components, or the one
* that was specifically requested via a MCA parameter.
*/
int mca_fcoll_base_open(void)
{
/* Open an output stream for this framework */
mca_fcoll_base_output = opal_output_open(NULL);
/* Open up all available components */
if (OMPI_SUCCESS !=
mca_base_components_open("fcoll", mca_fcoll_base_output,
mca_fcoll_base_static_components,
&mca_fcoll_base_components_opened, true)) {
return OMPI_ERROR;
}
mca_fcoll_base_components_opened_valid = true;
/* Find the index of the MCA "fcoll" param for selection */
mca_fcoll_base_param = mca_base_var_find("ompi", "fcoll", NULL, NULL);
return OMPI_SUCCESS;
}
MCA_BASE_FRAMEWORK_DECLARE(ompi, fcoll, NULL, NULL, NULL, NULL,
mca_fcoll_base_static_components, 0);

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

@ -21,9 +21,8 @@ headers += \
base/base.h
libmca_fs_la_SOURCES += \
base/fs_base_close.c \
base/fs_base_frame.c \
base/fs_base_file_select.c \
base/fs_base_file_unselect.c \
base/fs_base_find_available.c \
base/fs_base_get_parent_dir.c \
base/fs_base_open.c
base/fs_base_get_parent_dir.c

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

@ -30,17 +30,12 @@
#include "ompi_config.h"
#include "mpi.h"
#include "opal/class/opal_list.h"
#include "ompi/mca/fs/fs.h"
#include "opal/mca/mca.h"
#include "opal/mca/base/base.h"
BEGIN_C_DECLS
OMPI_DECLSPEC int mca_fs_base_open(void);
OMPI_DECLSPEC int mca_fs_base_close(void);
OMPI_DECLSPEC int mca_fs_base_file_select(struct mca_io_ompio_file_t *file,
mca_base_component_t *preferred);
@ -57,14 +52,7 @@ OMPI_DECLSPEC void mca_fs_base_get_parent_dir (char *filename, char **dirnamep);
* Globals
*/
OMPI_DECLSPEC extern int mca_fs_base_param;
OMPI_DECLSPEC extern int mca_fs_base_output;
OMPI_DECLSPEC extern bool mca_fs_base_components_opened_valid;
OMPI_DECLSPEC extern bool mca_fs_base_components_available_valid;
OMPI_DECLSPEC extern opal_list_t mca_fs_base_components_opened;
OMPI_DECLSPEC extern opal_list_t mca_fs_base_components_available;
OMPI_DECLSPEC extern mca_base_framework_t ompi_fs_base_framework;
END_C_DECLS

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

@ -1,58 +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 (c) 2008-2011 University of Houston. All rights reserved.
* $COPYRIGHTOB$
*
* 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/fs/fs.h"
#include "ompi/mca/fs/base/base.h"
#include "opal/util/output.h"
int mca_fs_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_fs_base_components_opened_valid) {
mca_base_components_close(mca_fs_base_output,
&mca_fs_base_components_opened, NULL);
OBJ_DESTRUCT(&mca_fs_base_components_opened);
mca_fs_base_components_opened_valid = false;
} else if (mca_fs_base_components_available_valid) {
mca_base_components_close(mca_fs_base_output,
&mca_fs_base_components_available, NULL);
OBJ_DESTRUCT(&mca_fs_base_components_available);
mca_fs_base_components_available_valid = false;
}
/* Close the framework output */
opal_output_close (mca_fs_base_output);
mca_fs_base_output = -1;
/* All done */
return OMPI_SUCCESS;
}

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

@ -68,22 +68,13 @@ int mca_fs_base_file_select (struct mca_io_ompio_file_t *file,
int priority;
int best_priority;
opal_list_item_t *item;
opal_list_item_t *next_item;
mca_base_component_priority_list_item_t *selectable_item;
char **name_array;
int num_names;
mca_base_component_priority_list_item_t *cpli;
mca_base_component_list_item_t *cli;
mca_fs_base_component_t *component;
mca_fs_base_component_t *best_component;
mca_fs_base_module_t *module;
opal_list_t queried;
queried_module_t *om;
opal_list_t *selectable;
char *str;
int err = MPI_SUCCESS;
int i;
bool was_selectable_constructed = false;
const char **names_value, *names;
/* Check and see if a preferred component was provided. If it was
provided then it should be used (if possible) */
@ -92,12 +83,9 @@ int mca_fs_base_file_select (struct mca_io_ompio_file_t *file,
/* We have a preferred component. Check if it is available
and if so, whether it wants to run */
str = &(preferred->mca_component_name[0]);
opal_output_verbose(10, mca_fs_base_output,
opal_output_verbose(10, ompi_fs_base_framework.framework_output,
"fs:base:file_select: Checking preferred component: %s",
str);
preferred->mca_component_name);
/* query the component for its priority and get its module
structure. This is necessary to proceed */
@ -136,83 +124,13 @@ int mca_fs_base_file_select (struct mca_io_ompio_file_t *file,
* use that for this file
*/
/* Check if anything was requested by means on the name parameters */
names_value = NULL;
mca_base_var_get_value(mca_fs_base_param, &names_value, NULL, NULL);
names = names_value ? names_value[0] : NULL;
if (NULL != names && 0 < strlen(names)) {
name_array = opal_argv_split (names, ',');
num_names = opal_argv_count (name_array);
opal_output_verbose(10, mca_fs_base_output,
"fs:base:file_Select: Checking all available module");
/* since there are somethings which the mca requested through the
if the intersection is NULL, then we barf saying that the requested
modules are not being available */
selectable = OBJ_NEW(opal_list_t);
was_selectable_constructed = true;
/* go through the compoents_available list and check against the names
* to see whether this can be added or not */
for (item = opal_list_get_first(&mca_fs_base_components_available);
item != opal_list_get_end(&mca_fs_base_components_available);
item = opal_list_get_next(item)) {
/* convert the opal_list_item_t returned into the proper type */
cpli = (mca_base_component_priority_list_item_t *) item;
component = (mca_fs_base_component_t *) cpli->super.cli_component;
opal_output_verbose(10, mca_fs_base_output,
"select: initialising %s component %s",
component->fsm_version.mca_type_name,
component->fsm_version.mca_component_name);
/* check if this name is present in the mca_base_var */
for (i=0; i < num_names; i++) {
if (0 == strcmp(name_array[i], component->fsm_version.mca_component_name)) {
/* this is present, and should be added o the selectable list */
/* We need to create a seperate object to initialise this list with
* since we cannot have the same item in 2 lists */
selectable_item = OBJ_NEW (mca_base_component_priority_list_item_t);
*selectable_item = *cpli;
opal_list_append (selectable, (opal_list_item_t *)selectable_item);
break;
}
}
}
/* check for a NULL intersection between the available list and the
* list which was asked for */
if (0 == opal_list_get_size(selectable)) {
was_selectable_constructed = true;
OBJ_RELEASE (selectable);
opal_output_verbose (10, mca_fs_base_output,
"fs:base:file_select: preferred modules were not available");
return OMPI_ERROR;
}
} else { /* if there was no name_array, then we need to simply initialize
selectable to mca_fs_base_components_available */
selectable = &mca_fs_base_components_available;
}
best_component = NULL;
best_priority = -1;
OBJ_CONSTRUCT(&queried, opal_list_t);
for (item = opal_list_get_first(selectable);
item != opal_list_get_end(selectable);
item = opal_list_get_next(item)) {
/*
* convert the opal_list_item_t returned into the proper type
*/
cpli = (mca_base_component_priority_list_item_t *) item;
component = (mca_fs_base_component_t *) cpli->super.cli_component;
opal_output_verbose(10, mca_fs_base_output,
OPAL_LIST_FOREACH(cli, &ompi_fs_base_framework.framework_components, mca_base_component_list_item_t) {
component = (mca_fs_base_component_t *) cli->cli_component;
opal_output_verbose(10, ompi_fs_base_framework.framework_output,
"select: initialising %s component %s",
component->fsm_version.mca_type_name,
component->fsm_version.mca_component_name);
@ -221,7 +139,7 @@ int mca_fs_base_file_select (struct mca_io_ompio_file_t *file,
* we can call the query function only if there is a function :-)
*/
if (NULL == component->fsm_file_query) {
opal_output_verbose(10, mca_fs_base_output,
opal_output_verbose(10, ompi_fs_base_framework.framework_output,
"select: no query, ignoring the component");
} else {
/*
@ -234,10 +152,10 @@ int mca_fs_base_file_select (struct mca_io_ompio_file_t *file,
/*
* query did not return any action which can be used
*/
opal_output_verbose(10, mca_fs_base_output,
opal_output_verbose(10, ompi_fs_base_framework.framework_output,
"select: query returned failure");
} else {
opal_output_verbose(10, mca_fs_base_output,
opal_output_verbose(10, ompi_fs_base_framework.framework_output,
"select: query returned priority %d",
priority);
/*
@ -263,25 +181,6 @@ int mca_fs_base_file_select (struct mca_io_ompio_file_t *file,
} /* end else of if (NULL == component->fsm_init) */
} /* end for ... end of traversal */
/* We have to remove empty out the selectable list if the selectable
* list was constructed as a duplicate and not as a pointer to the
* mca_base_components_available list. So, check and destroy */
if (was_selectable_constructed) {
/* remove all the items first */
for (item = opal_list_get_first(&mca_fs_base_components_available);
item != opal_list_get_end(&mca_fs_base_components_available);
item = next_item) {
next_item = opal_list_get_next(item);
OBJ_RELEASE (item);
}
/* release the list itself */
OBJ_RELEASE (selectable);
was_selectable_constructed = false;
}
/*
* Now we have alist of components which successfully returned
* their module struct. One of these components has the best
@ -304,9 +203,7 @@ int mca_fs_base_file_select (struct mca_io_ompio_file_t *file,
* unquery() those components which have not been selected and
* init() the component which was selected
*/
for (item = opal_list_remove_first(&queried);
NULL != item;
item = opal_list_remove_first(&queried)) {
while (NULL != (item = opal_list_remove_first(&queried))) {
om = (queried_module_t *) item;
if (om->om_component == best_component) {
/*
@ -339,7 +236,7 @@ int mca_fs_base_file_select (struct mca_io_ompio_file_t *file,
* unquery. Hence this check is necessary
*/
(void) om->om_component->fsm_file_unquery(file);
opal_output_verbose(10, mca_fs_base_output,
opal_output_verbose(10, ompi_fs_base_framework.framework_output,
"select: component %s is not selected",
om->om_component->fsm_version.mca_component_name);
} /* end if */
@ -347,7 +244,7 @@ int mca_fs_base_file_select (struct mca_io_ompio_file_t *file,
OBJ_RELEASE(om);
} /* traversing through the entire list */
opal_output_verbose(10, mca_fs_base_output,
opal_output_verbose(10, ompi_fs_base_framework.framework_output,
"select: component %s selected",
best_component->fsm_version.mca_component_name);

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

@ -24,85 +24,47 @@
#include "mpi.h"
#include "ompi/constants.h"
#include "opal/class/opal_list.h"
#include "opal/mca/mca.h"
#include "opal/mca/base/base.h"
#include "opal/mca/base/mca_base_component_repository.h"
#include "ompi/mca/fs/fs.h"
#include "ompi/mca/fs/base/base.h"
#include "opal/util/output.h"
opal_list_t mca_fs_base_modules_available;
bool mca_fs_base_modules_available_valid = false;
static int init_query(const mca_base_component_t *m,
mca_base_component_priority_list_item_t *entry,
bool enable_progress_threads,
bool enable_mpi_threads);
static int init_query_2_0_0(const mca_base_component_t *component,
mca_base_component_priority_list_item_t *entry,
bool enable_progress_threads,
bool enable_mpi_threads);
int mca_fs_base_find_available(bool enable_progress_threads,
bool enable_mpi_threads)
{
bool found = false;
mca_base_component_priority_list_item_t *entry;
opal_list_item_t *p;
/* Initialize the list */
OBJ_CONSTRUCT(&mca_fs_base_components_available, opal_list_t);
mca_fs_base_components_available_valid = true;
mca_base_component_list_item_t *cli, *next;
/* The list of components which we should check is already present
in mca_fs_base_components_opened, which was established in
mca_fs_base_open */
for (found = false,
p = opal_list_remove_first (&mca_fs_base_components_opened);
NULL != p;
p = opal_list_remove_first (&mca_fs_base_components_opened)) {
entry = OBJ_NEW(mca_base_component_priority_list_item_t);
entry->super.cli_component =
((mca_base_component_list_item_t *)p)->cli_component;
OPAL_LIST_FOREACH_SAFE(cli, next, &ompi_fs_base_framework.framework_components, mca_base_component_list_item_t) {
/* Now for this entry, we have to determine the thread level. Call
a subroutine to do the job for us */
if (OMPI_SUCCESS == init_query(entry->super.cli_component, entry,
if (OMPI_SUCCESS != init_query(cli->cli_component,
enable_progress_threads,
enable_mpi_threads)) {
/* Save the results in the list. The priority is not relvant at
this point in time. But we save the thread arguments so that
the initial selection algorithm can negotiate overall thread
level for this process */
entry->cpli_priority = 0;
opal_list_append (&mca_fs_base_components_available,
(opal_list_item_t *) entry);
found = true;
} else {
/* The component does not want to run, so close it. Its close()
has already been invoked. Close it out of the DSO repository
(if it is there in the repository) */
mca_base_component_repository_release(entry->super.cli_component);
OBJ_RELEASE(entry);
opal_list_remove_item (&ompi_fs_base_framework.framework_components, &cli->super);
mca_base_component_close(cli->cli_component, ompi_fs_base_framework.framework_output);
OBJ_RELEASE(cli);
}
/* Free entry from the "opened" list */
OBJ_RELEASE(p);
}
/* The opened list is no longer necessary, so we can free it */
OBJ_DESTRUCT (&mca_fs_base_components_opened);
mca_fs_base_components_opened_valid = false;
/* There should atleast be one fs component which was available */
if (false == found) {
/* Need to free all items in the list */
OBJ_DESTRUCT(&mca_fs_base_components_available);
mca_fs_base_components_available_valid = false;
opal_output_verbose (10, mca_fs_base_output,
if (0 == opal_list_get_size(&ompi_fs_base_framework.framework_components)) {
opal_output_verbose (10, ompi_fs_base_framework.framework_output,
"fs:find_available: no fs components available!");
return OMPI_ERROR;
}
@ -113,13 +75,12 @@ int mca_fs_base_find_available(bool enable_progress_threads,
static int init_query(const mca_base_component_t *m,
mca_base_component_priority_list_item_t *entry,
bool enable_progress_threads,
bool enable_mpi_threads)
{
int ret;
opal_output_verbose(10, mca_fs_base_output,
opal_output_verbose(10, ompi_fs_base_framework.framework_output,
"fs:find_available: querying fs component %s",
m->mca_component_name);
@ -127,11 +88,11 @@ static int init_query(const mca_base_component_t *m,
if (2 == m->mca_type_major_version &&
0 == m->mca_type_minor_version &&
0 == m->mca_type_release_version) {
ret = init_query_2_0_0(m, entry, enable_progress_threads,
ret = init_query_2_0_0(m, enable_progress_threads,
enable_mpi_threads);
} else {
/* unrecognised API version */
opal_output_verbose(10, mca_fs_base_output,
opal_output_verbose(10, ompi_fs_base_framework.framework_output,
"fs:find_available:unrecognised fs API version (%d.%d.%d)",
m->mca_type_major_version,
m->mca_type_minor_version,
@ -141,14 +102,11 @@ static int init_query(const mca_base_component_t *m,
/* Query done -- look at return value to see what happened */
if (OMPI_SUCCESS != ret) {
opal_output_verbose(10, mca_fs_base_output,
opal_output_verbose(10, ompi_fs_base_framework.framework_output,
"fs:find_available fs component %s is not available",
m->mca_component_name);
if (NULL != m->mca_close_component) {
m->mca_close_component();
}
} else {
opal_output_verbose(10, mca_fs_base_output,
opal_output_verbose(10, ompi_fs_base_framework.framework_output,
"fs:find_avalable: fs component %s is available",
m->mca_component_name);
@ -159,7 +117,6 @@ static int init_query(const mca_base_component_t *m,
static int init_query_2_0_0(const mca_base_component_t *component,
mca_base_component_priority_list_item_t *entry,
bool enable_progress_threads,
bool enable_mpi_threads)
{

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

@ -2,13 +2,14 @@
* 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
* Copyright (c) 2004-2011 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-2011 University of Houston. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -16,29 +17,18 @@
* $HEADER$
*/
#include "ompi_config.h"
#include <stdio.h>
#include "ompi/mca/fs/base/base.h"
#include "ompi/constants.h"
#include "opal/mca/mca.h"
#include "opal/mca/base/base.h"
#include "ompi/mca/allocator/allocator.h"
#include "ompi/mca/allocator/base/base.h"
/**
* Closes all the remaining modules.
*
* @retval OMPI_SUCCESS
/*
* The following file was created by configure. It contains extern
* statements and the definition of an array of pointers to each
* component's public mca_base_component_t struct.
*/
int mca_allocator_base_close(void)
{
/* Close all remaining available modules (may be one if this is a
OMPI RTE program, or [possibly] multiple if this is ompi_info) */
mca_base_components_close(0, &mca_allocator_base_components, NULL);
/* All done */
return OMPI_SUCCESS;
}
#include "ompi/mca/fs/base/static-components.h"
MCA_BASE_FRAMEWORK_DECLARE(ompi, fs, NULL, NULL, NULL, NULL,
mca_fs_base_static_components, 0);

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

@ -1,80 +0,0 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2011 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-2011 University of Houston. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "ompi_config.h"
#include <stdio.h>
#include "ompi/class/ompi_free_list.h"
#include "opal/mca/mca.h"
#include "opal/mca/base/base.h"
#include "ompi/mca/fs/fs.h"
#include "ompi/mca/fs/base/base.h"
/*
* The following file was created by configure. It contains extern
* statements and the definition of an array of pointers to each
* component's public mca_base_component_t struct.
*/
#include "ompi/mca/fs/base/static-components.h"
/*
* Global variables; most of which are loaded by back-ends of MCA
* variables
*/
int mca_fs_base_param = -1;
int mca_fs_base_output = -1;
opal_list_t mca_fs_base_components_opened;
opal_list_t mca_fs_base_components_available;
bool mca_fs_base_components_available_valid = false;
bool mca_fs_base_components_opened_valid = false;
mca_fs_base_component_t mca_fs_base_selected_component;
mca_fs_base_module_t mca_fs;
/*
* Function for finding and opening either all MCA components, or the one
* that was specifically requested via a MCA parameter.
*/
int mca_fs_base_open(void)
{
/* Open an output stream for this framework */
mca_fs_base_output = opal_output_open(NULL);
/* Open up all available components */
if (OMPI_SUCCESS !=
mca_base_components_open("fs", mca_fs_base_output,
mca_fs_base_static_components,
&mca_fs_base_components_opened, true)) {
return OMPI_ERROR;
}
mca_fs_base_components_opened_valid = true;
/* Find the index of the MCA "fs" param for selection */
mca_fs_base_param = mca_base_var_find("ompi", "fs", NULL, NULL);
return OMPI_SUCCESS;
}

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

@ -21,10 +21,9 @@ headers += \
base/io_base_request.h
libmca_io_la_SOURCES += \
base/io_base_close.c \
base/io_base_frame.c \
base/io_base_delete.c \
base/io_base_file_select.c \
base/io_base_find_available.c \
base/io_base_open.c \
base/io_base_request.c \
base/io_base_register_datarep.c

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

@ -30,7 +30,7 @@
#include "mpi.h"
#include "opal/class/opal_list.h"
#include "ompi/class/ompi_free_list.h"
#include "opal/mca/base/base.h"
#include "ompi/mca/io/io.h"
@ -39,28 +39,6 @@
*/
BEGIN_C_DECLS
/**
* Initialize the io MCA framework
*
* @retval OMPI_SUCCESS Upon success
* @retval OMPI_ERROR Upon failure
*
* This must be the first function invoked in the io MCA
* framework. It initializes the io MCA framework, finds and
* opens io 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_io_base_components_opened, which is a list of all io components
* that were successfully opened. This variable should \em only be
* used by other io base functions -- it is not considered a
* public interface member -- and is only mentioned here for
* completeness.
*/
OMPI_DECLSPEC int mca_io_base_open(void);
/**
* Create list of available io components.
*
@ -179,19 +157,6 @@ BEGIN_C_DECLS
OMPI_DECLSPEC int mca_io_base_delete(char *filename,
struct ompi_info_t *info);
/**
* Shut down the io MCA framework.
*
* @retval OMPI_SUCCESS Always
*
* This function shuts down everything in the io MCA framework,
* and is called during ompi_mpi_finalize() and the special case of
* the laminfo fileand.
*
* It must be the last function invoked on the io MCA framework.
*/
OMPI_DECLSPEC int mca_io_base_close(void);
OMPI_DECLSPEC int mca_io_base_register_datarep(char *,
MPI_Datarep_conversion_function*,
MPI_Datarep_conversion_function*,
@ -202,39 +167,7 @@ BEGIN_C_DECLS
* Globals
*/
/**
* Index number from the "io" MCA parameter, created when the io
* framework is initialized and used during scope selection.
*/
OMPI_DECLSPEC extern int mca_io_base_param;
/**
* io framework debugging stream ID used with opal_output() and
* opal_output_verbose().
*/
OMPI_DECLSPEC extern int mca_io_base_output;
/**
* Indicator as to whether the list of opened io components is valid or
* not.
*/
OMPI_DECLSPEC extern bool mca_io_base_components_opened_valid;
/**
* List of all opened components; created when the io framework is
* initialized and destroyed when we reduce the list to all available
* io components.
*/
OMPI_DECLSPEC extern opal_list_t mca_io_base_components_opened;
/**
* Indicator as to whether the list of available io components is valid
* or not.
*/
OMPI_DECLSPEC extern bool mca_io_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.
*/
OMPI_DECLSPEC extern opal_list_t mca_io_base_components_available;
OMPI_DECLSPEC extern mca_base_framework_t ompi_io_base_framework;
END_C_DECLS
#endif /* MCA_BASE_IO_H */

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

@ -1,56 +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/io/io.h"
#include "ompi/mca/io/base/base.h"
#include "ompi/mca/io/base/io_base_request.h"
int mca_io_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_io_base_components_opened_valid) {
mca_base_components_close(mca_io_base_output,
&mca_io_base_components_opened, NULL);
OBJ_DESTRUCT(&mca_io_base_components_opened);
mca_io_base_components_opened_valid = false;
} else if (mca_io_base_components_available_valid) {
mca_base_components_close(mca_io_base_output,
&mca_io_base_components_available, NULL);
OBJ_DESTRUCT(&mca_io_base_components_available);
mca_io_base_components_available_valid = false;
}
/* Close the framework output */
opal_output_close (mca_io_base_output);
mca_io_base_output = -1;
/* All done */
return OMPI_SUCCESS;
}

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

@ -75,26 +75,20 @@ static OBJ_CLASS_INSTANCE(avail_io_t, opal_list_item_t, NULL, NULL);
*/
int mca_io_base_delete(char *filename, struct ompi_info_t *info)
{
int err, num_names;
char **name_array;
int err;
opal_list_t *selectable;
opal_list_item_t *item;
avail_io_t *avail, selected;
const char **names_value, *names;
/* Announce */
opal_output_verbose(10, mca_io_base_output,
opal_output_verbose(10, ompi_io_base_framework.framework_output,
"io:base:delete: deleting file: %s",
filename);
/* See if a set of component was requested by the MCA parameter.
Don't check for error. */
names_value = NULL;
(void) mca_base_var_get_value(mca_io_base_param, &names_value, NULL, NULL);
names = names_value ? names_value[0] : NULL;
/* Compute the intersection of all of my available components with
the components from all the other processes in this file */
@ -104,27 +98,10 @@ int mca_io_base_delete(char *filename, struct ompi_info_t *info)
and check them all */
err = OMPI_ERROR;
if (NULL != names && 0 < strlen(names)) {
name_array = opal_argv_split(names, ',');
num_names = opal_argv_count(name_array);
opal_output_verbose(10, mca_io_base_output,
"io:base:delete: Checking specific modules: %s",
names);
selectable = check_components(&mca_io_base_components_available,
filename, info, name_array, num_names);
opal_argv_free(name_array);
}
/* Nope -- a specific [set of] component[s] was not requested. Go
check them all. */
else {
opal_output_verbose(10, mca_io_base_output,
opal_output_verbose(10, ompi_io_base_framework.framework_output,
"io:base:delete: Checking all available modules");
selectable = check_components(&mca_io_base_components_available,
selectable = check_components(&ompi_io_base_framework.framework_components,
filename, info, NULL, 0);
}
/* Upon return from the above, the modules list will contain the
list of modules that returned (priority >= 0). If we have no
@ -169,7 +146,7 @@ int mca_io_base_delete(char *filename, struct ompi_info_t *info)
/* Announce the winner */
opal_output_verbose(10, mca_io_base_output,
opal_output_verbose(10, ompi_io_base_framework.framework_output,
"io:base:delete: Selected io component %s",
selected.ai_component.v2_0_0.io_version.mca_component_name);
@ -177,6 +154,22 @@ int mca_io_base_delete(char *filename, struct ompi_info_t *info)
}
static int avail_io_compare (opal_list_item_t **itema,
opal_list_item_t **itemb)
{
const avail_io_t *availa = (const avail_io_t *) *itema;
const avail_io_t *availb = (const avail_io_t *) *itemb;
/* highest component last */
if (availa->ai_priority > availb->ai_priority) {
return 1;
} else if (availa->ai_priority < availb->ai_priority) {
return -1;
} else {
return 0;
}
}
/*
* For each module in the list, if it is in the list of names (or the
* list of names is NULL), then check and see if it wants to run, and
@ -190,10 +183,10 @@ static opal_list_t *check_components(opal_list_t *components,
{
int i;
const mca_base_component_t *component;
opal_list_item_t *item, *item2;
mca_base_component_list_item_t *cli;
bool want_to_check;
opal_list_t *selectable;
avail_io_t *avail, *avail2;
avail_io_t *avail;
/* Make a list of the components that query successfully */
@ -203,11 +196,8 @@ static opal_list_t *check_components(opal_list_t *components,
O(N^2), but we should never have too many components and/or
names, 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;
OPAL_LIST_FOREACH(cli, components, mca_base_component_list_item_t) {
component = cli->cli_component;
/* If we have a list of names, scan through it */
@ -232,50 +222,9 @@ static opal_list_t *check_components(opal_list_t *components,
/* Put this item on the list in priority order
(highest priority first). Should it go first? */
/* MSC actually put it Lowest priority first */
for(item2 = opal_list_get_first(selectable);
item2 != opal_list_get_end(selectable);
item2 = opal_list_get_next(item2)) {
avail2 = (avail_io_t*)item2;
if(avail->ai_priority < avail2->ai_priority) {
opal_list_insert_pos(selectable,
item2, (opal_list_item_t*)avail);
break;
}
}
if(opal_list_get_end(selectable) == item2) {
/* NTH sort this out later */
opal_list_append(selectable, (opal_list_item_t*)avail);
}
/*
item2 = opal_list_get_first(selectable);
avail2 = (avail_io_t *) item2;
if (opal_list_get_end(selectable) == item2 ||
avail->ai_priority > avail2->ai_priority) {
opal_list_prepend(selectable, (opal_list_item_t*) avail);
} else {
for (i = 1; item2 != opal_list_get_end(selectable);
item2 = opal_list_get_next(selectable), ++i) {
avail2 = (avail_io_t *) item2;
if (avail->ai_priority > avail2->ai_priority) {
opal_list_insert(selectable,
(opal_list_item_t *) avail, i);
break;
}
}
*/
/* If we didn't find a place to put it in the
list, then append it (because it has the lowest
priority found so far) */
/*
if (opal_list_get_end(selectable) == item2) {
opal_list_append(selectable,
(opal_list_item_t *) avail);
}
}
*/
}
}
}
@ -286,6 +235,8 @@ static opal_list_t *check_components(opal_list_t *components,
return NULL;
}
opal_list_sort(selectable, avail_io_compare);
/* All done */
return selectable;
@ -306,12 +257,12 @@ static avail_io_t *check_one_component(const mca_base_component_t *component,
avail->ai_priority : 100;
avail->ai_priority = (avail->ai_priority < 0) ?
0 : avail->ai_priority;
opal_output_verbose(10, mca_io_base_output,
opal_output_verbose(10, ompi_io_base_framework.framework_output,
"io:base:delete: component available: %s, priority: %d",
component->mca_component_name,
avail->ai_priority);
} else {
opal_output_verbose(10, mca_io_base_output,
opal_output_verbose(10, ompi_io_base_framework.framework_output,
"io:base:delete: component not available: %s",
component->mca_component_name);
}

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

@ -92,9 +92,7 @@ static OBJ_CLASS_INSTANCE(avail_io_t, opal_list_item_t, NULL, NULL);
int mca_io_base_file_select(ompi_file_t *file,
mca_base_component_t *preferred)
{
const char **names_value, *names;
int err, num_names;
char **name_array;
int err;
char *str;
opal_list_t *selectable;
opal_list_item_t *item;
@ -102,7 +100,7 @@ int mca_io_base_file_select(ompi_file_t *file,
/* Announce */
opal_output_verbose(10, mca_io_base_output,
opal_output_verbose(10, ompi_io_base_framework.framework_output,
"io:base:file_select: new file: %s",
file->f_filename);
@ -112,13 +110,6 @@ int mca_io_base_file_select(ompi_file_t *file,
file->f_io_version = MCA_IO_BASE_V_NONE;
file->f_io_selected_data = NULL;
/* See if a set of component was requested by the MCA parameter.
Don't check for error. */
names_value = NULL;
mca_base_var_get_value(mca_io_base_param, &names_value, NULL, NULL);
names = names_value ? names_value[0] : NULL;
/* Compute the intersection of all of my available components with
the components from all the other processes in this file */
@ -132,10 +123,10 @@ int mca_io_base_file_select(ompi_file_t *file,
if (NULL != preferred) {
str = &(preferred->mca_component_name[0]);
opal_output_verbose(10, mca_io_base_output,
opal_output_verbose(10, ompi_io_base_framework.framework_output,
"io:base:file_select: Checking preferred module: %s",
str);
selectable = check_components(&mca_io_base_components_available,
selectable = check_components(&ompi_io_base_framework.framework_components,
file, &str, 1);
/* If we didn't get a preferred module, then call again
@ -150,28 +141,13 @@ int mca_io_base_file_select(ompi_file_t *file,
the preferred modules */
}
/* If there was no preferred module, then see if there were any
listed in the MCA parameter; parse them and check them all */
else if (NULL != names && 0 < strlen(names)) {
name_array = opal_argv_split(names, ',');
num_names = opal_argv_count(name_array);
opal_output_verbose(10, mca_io_base_output,
"io:base:file_select: Checking specific modules: %s",
names);
selectable = check_components(&mca_io_base_components_available,
file, name_array, num_names);
opal_argv_free(name_array);
}
/* Nope -- a specific [set of] component[s] was not requested. Go
check them all. */
else {
opal_output_verbose(10, mca_io_base_output,
opal_output_verbose(10, ompi_io_base_framework.framework_output,
"io:base:file_select: Checking all available modules");
selectable = check_components(&mca_io_base_components_available,
selectable = check_components(&ompi_io_base_framework.framework_components,
file, NULL, 0);
}
@ -223,16 +199,16 @@ int mca_io_base_file_select(ompi_file_t *file,
"ompio")) {
int ret;
if (OMPI_SUCCESS != (ret = mca_fs_base_open())) {
if (OMPI_SUCCESS != (ret = mca_base_framework_open(&ompi_fs_base_framework, 0))) {
return err;
}
if (OMPI_SUCCESS != (ret = mca_fcoll_base_open())) {
if (OMPI_SUCCESS != (ret = mca_base_framework_open(&ompi_fcoll_base_framework, 0))) {
return err;
}
if (OMPI_SUCCESS != (ret = mca_fbtl_base_open())) {
if (OMPI_SUCCESS != (ret = mca_base_framework_open(&ompi_fbtl_base_framework, 0))) {
return err;
}
if (OMPI_SUCCESS != (ret = mca_sharedfp_base_open())) {
if (OMPI_SUCCESS != (ret = mca_base_framework_open(&ompi_sharedfp_base_framework, 0))) {
return err;
}
@ -265,13 +241,28 @@ int mca_io_base_file_select(ompi_file_t *file,
/* Announce the winner */
opal_output_verbose(10, mca_io_base_output,
opal_output_verbose(10, ompi_io_base_framework.framework_output,
"io:base:file_select: Selected io module %s",
selected.ai_component.v2_0_0.io_version.mca_component_name);
return OMPI_SUCCESS;
}
static int avail_io_compare (opal_list_item_t **itema,
opal_list_item_t **itemb)
{
const avail_io_t *availa = (const avail_io_t *) *itema;
const avail_io_t *availb = (const avail_io_t *) *itemb;
/* highest component last */
if (availa->ai_priority > availb->ai_priority) {
return 1;
} else if (availa->ai_priority < availb->ai_priority) {
return -1;
} else {
return 0;
}
}
/*
* For each component in the list, if it is in the list of names (or
@ -286,10 +277,10 @@ static opal_list_t *check_components(opal_list_t *components,
{
int i;
const mca_base_component_t *component;
opal_list_item_t *item, *item2;
mca_base_component_list_item_t *cli;
bool want_to_check;
opal_list_t *selectable;
avail_io_t *avail, *avail2;
avail_io_t *avail;
/* Make a list of the components that query successfully */
@ -299,11 +290,8 @@ static opal_list_t *check_components(opal_list_t *components,
O(N^2), but we should never have too many components and/or
names, 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;
OPAL_LIST_FOREACH(cli, components, mca_base_component_list_item_t) {
component = cli->cli_component;
/* If we have a list of names, scan through it */
@ -324,53 +312,12 @@ static opal_list_t *check_components(opal_list_t *components,
if (want_to_check) {
avail = check_one_component(file, component);
if (NULL != avail) {
/* Put this item on the list in priority order
(highest priority first). Should it go first? */
/* MSC actually put it Lowest priority first */
for(item2 = opal_list_get_first(selectable);
item2 != opal_list_get_end(selectable);
item2 = opal_list_get_next(item2)) {
avail2 = (avail_io_t*)item2;
if(avail->ai_priority < avail2->ai_priority) {
opal_list_insert_pos(selectable,
item2, (opal_list_item_t*)avail);
break;
}
}
if(opal_list_get_end(selectable) == item2) {
/* NTH sorted later */
opal_list_append(selectable, (opal_list_item_t*)avail);
}
/*
item2 = opal_list_get_first(selectable);
avail2 = (avail_io_t *) item2;
if (opal_list_get_end(selectable) == item2 ||
avail->ai_priority > avail2->ai_priority) {
opal_list_prepend(selectable, (opal_list_item_t*) avail);
} else {
for (i = 1; item2 != opal_list_get_end(selectable);
item2 = opal_list_get_next(selectable), ++i) {
avail2 = (avail_io_t *) item2;
if (avail->ai_priority > avail2->ai_priority) {
opal_list_insert(selectable,
(opal_list_item_t *) avail, i);
break;
}
}
*/
/* If we didn't find a place to put it in the
list, then append it (because it has the lowest
priority found so far) */
/*
if (opal_list_get_end(selectable) == item2) {
opal_list_append(selectable,
(opal_list_item_t *) avail);
}
}*/
}
}
}
@ -381,12 +328,13 @@ static opal_list_t *check_components(opal_list_t *components,
return NULL;
}
opal_list_sort(selectable, avail_io_compare);
/* All done */
return selectable;
}
/*
* Check a single component
*/
@ -401,12 +349,12 @@ static avail_io_t *check_one_component(ompi_file_t *file,
avail->ai_priority : 100;
avail->ai_priority = (avail->ai_priority < 0) ?
0 : avail->ai_priority;
opal_output_verbose(10, mca_io_base_output,
opal_output_verbose(10, ompi_io_base_framework.framework_output,
"io:base:file_select: component available: %s, priority: %d",
component->mca_component_name,
avail->ai_priority);
} else {
opal_output_verbose(10, mca_io_base_output,
opal_output_verbose(10, ompi_io_base_framework.framework_output,
"io:base:file_select: component not available: %s",
component->mca_component_name);
}

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

@ -24,11 +24,9 @@
#include "mpi.h"
#include "ompi/constants.h"
#include "opal/class/opal_list.h"
#include "opal/util/output.h"
#include "opal/mca/mca.h"
#include "opal/mca/base/base.h"
#include "opal/mca/base/mca_base_component_repository.h"
#include "ompi/mca/io/io.h"
#include "ompi/mca/io/base/base.h"
#include "ompi/mca/io/base/io_base_request.h"
@ -39,11 +37,9 @@
* Private functions
*/
static int init_query(const mca_base_component_t *ls,
mca_base_component_priority_list_item_t *entry,
bool enable_progress_threads,
bool enable_mpi_threads);
static int init_query_2_0_0(const mca_base_component_t *ls,
mca_base_component_priority_list_item_t *entry,
bool enable_progress_threads,
bool enable_mpi_threads);
@ -63,62 +59,30 @@ static int init_query_2_0_0(const mca_base_component_t *ls,
int mca_io_base_find_available(bool enable_progress_threads,
bool enable_mpi_threads)
{
mca_base_component_priority_list_item_t *entry;
opal_list_item_t *p;
const mca_base_component_t *component;
/* Initialize the list */
OBJ_CONSTRUCT(&mca_io_base_components_available, opal_list_t);
mca_io_base_components_available_valid = true;
mca_base_component_list_item_t *cli, *next;
/* The list of components that we should check has already been
established in mca_io_base_open. */
for (p = opal_list_remove_first(&mca_io_base_components_opened);
p != NULL;
p = opal_list_remove_first(&mca_io_base_components_opened)) {
component = ((mca_base_component_list_item_t *) p)->cli_component;
OPAL_LIST_FOREACH_SAFE(cli, next, &ompi_io_base_framework.framework_components, mca_base_component_list_item_t) {
const mca_base_component_t *component = cli->cli_component;
/* Call a subroutine to do the work, because the component may
represent different versions of the io MCA. */
entry = OBJ_NEW(mca_base_component_priority_list_item_t);
entry->super.cli_component = component;
entry->cpli_priority = 0;
if (OMPI_SUCCESS == init_query(component, entry,
if (OMPI_SUCCESS != init_query(component,
enable_progress_threads,
enable_mpi_threads)) {
/* Save the results in the list. The priority isn't
relevant, because selection is decided at
communicator-constructor time. But we save the thread
arguments (set in the init_query() function) so that
the initial selection algorithm can negotiate the
overall thread level for this process. */
opal_list_append(&mca_io_base_components_available,
(opal_list_item_t *) entry);
} else {
/* If the component doesn't want to run, then close it.
It's already had its close() method invoked; now close
it out of the DSO repository (if it's there). */
mca_base_component_repository_release(component);
OBJ_RELEASE(entry);
opal_list_remove_item(&ompi_io_base_framework.framework_components, &cli->super);
mca_base_component_close(component, ompi_io_base_framework.framework_output);
OBJ_RELEASE(cli);
}
/* Free the entry from the "opened" list */
OBJ_RELEASE(p);
}
/* The opened list is now no longer useful and we can free it */
OBJ_DESTRUCT(&mca_io_base_components_opened);
mca_io_base_components_opened_valid = false;
/* All done */
return OMPI_SUCCESS;
@ -130,13 +94,12 @@ int mca_io_base_find_available(bool enable_progress_threads,
* some information. If it doesn't, close it.
*/
static int init_query(const mca_base_component_t *m,
mca_base_component_priority_list_item_t *entry,
bool enable_progress_threads,
bool enable_mpi_threads)
{
int ret;
opal_output_verbose(10, mca_io_base_output,
opal_output_verbose(10, ompi_io_base_framework.framework_output,
"io:find_available: querying io component %s",
m->mca_component_name);
@ -146,12 +109,12 @@ static int init_query(const mca_base_component_t *m,
if (2 == m->mca_type_major_version &&
0 == m->mca_type_minor_version &&
0 == m->mca_type_release_version) {
ret = init_query_2_0_0(m, entry, enable_progress_threads,
ret = init_query_2_0_0(m, enable_progress_threads,
enable_mpi_threads);
} else {
/* Unrecognized io API version */
opal_output_verbose(10, mca_io_base_output,
opal_output_verbose(10, ompi_io_base_framework.framework_output,
"io:find_available: unrecognized io API version (%d.%d.%d)",
m->mca_type_major_version,
m->mca_type_minor_version,
@ -163,14 +126,11 @@ static int init_query(const mca_base_component_t *m,
/* Query done -- look at the return value to see what happened */
if (OMPI_SUCCESS != ret) {
opal_output_verbose(10, mca_io_base_output,
opal_output_verbose(10, ompi_io_base_framework.framework_output,
"io:find_available: io component %s is not available",
m->mca_component_name);
if (NULL != m->mca_close_component) {
m->mca_close_component();
}
} else {
opal_output_verbose(10, mca_io_base_output,
opal_output_verbose(10, ompi_io_base_framework.framework_output,
"io:find_available: io component %s is available",
m->mca_component_name);
}
@ -185,7 +145,6 @@ static int init_query(const mca_base_component_t *m,
* Query a specific component, io v2.0.0
*/
static int init_query_2_0_0(const mca_base_component_t *component,
mca_base_component_priority_list_item_t *entry,
bool enable_progress_threads,
bool enable_mpi_threads)
{

45
ompi/mca/io/base/io_base_frame.c Обычный файл
Просмотреть файл

@ -0,0 +1,45 @@
/*
* 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 "ompi/mca/io/base/base.h"
/*
* The following file was created by configure. It contains extern
* statements and the definition of an array of pointers to each
* component's public mca_base_component_t struct.
*/
#include "ompi/mca/io/base/static-components.h"
static int mca_io_base_open(mca_base_open_flag_t flags)
{
int ret;
if (OPAL_SUCCESS !=
(ret = mca_base_framework_components_open(&ompi_io_base_framework, flags))) {
return ret;
}
return mca_io_base_find_available(OMPI_ENABLE_PROGRESS_THREADS, OMPI_ENABLE_THREAD_MULTIPLE);
}
MCA_BASE_FRAMEWORK_DECLARE(ompi, io, NULL, mca_io_base_open, NULL, NULL,
mca_io_base_static_components, 0);

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

@ -1,84 +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 "opal/mca/mca.h"
#include "opal/util/output.h"
#include "opal/mca/base/base.h"
#include "ompi/mca/io/io.h"
#include "ompi/mca/io/base/base.h"
#include "ompi/mca/io/base/io_base_request.h"
/*
* The following file was created by configure. It contains extern
* statements and the definition of an array of pointers to each
* component's public mca_base_component_t struct.
*/
#ifdef __WINDOWS__
const mca_base_component_t *mca_io_base_static_components[] = {NULL};
#else
#include "ompi/mca/io/base/static-components.h"
#endif
/*
* Global variables; most of which are loaded by back-ends of MCA
* variables
*/
int mca_io_base_param = -1;
int mca_io_base_output = -1;
bool mca_io_base_components_opened_valid = false;
opal_list_t mca_io_base_components_opened;
bool mca_io_base_components_available_valid = false;
opal_list_t mca_io_base_components_available;
/*
* Function for finding and opening either all MCA components, or the one
* that was specifically requested via a MCA parameter.
*/
int mca_io_base_open(void)
{
/* Open an output stream for this framework */
mca_io_base_output = opal_output_open(NULL);
/* Open up all available components */
if (OMPI_SUCCESS !=
mca_base_components_open("io", mca_io_base_output,
mca_io_base_static_components,
&mca_io_base_components_opened, true)) {
return OMPI_ERROR;
}
mca_io_base_components_opened_valid = true;
/* Find the index of the MCA "io" param for selection */
mca_io_base_param = mca_base_var_find("ompi", "io", NULL, NULL);
/* All done */
return OMPI_SUCCESS;
}

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

@ -33,7 +33,7 @@ mca_io_base_register_datarep(char *datarep,
MPI_Datarep_extent_function* extent_fn,
void* state)
{
opal_list_item_t *p;
mca_base_component_list_item_t *cli;
const mca_base_component_t *component;
const mca_io_base_component_2_0_0_t *v200;
int tmp, ret = OMPI_SUCCESS;
@ -41,11 +41,8 @@ mca_io_base_register_datarep(char *datarep,
/* Find the maximum additional number of bytes required by all io
components for requests and make that the request size */
for (p = opal_list_get_first(&mca_io_base_components_available);
p != opal_list_get_end(&mca_io_base_components_available);
p = opal_list_get_next(p)) {
component = ((mca_base_component_priority_list_item_t *)
p)->super.cli_component;
OPAL_LIST_FOREACH(cli, &ompi_io_base_framework.framework_components, mca_base_component_list_item_t) {
component = cli->cli_component;
/* Only know how to handle v2.0.0 components for now */
if (component->mca_type_major_version == 2 &&

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

@ -22,8 +22,7 @@ headers += \
base/mpool_base_mem_cb.h \
base/mpool_base_tree.h
libmca_mpool_la_SOURCES += \
base/mpool_base_open.c \
base/mpool_base_close.c \
base/mpool_base_frame.c \
base/mpool_base_init.c \
base/mpool_base_lookup.c \
base/mpool_base_alloc.c \

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

@ -24,8 +24,7 @@
#include "ompi_config.h"
#include "opal/class/opal_list.h"
#include "opal/mca/mca.h"
#include "opal/mca/base/base.h"
#include "ompi/mca/mpool/mpool.h"
BEGIN_C_DECLS
@ -65,9 +64,7 @@ OMPI_DECLSPEC OBJ_CLASS_DECLARATION(mca_mpool_base_selected_module_t);
* Global functions for MCA: overall mpool open and close
*/
OMPI_DECLSPEC int mca_mpool_base_open(void);
OMPI_DECLSPEC int mca_mpool_base_init(bool enable_progress_threads, bool enable_mpi_threads);
OMPI_DECLSPEC int mca_mpool_base_close(void);
OMPI_DECLSPEC mca_mpool_base_component_t* mca_mpool_base_component_lookup(const char* name);
OMPI_DECLSPEC mca_mpool_base_module_t* mca_mpool_base_module_create(
const char* name,
@ -79,8 +76,6 @@ OMPI_DECLSPEC int mca_mpool_base_module_destroy(mca_mpool_base_module_t *module)
/*
* Globals
*/
OMPI_DECLSPEC extern int mca_mpool_base_output;
OMPI_DECLSPEC extern opal_list_t mca_mpool_base_components;
extern opal_list_t mca_mpool_base_modules;
OMPI_DECLSPEC extern uint32_t mca_mpool_base_page_size;
OMPI_DECLSPEC extern uint32_t mca_mpool_base_page_size_log;
@ -88,6 +83,8 @@ OMPI_DECLSPEC extern uint32_t mca_mpool_base_page_size_log;
/* only used within base -- no need to DECLSPEC */
extern int mca_mpool_base_used_mem_hooks;
OMPI_DECLSPEC extern mca_base_framework_t ompi_mpool_base_framework;
END_C_DECLS
#endif /* MCA_MEM_BASE_H */

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

@ -1,79 +0,0 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* 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-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/mca.h"
#include "opal/mca/base/base.h"
#include "ompi/mca/mpool/base/base.h"
#include "mpool_base_mem_cb.h"
int mca_mpool_base_close(void)
{
opal_list_item_t *item;
mca_mpool_base_selected_module_t *sm;
int32_t modules_length;
/* Need the initial length in order to know if some of the initializations
* are done in the open function.
*/
modules_length = opal_list_get_size(&mca_mpool_base_modules);
/* Finalize all the mpool components and free their list items */
for (item = opal_list_remove_first(&mca_mpool_base_modules);
NULL != item;
item = opal_list_remove_first(&mca_mpool_base_modules)) {
sm = (mca_mpool_base_selected_module_t *) item;
/* Blatently ignore the return code (what would we do to recover,
anyway? This component is going away, so errors don't matter
anymore). Note that it's legal for the module to have NULL for
the finalize function. */
if (NULL != sm->mpool_module->mpool_finalize) {
sm->mpool_module->mpool_finalize(sm->mpool_module);
}
OBJ_RELEASE(sm);
}
/* Close all remaining available components (may be one if this is a
OMPI RTE program, or [possibly] multiple if this is ompi_info) */
mca_base_components_close(mca_mpool_base_output,
&mca_mpool_base_components, NULL);
/* Close the framework output */
opal_output_close (mca_mpool_base_output);
mca_mpool_base_output = -1;
/* deregister memory free callback */
if( (modules_length > 0) && mca_mpool_base_used_mem_hooks &&
0 != (OPAL_MEMORY_FREE_SUPPORT & opal_mem_hooks_support_level())) {
opal_mem_hooks_unregister_release(mca_mpool_base_mem_cb);
}
/* All done */
return OMPI_SUCCESS;
}

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

@ -33,6 +33,7 @@
#include "opal/mca/base/base.h"
#include "opal/memoryhooks/memory.h"
#include "ompi/mca/mpool/base/base.h"
#include "mpool_base_mem_cb.h"
#include "ompi/constants.h"
/*
@ -46,7 +47,6 @@
/*
* Global variables
*/
int mca_mpool_base_output = -1;
/* whether we actually used the mem hooks or not */
int mca_mpool_base_used_mem_hooks = 0;
@ -54,43 +54,18 @@ int mca_mpool_base_used_mem_hooks = 0;
uint32_t mca_mpool_base_page_size;
uint32_t mca_mpool_base_page_size_log;
opal_list_t mca_mpool_base_components;
opal_list_t mca_mpool_base_modules;
static int ompi_mpool_base_verbose = 0;
static int mca_mpool_base_register(int flags)
{
/* Verbose output */
ompi_mpool_base_verbose = 0;
mca_base_var_register("ompi", "mpool", "base", "verbose",
"Verbosity level for the mpool framework (0 = no verbosity)",
MCA_BASE_VAR_TYPE_INT, NULL, 0,
MCA_BASE_VAR_FLAG_SETTABLE,
OPAL_INFO_LVL_9,
MCA_BASE_VAR_SCOPE_LOCAL,
&ompi_mpool_base_verbose);
return OMPI_SUCCESS;
}
/**
* Function for finding and opening either all MCA components, or the one
* that was specifically requested via a MCA parameter.
*/
int mca_mpool_base_open(void)
static int mca_mpool_base_open(mca_base_open_flag_t flags)
{
/* Open up all available components - and populate the
mca_mpool_base_components list */
(void) mca_mpool_base_register(0);
mca_mpool_base_output = opal_output_open(NULL);
opal_output_set_verbosity(mca_mpool_base_output, ompi_mpool_base_verbose);
ompi_mpool_base_framework.framework_components list */
if (OMPI_SUCCESS !=
mca_base_components_open("mpool", mca_mpool_base_output, mca_mpool_base_static_components,
&mca_mpool_base_components, true)) {
mca_base_framework_components_open(&ompi_mpool_base_framework, flags)) {
return OMPI_ERROR;
}
@ -109,3 +84,46 @@ int mca_mpool_base_open(void)
return OMPI_SUCCESS;
}
static int mca_mpool_base_close(void)
{
opal_list_item_t *item;
mca_mpool_base_selected_module_t *sm;
int32_t modules_length;
/* Need the initial length in order to know if some of the initializations
* are done in the open function.
*/
modules_length = opal_list_get_size(&mca_mpool_base_modules);
/* Finalize all the mpool components and free their list items */
while(NULL != (item = opal_list_remove_first(&mca_mpool_base_modules))) {
sm = (mca_mpool_base_selected_module_t *) item;
/* Blatently ignore the return code (what would we do to recover,
anyway? This component is going away, so errors don't matter
anymore). Note that it's legal for the module to have NULL for
the finalize function. */
if (NULL != sm->mpool_module->mpool_finalize) {
sm->mpool_module->mpool_finalize(sm->mpool_module);
}
OBJ_RELEASE(sm);
}
/* Close all remaining available 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_mpool_base_framework, NULL);
/* deregister memory free callback */
if( (modules_length > 0) && mca_mpool_base_used_mem_hooks &&
0 != (OPAL_MEMORY_FREE_SUPPORT & opal_mem_hooks_support_level())) {
opal_mem_hooks_unregister_release(mca_mpool_base_mem_cb);
}
/* All done */
return OMPI_SUCCESS;
}
MCA_BASE_FRAMEWORK_DECLARE(ompi, mpool, NULL, NULL, mca_mpool_base_open,
mca_mpool_base_close, mca_mpool_base_static_components, 0);

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

@ -38,6 +38,7 @@
#include "ompi/mca/mpool/mpool.h"
#include "ompi/mca/mpool/base/base.h"
#include "opal/memoryhooks/memory.h"
#include "mpool_base_mem_cb.h"
@ -45,8 +46,8 @@ mca_mpool_base_component_t* mca_mpool_base_component_lookup(const char* name)
{
/* Traverse the list of available modules; call their init functions. */
opal_list_item_t* item;
for (item = opal_list_get_first(&mca_mpool_base_components);
item != opal_list_get_end(&mca_mpool_base_components);
for (item = opal_list_get_first(&ompi_mpool_base_framework.framework_components);
item != opal_list_get_end(&ompi_mpool_base_framework.framework_components);
item = opal_list_get_next(item)) {
mca_base_component_list_item_t *cli =
(mca_base_component_list_item_t *) item;
@ -70,8 +71,8 @@ mca_mpool_base_module_t* mca_mpool_base_module_create(
opal_list_item_t* item;
mca_mpool_base_selected_module_t *sm;
for (item = opal_list_get_first(&mca_mpool_base_components);
item != opal_list_get_end(&mca_mpool_base_components);
for (item = opal_list_get_first(&ompi_mpool_base_framework.framework_components);
item != opal_list_get_end(&ompi_mpool_base_framework.framework_components);
item = opal_list_get_next(item)) {
mca_base_component_list_item_t *cli =
(mca_base_component_list_item_t *) item;
@ -82,7 +83,7 @@ mca_mpool_base_module_t* mca_mpool_base_module_create(
}
}
if (opal_list_get_end(&mca_mpool_base_components) == item) {
if (opal_list_get_end(&ompi_mpool_base_framework.framework_components) == item) {
return NULL;
}
module = component->mpool_init(resources);

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

@ -35,6 +35,8 @@
#include "ompi/mca/mpool/base/mpool_base_mem_cb.h"
#include "ompi/mca/mpool/base/base.h"
#include "opal/mca/mca.h"
#include "opal/memoryhooks/memory.h"
static char msg[512];

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

@ -23,9 +23,6 @@
#include "ompi_config.h"
#include "opal/mca/mca.h"
#include "opal/memoryhooks/memory.h"
BEGIN_C_DECLS
/*

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

@ -175,10 +175,10 @@ mca_mpool_sm_init(struct mca_mpool_base_resources_t *resources)
/* if specified allocator cannot be loaded - look for an alternative */
if (NULL == allocator_component) {
if (opal_list_get_size(&mca_allocator_base_components) == 0) {
if (opal_list_get_size(&ompi_allocator_base_framework.framework_components) == 0) {
mca_base_component_list_item_t *item =
(mca_base_component_list_item_t *)
opal_list_get_first(&mca_allocator_base_components);
opal_list_get_first(&ompi_allocator_base_framework.framework_components);
allocator_component =
(mca_allocator_base_component_t *)item->cli_component;
opal_output(

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

@ -21,4 +21,4 @@ headers += \
base/mtl_base_datatype.h
libmca_mtl_la_SOURCES += \
base/mtl_base_component.c
base/mtl_base_frame.c

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

@ -33,14 +33,10 @@ BEGIN_C_DECLS
OMPI_DECLSPEC extern mca_mtl_base_component_t* ompi_mtl_base_selected_component;
OMPI_DECLSPEC int ompi_mtl_base_open(void);
OMPI_DECLSPEC int ompi_mtl_base_select(bool enable_progress_threads,
bool enable_mpi_threads);
OMPI_DECLSPEC int ompi_mtl_base_close(void);
OMPI_DECLSPEC extern opal_list_t ompi_mtl_base_components_opened;
OMPI_DECLSPEC extern int ompi_mtl_base_output;
OMPI_DECLSPEC extern mca_base_framework_t ompi_mtl_base_framework;
END_C_DECLS
#endif /* MCA_MTL_BASE_H */

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

@ -35,40 +35,8 @@
#include "ompi/mca/mtl/base/static-components.h"
int ompi_mtl_base_output = 0;
opal_list_t ompi_mtl_base_components_opened;
mca_mtl_base_component_t *ompi_mtl_base_selected_component = NULL;
mca_mtl_base_module_t *ompi_mtl;
/*
* Function for finding and opening either all MCA components, or the one
* that was specifically requested via a MCA parameter.
*/
int
ompi_mtl_base_open(void)
{
/* setup the output stream */
ompi_mtl_base_output = opal_output_open(NULL);
/* Open up all available components */
if (OMPI_SUCCESS !=
mca_base_components_open("mtl", ompi_mtl_base_output,
mca_mtl_base_static_components,
&ompi_mtl_base_components_opened,
!MCA_ompi_mtl_DIRECT_CALL)) {
return OMPI_ERROR;
}
/* Set a sentinel in case we don't select any components (e.g.,
ompi_info) */
ompi_mtl = NULL;
return OMPI_SUCCESS;
}
mca_mtl_base_module_t *ompi_mtl = NULL;
/*
* Function for selecting one component from all those that are
@ -88,31 +56,31 @@ ompi_mtl_base_select(bool enable_progress_threads,
/* Traverse the list of available components; call their init
functions. */
for (item = opal_list_get_first(&ompi_mtl_base_components_opened);
opal_list_get_end(&ompi_mtl_base_components_opened) != item;
for (item = opal_list_get_first(&ompi_mtl_base_framework.framework_components);
opal_list_get_end(&ompi_mtl_base_framework.framework_components) != item;
item = opal_list_get_next(item) ) {
cli = (mca_base_component_list_item_t *) item;
component = (mca_mtl_base_component_t *) cli->cli_component;
if (NULL == component->mtl_init) {
opal_output_verbose( 10, ompi_mtl_base_output,
opal_output_verbose( 10, ompi_mtl_base_framework.framework_output,
"select: no init function; ignoring component %s",
component->mtl_version.mca_component_name );
continue;
}
opal_output_verbose( 10, ompi_mtl_base_output,
opal_output_verbose( 10, ompi_mtl_base_framework.framework_output,
"select: initializing %s component %s",
component->mtl_version.mca_type_name,
component->mtl_version.mca_component_name );
module = component->mtl_init(enable_progress_threads,
enable_mpi_threads);
if (NULL == module) {
opal_output_verbose( 10, ompi_mtl_base_output,
opal_output_verbose( 10, ompi_mtl_base_framework.framework_output,
"select: init returned failure for component %s",
component->mtl_version.mca_component_name );
continue;
}
opal_output_verbose( 10, ompi_mtl_base_output,
opal_output_verbose( 10, ompi_mtl_base_framework.framework_output,
"select: init returned success");
ompi_mtl_base_selected_component = component;
@ -122,17 +90,18 @@ ompi_mtl_base_select(bool enable_progress_threads,
/* This base function closes, unloads, and removes from the
available list all unselected components. The available list will
contain only the selected component. */
mca_base_components_close(ompi_mtl_base_output,
&ompi_mtl_base_components_opened,
if (ompi_mtl_base_selected_component) {
(void) mca_base_framework_components_close(&ompi_mtl_base_framework,
(mca_base_component_t *) ompi_mtl_base_selected_component);
}
/* All done */
if (NULL == module) {
opal_output_verbose( 10, ompi_mtl_base_output,
opal_output_verbose( 10, ompi_mtl_base_framework.framework_output,
"select: no component selected");
return OMPI_ERR_NOT_FOUND;
} else {
opal_output_verbose( 10, ompi_mtl_base_output,
opal_output_verbose( 10, ompi_mtl_base_framework.framework_output,
"select: component %s selected",
ompi_mtl_base_selected_component->
mtl_version.mca_component_name );
@ -141,18 +110,16 @@ ompi_mtl_base_select(bool enable_progress_threads,
}
int
static int
ompi_mtl_base_close(void)
{
/* NTH: Should we be freeing the mtl module here? */
ompi_mtl = NULL;
/* Close all remaining available modules (may be one if this is a
OMPI RTE program, or [possibly] multiple if this is ompi_info) */
mca_base_components_close(ompi_mtl_base_output,
&ompi_mtl_base_components_opened, NULL);
/* Close the framework output */
opal_output_close (ompi_mtl_base_output);
ompi_mtl_base_output = -1;
/* All done */
return OMPI_SUCCESS;
return mca_base_framework_components_close(&ompi_mtl_base_framework, NULL);
}
MCA_BASE_FRAMEWORK_DECLARE(ompi, mtl, NULL, NULL, NULL, ompi_mtl_base_close,
mca_mtl_base_static_components, 0);

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

@ -103,7 +103,7 @@ int ompi_mtl_mx_module_init(){
&ompi_mtl_mx.mx_endpoint);
if(mx_return != MX_SUCCESS) {
opal_output(ompi_mtl_base_output, "Error in mx_open_endpoint (error %s)\n", mx_strerror(mx_return));
opal_output(ompi_mtl_base_framework.framework_output, "Error in mx_open_endpoint (error %s)\n", mx_strerror(mx_return));
return OMPI_ERROR;
}
@ -112,7 +112,7 @@ int ompi_mtl_mx_module_init(){
&ompi_mtl_mx.mx_endpoint_addr);
if(mx_return != MX_SUCCESS) {
opal_output(ompi_mtl_base_output, "Error in mx_get_endpoint_addr (error %s)\n", mx_strerror(mx_return));
opal_output(ompi_mtl_base_framework.framework_output, "Error in mx_get_endpoint_addr (error %s)\n", mx_strerror(mx_return));
return OMPI_ERROR;
}
@ -120,10 +120,10 @@ int ompi_mtl_mx_module_init(){
&(ompi_mtl_mx.mx_addr.endpoint_id) );
if(mx_return != MX_SUCCESS) {
opal_output(ompi_mtl_base_output, "Error in mx_decompose_endpoint_addr (error %s)\n", mx_strerror(mx_return));
opal_output(ompi_mtl_base_framework.framework_output, "Error in mx_decompose_endpoint_addr (error %s)\n", mx_strerror(mx_return));
return OMPI_ERROR;
}
opal_output_verbose(10, ompi_mtl_base_output,
opal_output_verbose(10, ompi_mtl_base_framework.framework_output,
"mtl:mx: local nic %d, endpoint %d, got nic %d, ep %d\n", nic, ep,
(int)ompi_mtl_mx.mx_addr.nic_id,
ompi_mtl_mx.mx_addr.endpoint_id);
@ -147,7 +147,7 @@ ompi_mtl_mx_finalize(struct mca_mtl_base_module_t* mtl) {
/* free resources */
mx_return = mx_close_endpoint(ompi_mtl_mx.mx_endpoint);
if(mx_return != MX_SUCCESS){
opal_output(ompi_mtl_base_output, "Error in mx_close_endpoint (error %s)\n", mx_strerror(mx_return));
opal_output(ompi_mtl_base_framework.framework_output, "Error in mx_close_endpoint (error %s)\n", mx_strerror(mx_return));
return OMPI_ERROR;
}
@ -227,7 +227,7 @@ int ompi_mtl_mx_progress( void ) {
&result);
if( OPAL_UNLIKELY(mx_return != MX_SUCCESS) ) {
opal_output(ompi_mtl_base_output, "Error in mx_ipeek (error %s)\n", mx_strerror(mx_return));
opal_output(ompi_mtl_base_framework.framework_output, "Error in mx_ipeek (error %s)\n", mx_strerror(mx_return));
}
if(result) {
completed++;
@ -236,11 +236,11 @@ int ompi_mtl_mx_progress( void ) {
&mx_status,
&result);
if( OPAL_UNLIKELY(mx_return != MX_SUCCESS) ) {
opal_output(ompi_mtl_base_output, "Error in mx_test (error %s)\n", mx_strerror(mx_return));
opal_output(ompi_mtl_base_framework.framework_output, "Error in mx_test (error %s)\n", mx_strerror(mx_return));
abort();
}
if( OPAL_UNLIKELY(0 == result) ) {
opal_output(ompi_mtl_base_output, "Error in ompi_mtl_mx_progress, mx_ipeek returned a request, mx_test on the request resulted failure.\n");
opal_output(ompi_mtl_base_framework.framework_output, "Error in ompi_mtl_mx_progress, mx_ipeek returned a request, mx_test on the request resulted failure.\n");
abort();
}
mtl_mx_request = (mca_mtl_mx_request_t*) mx_status.context;

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше