1
1

Initial checkin of btl/base changes for bmi to btl renaming.

This commit was SVN r6221.
Этот коммит содержится в:
Galen Shipman 2005-06-30 02:08:24 +00:00
родитель 2e9bbda826
Коммит b4281d28e5
5 изменённых файлов: 97 добавлений и 97 удалений

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

@ -16,7 +16,7 @@
include $(top_srcdir)/config/Makefile.options include $(top_srcdir)/config/Makefile.options
noinst_LTLIBRARIES = libmca_bmi_base.la noinst_LTLIBRARIES = libmca_btl_base.la
# For VPATH builds, have to specify where static-modules.h will be found # For VPATH builds, have to specify where static-modules.h will be found
@ -27,16 +27,16 @@ AM_CPPFLAGS = -I$(top_builddir)/src
headers = \ headers = \
base.h base.h
libmca_bmi_base_la_SOURCES = \ libmca_btl_base_la_SOURCES = \
$(headers) \ $(headers) \
bmi_base_close.c \ btl_base_close.c \
bmi_base_open.c \ btl_base_open.c \
bmi_base_select.c btl_base_select.c
# Conditionally install the header files # Conditionally install the header files
if WANT_INSTALL_HEADERS if WANT_INSTALL_HEADERS
ompidir = $(includedir)/openmpi/mca/bmi/base ompidir = $(includedir)/openmpi/mca/btl/base
ompi_HEADERS = $(headers) ompi_HEADERS = $(headers)
else else
ompidir = $(includedir) ompidir = $(includedir)

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

@ -22,49 +22,49 @@
#include "ompi_config.h" #include "ompi_config.h"
#include "class/ompi_list.h" #include "class/ompi_list.h"
#include "mca/mca.h" #include "mca/mca.h"
#include "mca/bmi/bmi.h" #include "mca/btl/btl.h"
#if defined(c_plusplus) || defined(__cplusplus) #if defined(c_plusplus) || defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
struct mca_bmi_base_selected_module_t { struct mca_btl_base_selected_module_t {
ompi_list_item_t super; ompi_list_item_t super;
mca_bmi_base_component_t *bmi_component; mca_btl_base_component_t *btl_component;
mca_bmi_base_module_t *bmi_module; mca_btl_base_module_t *btl_module;
}; };
typedef struct mca_bmi_base_selected_module_t mca_bmi_base_selected_module_t; typedef struct mca_btl_base_selected_module_t mca_btl_base_selected_module_t;
/* holds the recv call back function to be called by the bmi on /* holds the recv call back function to be called by the btl on
* a receive. * a receive.
*/ */
struct mca_bmi_base_recv_reg_t { struct mca_btl_base_recv_reg_t {
mca_bmi_base_module_recv_cb_fn_t cbfunc; mca_btl_base_module_recv_cb_fn_t cbfunc;
void* cbdata; void* cbdata;
}; };
typedef struct mca_bmi_base_recv_reg_t mca_bmi_base_recv_reg_t; typedef struct mca_btl_base_recv_reg_t mca_btl_base_recv_reg_t;
OBJ_CLASS_DECLARATION(mca_bmi_base_selected_module_t); OBJ_CLASS_DECLARATION(mca_btl_base_selected_module_t);
/* /*
* Global functions for MCA: overall BMI open and close * Global functions for MCA: overall BMI open and close
*/ */
OMPI_DECLSPEC int mca_bmi_base_open(void); OMPI_DECLSPEC int mca_btl_base_open(void);
OMPI_DECLSPEC int mca_bmi_base_select(bool enable_progress_threads, bool enable_mpi_threads); OMPI_DECLSPEC int mca_btl_base_select(bool enable_progress_threads, bool enable_mpi_threads);
OMPI_DECLSPEC int mca_bmi_base_close(void); OMPI_DECLSPEC int mca_btl_base_close(void);
/* /*
* Globals * Globals
*/ */
OMPI_DECLSPEC extern int mca_bmi_base_output; OMPI_DECLSPEC extern int mca_btl_base_output;
OMPI_DECLSPEC extern char* mca_bmi_base_include; OMPI_DECLSPEC extern char* mca_btl_base_include;
OMPI_DECLSPEC extern char* mca_bmi_base_exclude; OMPI_DECLSPEC extern char* mca_btl_base_exclude;
OMPI_DECLSPEC extern ompi_list_t mca_bmi_base_components_opened; OMPI_DECLSPEC extern ompi_list_t mca_btl_base_components_opened;
OMPI_DECLSPEC extern ompi_list_t mca_bmi_base_modules_initialized; OMPI_DECLSPEC extern ompi_list_t mca_btl_base_modules_initialized;
#if defined(c_plusplus) || defined(__cplusplus) #if defined(c_plusplus) || defined(__cplusplus)
} }

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

@ -23,46 +23,46 @@
#include "mca/mca.h" #include "mca/mca.h"
#include "mca/base/base.h" #include "mca/base/base.h"
#include "mca/pml/pml.h" #include "mca/pml/pml.h"
#include "mca/bmi/bmi.h" #include "mca/btl/btl.h"
#include "mca/bmi/base/base.h" #include "mca/btl/base/base.h"
int mca_bmi_base_close(void) int mca_btl_base_close(void)
{ {
ompi_list_item_t *item; ompi_list_item_t *item;
mca_bmi_base_selected_module_t *sm; mca_btl_base_selected_module_t *sm;
/* disable event processing while cleaning up bmis */ /* disable event processing while cleaning up btls */
ompi_event_disable(); ompi_event_disable();
/* Finalize all the bmi components and free their list items */ /* Finalize all the btl components and free their list items */
for (item = ompi_list_remove_first(&mca_bmi_base_modules_initialized); for (item = ompi_list_remove_first(&mca_btl_base_modules_initialized);
NULL != item; NULL != item;
item = ompi_list_remove_first(&mca_bmi_base_modules_initialized)) { item = ompi_list_remove_first(&mca_btl_base_modules_initialized)) {
sm = (mca_bmi_base_selected_module_t *) item; sm = (mca_btl_base_selected_module_t *) item;
/* Blatebmiy ignore the return code (what would we do to recover, /* Blatebtly ignore the return code (what would we do to recover,
anyway? This component is going away, so errors don't matter anyway? This component is going away, so errors don't matter
anymore) */ anymore) */
sm->bmi_module->bmi_finalize(sm->bmi_module); sm->btl_module->btl_finalize(sm->btl_module);
free(sm); free(sm);
} }
/* Close all remaining opened components (may be one if this is a /* Close all remaining opened components (may be one if this is a
OMPI RTE program, or [possibly] multiple if this is ompi_info) */ OMPI RTE program, or [possibly] multiple if this is ompi_info) */
if (0 != ompi_list_get_size(&mca_bmi_base_components_opened)) { if (0 != ompi_list_get_size(&mca_btl_base_components_opened)) {
mca_base_components_close(mca_bmi_base_output, mca_base_components_close(mca_btl_base_output,
&mca_bmi_base_components_opened, NULL); &mca_btl_base_components_opened, NULL);
} }
/* cleanup */ /* cleanup */
if(NULL != mca_bmi_base_include) if(NULL != mca_btl_base_include)
free(mca_bmi_base_include); free(mca_btl_base_include);
if(NULL != mca_bmi_base_exclude) if(NULL != mca_btl_base_exclude)
free(mca_bmi_base_exclude); free(mca_btl_base_exclude);
/* restore event processing */ /* restore event processing */
ompi_event_enable(); ompi_event_enable();

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

@ -22,14 +22,14 @@
#include "mca/base/base.h" #include "mca/base/base.h"
#include "mca/base/mca_base_param.h" #include "mca/base/mca_base_param.h"
#include "mca/pml/pml.h" #include "mca/pml/pml.h"
#include "mca/bmi/bmi.h" #include "mca/btl/btl.h"
#include "mca/bmi/base/base.h" #include "mca/btl/base/base.h"
/* /*
* mca_bmi_base_descriptor_t * mca_btl_base_descriptor_t
*/ */
static void mca_bmi_base_descriptor_constructor(mca_bmi_base_descriptor_t* des) static void mca_btl_base_descriptor_constructor(mca_btl_base_descriptor_t* des)
{ {
des->des_src = NULL; des->des_src = NULL;
des->des_src_cnt = 0; des->des_src_cnt = 0;
@ -40,15 +40,15 @@ static void mca_bmi_base_descriptor_constructor(mca_bmi_base_descriptor_t* des)
des->des_flags = 0; des->des_flags = 0;
} }
static void mca_bmi_base_descriptor_destructor(mca_bmi_base_descriptor_t* des) static void mca_btl_base_descriptor_destructor(mca_btl_base_descriptor_t* des)
{ {
} }
OBJ_CLASS_INSTANCE( OBJ_CLASS_INSTANCE(
mca_bmi_base_descriptor_t, mca_btl_base_descriptor_t,
ompi_list_item_t, ompi_list_item_t,
mca_bmi_base_descriptor_constructor, mca_btl_base_descriptor_constructor,
mca_bmi_base_descriptor_destructor); mca_btl_base_descriptor_destructor);
/* /*
@ -57,44 +57,44 @@ OBJ_CLASS_INSTANCE(
* component's public mca_base_component_t struct. * component's public mca_base_component_t struct.
*/ */
#include "mca/bmi/base/static-components.h" #include "mca/btl/base/static-components.h"
/* /*
* Global variables * Global variables
*/ */
int mca_bmi_base_output = -1; int mca_btl_base_output = -1;
char* mca_bmi_base_include = NULL; char* mca_btl_base_include = NULL;
char* mca_bmi_base_exclude = NULL; char* mca_btl_base_exclude = NULL;
ompi_list_t mca_bmi_base_components_opened; ompi_list_t mca_btl_base_components_opened;
ompi_list_t mca_bmi_base_modules_initialized; ompi_list_t mca_btl_base_modules_initialized;
/** /**
* Function for finding and opening either all MCA components, or the one * Function for finding and opening either all MCA components, or the one
* that was specifically requested via a MCA parameter. * that was specifically requested via a MCA parameter.
*/ */
int mca_bmi_base_open(void) int mca_btl_base_open(void)
{ {
/* Open up all available components */ /* Open up all available components */
if (OMPI_SUCCESS != if (OMPI_SUCCESS !=
mca_base_components_open("bmi", 0, mca_bmi_base_static_components, mca_base_components_open("btl", 0, mca_btl_base_static_components,
&mca_bmi_base_components_opened, true)) { &mca_btl_base_components_opened, true)) {
return OMPI_ERROR; return OMPI_ERROR;
} }
/* Initialize the list so that in mca_bmi_base_close(), we can /* Initialize the list so that in mca_btl_base_close(), we can
iterate over it (even if it's empty, as in the case of iterate over it (even if it's empty, as in the case of
ompi_info) */ ompi_info) */
OBJ_CONSTRUCT(&mca_bmi_base_modules_initialized, ompi_list_t); OBJ_CONSTRUCT(&mca_btl_base_modules_initialized, ompi_list_t);
/* register parameters */ /* register parameters */
mca_base_param_lookup_string( mca_base_param_lookup_string(
mca_base_param_register_string("bmi","base","include",NULL,NULL), &mca_bmi_base_include); mca_base_param_register_string("btl","base","include",NULL,NULL), &mca_btl_base_include);
mca_base_param_lookup_string( mca_base_param_lookup_string(
mca_base_param_register_string("bmi","base","exclude",NULL,NULL), &mca_bmi_base_exclude); mca_base_param_register_string("btl","base","exclude",NULL,NULL), &mca_btl_base_exclude);
/* All done */ /* All done */
return OMPI_SUCCESS; return OMPI_SUCCESS;

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

@ -21,52 +21,52 @@
#include "mca/mca.h" #include "mca/mca.h"
#include "mca/base/base.h" #include "mca/base/base.h"
#include "mca/pml/pml.h" #include "mca/pml/pml.h"
#include "mca/bmi/bmi.h" #include "mca/btl/btl.h"
#include "mca/bmi/base/base.h" #include "mca/btl/base/base.h"
OBJ_CLASS_INSTANCE( OBJ_CLASS_INSTANCE(
mca_bmi_base_selected_module_t, mca_btl_base_selected_module_t,
ompi_list_item_t, ompi_list_item_t,
NULL, NULL,
NULL); NULL);
/** /**
* Function for weeding out bmi components that don't want to run. * Function for weeding out btl components that don't want to run.
* *
* Call the init function on all available components to find out if * Call the init function on all available components to find out if
* they want to run. Select all components that don't fail. Failing * they want to run. Select all components that don't fail. Failing
* components will be closed and unloaded. The selected modules will * components will be closed and unloaded. The selected modules will
* be returned to the caller in a ompi_list_t. * be returned to the caller in a ompi_list_t.
*/ */
int mca_bmi_base_select(bool enable_progress_threads, int mca_btl_base_select(bool enable_progress_threads,
bool enable_mpi_threads) bool enable_mpi_threads)
{ {
int i, num_bmis; int i, num_btls;
ompi_list_item_t *item; ompi_list_item_t *item;
mca_base_component_list_item_t *cli; mca_base_component_list_item_t *cli;
mca_bmi_base_component_t *component; mca_btl_base_component_t *component;
mca_bmi_base_module_t **modules; mca_btl_base_module_t **modules;
mca_bmi_base_selected_module_t *sm; mca_btl_base_selected_module_t *sm;
char** include = ompi_argv_split(mca_bmi_base_include, ','); char** include = ompi_argv_split(mca_btl_base_include, ',');
char** exclude = ompi_argv_split(mca_bmi_base_exclude, ','); char** exclude = ompi_argv_split(mca_btl_base_exclude, ',');
/* Traverse the list of opened modules; call their init /* Traverse the list of opened modules; call their init
functions. */ functions. */
item = ompi_list_get_first(&mca_bmi_base_components_opened); item = ompi_list_get_first(&mca_btl_base_components_opened);
while(item != ompi_list_get_end(&mca_bmi_base_components_opened)) { while(item != ompi_list_get_end(&mca_btl_base_components_opened)) {
ompi_list_item_t *next = ompi_list_get_next(item); ompi_list_item_t *next = ompi_list_get_next(item);
cli = (mca_base_component_list_item_t *) item; cli = (mca_base_component_list_item_t *) item;
component = (mca_bmi_base_component_t *) cli->cli_component; component = (mca_btl_base_component_t *) cli->cli_component;
/* if there is an include list - item must be in the list to be included */ /* if there is an include list - item must be in the list to be included */
if ( NULL != include ) { if ( NULL != include ) {
char** argv = include; char** argv = include;
bool found = false; bool found = false;
while(argv && *argv) { while(argv && *argv) {
if(strcmp(component->bmi_version.mca_component_name,*argv) == 0) { if(strcmp(component->btl_version.mca_component_name,*argv) == 0) {
found = true; found = true;
break; break;
} }
@ -82,7 +82,7 @@ int mca_bmi_base_select(bool enable_progress_threads,
char** argv = exclude; char** argv = exclude;
bool found = false; bool found = false;
while(argv && *argv) { while(argv && *argv) {
if(strcmp(component->bmi_version.mca_component_name,*argv) == 0) { if(strcmp(component->btl_version.mca_component_name,*argv) == 0) {
found = true; found = true;
break; break;
} }
@ -94,45 +94,45 @@ int mca_bmi_base_select(bool enable_progress_threads,
} }
} }
ompi_output_verbose(10, mca_bmi_base_output, ompi_output_verbose(10, mca_btl_base_output,
"select: initializing %s component %s", "select: initializing %s component %s",
component->bmi_version.mca_type_name, component->btl_version.mca_type_name,
component->bmi_version.mca_component_name); component->btl_version.mca_component_name);
if (NULL == component->bmi_init) { if (NULL == component->btl_init) {
ompi_output_verbose(10, mca_bmi_base_output, ompi_output_verbose(10, mca_btl_base_output,
"select: no init function; ignoring component"); "select: no init function; ignoring component");
} else { } else {
modules = component->bmi_init(&num_bmis, enable_progress_threads, modules = component->btl_init(&num_btls, enable_progress_threads,
enable_mpi_threads); enable_mpi_threads);
/* If the component didn't initialize, remove it from the opened /* If the component didn't initialize, remove it from the opened
list and remove it from the component repository */ list and remove it from the component repository */
if (NULL == modules) { if (NULL == modules) {
ompi_output_verbose(10, mca_bmi_base_output, ompi_output_verbose(10, mca_btl_base_output,
"select: init returned failure"); "select: init returned failure");
ompi_output_verbose(10, mca_bmi_base_output, ompi_output_verbose(10, mca_btl_base_output,
"select: module %s unloaded", "select: module %s unloaded",
component->bmi_version.mca_component_name); component->btl_version.mca_component_name);
mca_base_component_repository_release((mca_base_component_t *) component); mca_base_component_repository_release((mca_base_component_t *) component);
ompi_list_remove_item(&mca_bmi_base_components_opened, item); ompi_list_remove_item(&mca_btl_base_components_opened, item);
} }
/* Otherwise, it initialized properly. Save it. */ /* Otherwise, it initialized properly. Save it. */
else { else {
ompi_output_verbose(10, mca_bmi_base_output, ompi_output_verbose(10, mca_btl_base_output,
"select: init returned success"); "select: init returned success");
for (i = 0; i < num_bmis; ++i) { for (i = 0; i < num_btls; ++i) {
sm = OBJ_NEW(mca_bmi_base_selected_module_t); sm = OBJ_NEW(mca_btl_base_selected_module_t);
if (NULL == sm) { if (NULL == sm) {
return OMPI_ERR_OUT_OF_RESOURCE; return OMPI_ERR_OUT_OF_RESOURCE;
} }
sm->bmi_component = component; sm->btl_component = component;
sm->bmi_module = modules[i]; sm->btl_module = modules[i];
ompi_list_append(&mca_bmi_base_modules_initialized, ompi_list_append(&mca_btl_base_modules_initialized,
(ompi_list_item_t*) sm); (ompi_list_item_t*) sm);
} }
free(modules); free(modules);
@ -143,9 +143,9 @@ int mca_bmi_base_select(bool enable_progress_threads,
/* Finished querying all components. Check for the bozo case. */ /* Finished querying all components. Check for the bozo case. */
if (0 == ompi_list_get_size(&mca_bmi_base_modules_initialized)) { if (0 == ompi_list_get_size(&mca_btl_base_modules_initialized)) {
/* JMS Replace with show_help */ /* JMS Replace with show_help */
orte_abort(1, "No bmi components available. This shouldn't happen."); orte_abort(1, "No btl components available. This shouldn't happen.");
} }
return OMPI_SUCCESS; return OMPI_SUCCESS;
} }