Merge in the mca_base_select changes per RFC:
http://www.open-mpi.org/community/lists/devel/2008/04/3779.php {{{ svn merge -r 18276:18380 https://svn.open-mpi.org/svn/ompi/tmp-public/jjh-mca-play . }}} Any components not in the trunk, but in one of the effected frameworks *must* be updated. Contact the list, look at the RFC, or look at the diff for how to do this. Sorry for the early commit of this, but I wanted to get it in today (per RFC) and didn't know if I would have a chance later today. This commit was SVN r18381.
Этот коммит содержится в:
родитель
a06d4023b8
Коммит
9971bc9d95
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
|
||||
* Copyright (c) 2004-2008 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
|
||||
@ -71,6 +71,7 @@ extern "C" {
|
||||
*/
|
||||
int ompi_crcp_base_none_open(void);
|
||||
int ompi_crcp_base_none_close(void);
|
||||
int ompi_crcp_base_none_query(mca_base_module_t **module, int *priority);
|
||||
|
||||
int ompi_crcp_base_module_init(void);
|
||||
int ompi_crcp_base_module_finalize(void);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2007 The Trustees of Indiana University.
|
||||
* Copyright (c) 2004-2008 The Trustees of Indiana University.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
||||
* All rights reserved.
|
||||
@ -76,6 +76,14 @@ int ompi_crcp_base_none_close(void)
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
int ompi_crcp_base_none_query(mca_base_module_t **module, int *priority)
|
||||
{
|
||||
*module = NULL;
|
||||
*priority = 0;
|
||||
|
||||
return OPAL_SUCCESS;
|
||||
}
|
||||
|
||||
int ompi_crcp_base_module_init(void)
|
||||
{
|
||||
return OMPI_SUCCESS;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2007 The Trustees of Indiana University.
|
||||
* Copyright (c) 2004-2008 The Trustees of Indiana University.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
||||
* All rights reserved.
|
||||
@ -40,7 +40,8 @@ static ompi_crcp_base_component_t none_component = {
|
||||
|
||||
/* Component open and close functions */
|
||||
ompi_crcp_base_none_open,
|
||||
ompi_crcp_base_none_close
|
||||
ompi_crcp_base_none_close,
|
||||
ompi_crcp_base_none_query
|
||||
},
|
||||
|
||||
/* Next the MCA v1.0.0 component meta data */
|
||||
@ -48,9 +49,7 @@ static ompi_crcp_base_component_t none_component = {
|
||||
/* Is the component checkpointable ? */
|
||||
true
|
||||
},
|
||||
|
||||
/* Query Function */
|
||||
NULL,
|
||||
|
||||
/* Verbosity level */
|
||||
0,
|
||||
/* opal_output handler */
|
||||
@ -117,125 +116,63 @@ static ompi_crcp_base_module_t none_module = {
|
||||
|
||||
int ompi_crcp_base_select(void)
|
||||
{
|
||||
int priority = 0, best_priority = -1;
|
||||
opal_list_item_t *item = NULL;
|
||||
mca_base_component_list_item_t *cli = NULL;
|
||||
ompi_crcp_base_component_t *component = NULL, *best_component = NULL;
|
||||
ompi_crcp_base_module_t *module = NULL, *best_module = NULL;
|
||||
char *crcp_include_list = NULL;
|
||||
bool fail_on_non_selection = false;
|
||||
int ret, exit_status = OMPI_SUCCESS;
|
||||
ompi_crcp_base_component_t *best_component = NULL;
|
||||
ompi_crcp_base_module_t *best_module = NULL;
|
||||
char *include_list = NULL;
|
||||
|
||||
/* Register the framework MCA param and look it up */
|
||||
/*
|
||||
* Register the framework MCA param and look up include list
|
||||
*/
|
||||
mca_base_param_reg_string_name("crcp", NULL,
|
||||
"Which CRCP component to use (empty = auto-select)",
|
||||
false, false,
|
||||
strdup("none"), &crcp_include_list);
|
||||
strdup("none"), &include_list);
|
||||
|
||||
if (NULL == crcp_include_list || 0 == strlen(crcp_include_list)) {
|
||||
opal_output_verbose(20, ompi_crcp_base_output,
|
||||
"crcp:select: auto-selecting");
|
||||
} else {
|
||||
opal_output_verbose(20, ompi_crcp_base_output,
|
||||
"crcp:select: looking for %s component", crcp_include_list);
|
||||
if(0 == strncmp(crcp_include_list, "none", strlen("none")) ) {
|
||||
goto do_none_comp;
|
||||
}
|
||||
else {
|
||||
fail_on_non_selection = true;
|
||||
}
|
||||
if(NULL != include_list && 0 == strncmp(include_list, "none", strlen("none")) ){
|
||||
opal_output_verbose(10, ompi_crcp_base_output,
|
||||
"crcp:select: Using %s component",
|
||||
include_list);
|
||||
best_component = &none_component;
|
||||
best_module = &none_module;
|
||||
/* 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,
|
||||
NULL);
|
||||
goto skip_select;
|
||||
}
|
||||
|
||||
/* Traverse the list of available components;
|
||||
* calling their init functions
|
||||
*/
|
||||
for (item = opal_list_get_first(&ompi_crcp_base_components_available);
|
||||
item != opal_list_get_end(&ompi_crcp_base_components_available);
|
||||
item = opal_list_get_next(item) ) {
|
||||
cli = (mca_base_component_list_item_t *) item;
|
||||
component = (ompi_crcp_base_component_t *) cli->cli_component;
|
||||
|
||||
/* If there is an include list -
|
||||
* the item must be in the list to be included :)
|
||||
*/
|
||||
if (NULL != crcp_include_list &&
|
||||
0 < strlen(crcp_include_list) &&
|
||||
0 != strncmp(component->crcp_version.mca_component_name,
|
||||
crcp_include_list, strlen(crcp_include_list)) ) {
|
||||
opal_output_verbose(20, ompi_crcp_base_output,
|
||||
"crcp:select: Skipping %s component",
|
||||
component->crcp_version.mca_component_name);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (NULL == component->crcp_query) {
|
||||
opal_output_verbose(20, ompi_crcp_base_output,
|
||||
"crcp:select: No init function! Ignoring component %s",
|
||||
component->crcp_version.mca_component_name );
|
||||
continue;
|
||||
}
|
||||
|
||||
opal_output_verbose(20, ompi_crcp_base_output,
|
||||
"crcp:select: Initializing component %s",
|
||||
component->crcp_version.mca_component_name);
|
||||
|
||||
module = component->crcp_query(&priority);
|
||||
if (NULL == module) {
|
||||
opal_output_verbose(20, ompi_crcp_base_output,
|
||||
"crcp:select: Init returned failure for component %s",
|
||||
component->crcp_version.mca_component_name );
|
||||
continue;
|
||||
}
|
||||
|
||||
opal_output_verbose(20, ompi_crcp_base_output,
|
||||
"crcp:select: Init returned priority %d",
|
||||
priority);
|
||||
if (priority > best_priority) {
|
||||
best_priority = priority;
|
||||
best_component = component;
|
||||
best_module = module;
|
||||
}
|
||||
}
|
||||
|
||||
/* Finished querying all components.
|
||||
* Check for the bozo case.
|
||||
/*
|
||||
* Select the best component
|
||||
*/
|
||||
do_none_comp:
|
||||
if (NULL == best_component ) {
|
||||
if( fail_on_non_selection ) {
|
||||
return OMPI_ERROR;
|
||||
}
|
||||
else {
|
||||
opal_output_verbose(20, ompi_crcp_base_output,
|
||||
"crcp:select: No component found, using the base component. ;(");
|
||||
best_component = &none_component;
|
||||
best_module = &none_module;
|
||||
}
|
||||
if( OPAL_SUCCESS != (ret = mca_base_select("crcp", ompi_crcp_base_output,
|
||||
&ompi_crcp_base_components_available,
|
||||
(mca_base_module_t **) &best_module,
|
||||
(mca_base_component_t **) &best_component) ) ) {
|
||||
/* This will only happen if no component was selected */
|
||||
exit_status = OMPI_ERROR;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
/* Go through the list and close
|
||||
* the non-selected components
|
||||
*/
|
||||
mca_base_components_close(0, /* We must pass it 0, to keep it from closing it */
|
||||
&ompi_crcp_base_components_available,
|
||||
(mca_base_component_t *) best_component);
|
||||
|
||||
skip_select:
|
||||
/* Save the winner */
|
||||
ompi_crcp_base_selected_component = *best_component;
|
||||
ompi_crcp = *best_module;
|
||||
opal_output_verbose(15, ompi_crcp_base_output,
|
||||
"crcp:select: Component %s selected",
|
||||
best_component->crcp_version.mca_component_name);
|
||||
|
||||
/* Initialize the winner */
|
||||
if (NULL != best_module) {
|
||||
if (OMPI_SUCCESS != ompi_crcp.crcp_init( )) {
|
||||
return OMPI_ERROR;
|
||||
if (OPAL_SUCCESS != ompi_crcp.crcp_init()) {
|
||||
exit_status = OMPI_ERROR;
|
||||
goto cleanup;
|
||||
}
|
||||
}
|
||||
|
||||
if( NULL != crcp_include_list ) {
|
||||
free(crcp_include_list);
|
||||
cleanup:
|
||||
if( NULL != include_list ) {
|
||||
free(include_list);
|
||||
include_list = NULL;
|
||||
}
|
||||
|
||||
return OMPI_SUCCESS;
|
||||
|
||||
return exit_status;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2007 The Trustees of Indiana University.
|
||||
* Copyright (c) 2004-2008 The Trustees of Indiana University.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
||||
* All rights reserved.
|
||||
@ -56,8 +56,7 @@ extern "C" {
|
||||
/*
|
||||
* Module functions
|
||||
*/
|
||||
ompi_crcp_base_module_1_0_0_t *
|
||||
ompi_crcp_coord_component_query(int *priority);
|
||||
int ompi_crcp_coord_component_query(mca_base_module_t **module, int *priority);
|
||||
int ompi_crcp_coord_module_init(void);
|
||||
int ompi_crcp_coord_module_finalize(void);
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2007 The Trustees of Indiana University.
|
||||
* Copyright (c) 2004-2008 The Trustees of Indiana University.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
||||
* All rights reserved.
|
||||
@ -54,7 +54,8 @@ ompi_crcp_coord_component_t mca_crcp_coord_component = {
|
||||
|
||||
/* Component open and close functions */
|
||||
crcp_coord_open,
|
||||
crcp_coord_close
|
||||
crcp_coord_close,
|
||||
ompi_crcp_coord_component_query
|
||||
},
|
||||
|
||||
/* Next the MCA v1.0.0 component meta data */
|
||||
@ -62,9 +63,7 @@ ompi_crcp_coord_component_t mca_crcp_coord_component = {
|
||||
/* The component is checkpoint ready */
|
||||
MCA_BASE_METADATA_PARAM_CHECKPOINT
|
||||
},
|
||||
|
||||
/* Query Function */
|
||||
ompi_crcp_coord_component_query,
|
||||
|
||||
/* Verbosity level */
|
||||
0,
|
||||
/* opal_output handler */
|
||||
@ -82,14 +81,14 @@ static int crcp_coord_open(void)
|
||||
* This should be the last componet to ever get used since
|
||||
* it doesn't do anything.
|
||||
*/
|
||||
mca_base_param_reg_int(&mca_crcp_coord_component.super.crcp_version,
|
||||
mca_base_param_reg_int(&mca_crcp_coord_component.super.base_version,
|
||||
"priority",
|
||||
"Priority of the CRCP coord component",
|
||||
false, false,
|
||||
mca_crcp_coord_component.super.priority,
|
||||
&mca_crcp_coord_component.super.priority);
|
||||
|
||||
mca_base_param_reg_int(&mca_crcp_coord_component.super.crcp_version,
|
||||
mca_base_param_reg_int(&mca_crcp_coord_component.super.base_version,
|
||||
"verbose",
|
||||
"Verbose level for the CRCP coord component",
|
||||
false, false,
|
||||
@ -106,7 +105,7 @@ static int crcp_coord_open(void)
|
||||
mca_crcp_coord_component.super.output_handle = ompi_crcp_base_output;
|
||||
}
|
||||
|
||||
mca_base_param_reg_int(&mca_crcp_coord_component.super.crcp_version,
|
||||
mca_base_param_reg_int(&mca_crcp_coord_component.super.base_version,
|
||||
"timing",
|
||||
"Enable Performance timing",
|
||||
false, false,
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2007 The Trustees of Indiana University.
|
||||
* Copyright (c) 2004-2008 The Trustees of Indiana University.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
||||
* All rights reserved.
|
||||
@ -103,15 +103,15 @@ static ompi_crcp_base_module_t loc_module = {
|
||||
/*
|
||||
* MCA Functions
|
||||
*/
|
||||
ompi_crcp_base_module_1_0_0_t *
|
||||
ompi_crcp_coord_component_query(int *priority)
|
||||
int ompi_crcp_coord_component_query(mca_base_module_t **module, int *priority)
|
||||
{
|
||||
opal_output_verbose(10, mca_crcp_coord_component.super.output_handle,
|
||||
"crcp:coord: component_query()");
|
||||
|
||||
*priority = mca_crcp_coord_component.super.priority;
|
||||
*module = (mca_base_module_t *)&loc_module;
|
||||
|
||||
return &loc_module;
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
||||
int ompi_crcp_coord_module_init(void)
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
|
||||
* Copyright (c) 2004-2008 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
|
||||
@ -49,14 +49,6 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Query function for CRCP components.
|
||||
* Returns a priority to rank it agaianst other available CRCP components.
|
||||
*/
|
||||
typedef struct ompi_crcp_base_module_1_0_0_t *
|
||||
(*ompi_crcp_base_component_query_1_0_0_fn_t)
|
||||
(int *priority);
|
||||
|
||||
/**
|
||||
* Module initialization function.
|
||||
* Returns OMPI_SUCCESS
|
||||
@ -269,13 +261,10 @@ typedef ompi_crcp_base_btl_state_t* (*mca_crcp_base_btl_module_ft_event_fn_t)
|
||||
*/
|
||||
struct ompi_crcp_base_component_1_0_0_t {
|
||||
/** MCA base component */
|
||||
mca_base_component_t crcp_version;
|
||||
mca_base_component_t base_version;
|
||||
/** MCA base data */
|
||||
mca_base_component_data_1_0_0_t crcp_data;
|
||||
mca_base_component_data_1_0_0_t base_data;
|
||||
|
||||
/** Component Query for Selection Function */
|
||||
ompi_crcp_base_component_query_1_0_0_fn_t crcp_query;
|
||||
|
||||
/** Verbosity Level */
|
||||
int verbose;
|
||||
/** Output Handle for opal_output */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2007 The Trustees of Indiana University.
|
||||
* Copyright (c) 2004-2008 The Trustees of Indiana University.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
||||
* All rights reserved.
|
||||
@ -29,110 +29,34 @@
|
||||
|
||||
int ompi_dpm_base_select(void)
|
||||
{
|
||||
opal_list_item_t *item;
|
||||
mca_base_component_list_item_t *cli;
|
||||
ompi_dpm_base_component_t *component, *best_component = NULL;
|
||||
ompi_dpm_base_module_t *module, *best_module = NULL;
|
||||
int priority, best_priority = -1;
|
||||
int rc;
|
||||
|
||||
/* Query all the opened components and see if they want to run */
|
||||
|
||||
for (item = opal_list_get_first(&ompi_dpm_base_components_available);
|
||||
opal_list_get_end(&ompi_dpm_base_components_available) != item;
|
||||
item = opal_list_get_next(item)) {
|
||||
cli = (mca_base_component_list_item_t *) item;
|
||||
component = (ompi_dpm_base_component_t *) cli->cli_component;
|
||||
|
||||
OPAL_OUTPUT_VERBOSE((10, ompi_dpm_base_output,
|
||||
"ompi:dpm:base:select: querying component %s",
|
||||
component->dpm_version.mca_component_name));
|
||||
|
||||
/* Call the component's init function and see if it wants to be
|
||||
selected */
|
||||
|
||||
module = component->dpm_init(&priority);
|
||||
|
||||
/* If we got a non-NULL module back, then the component wants
|
||||
to be considered for selection */
|
||||
|
||||
if (NULL != module) {
|
||||
/* If this is the best one, save it */
|
||||
if (priority > best_priority) {
|
||||
|
||||
/* If there was a previous best one, finalize */
|
||||
if (NULL != best_module) {
|
||||
|
||||
OPAL_OUTPUT_VERBOSE((10, ompi_dpm_base_output,
|
||||
"ompi:dpm:base:select: found better component - finalizing component %s",
|
||||
best_component->dpm_version.mca_component_name));
|
||||
|
||||
best_module->finalize();
|
||||
}
|
||||
|
||||
/* Save the new best one */
|
||||
best_module = module;
|
||||
best_component = component;
|
||||
|
||||
/* update the best priority */
|
||||
best_priority = priority;
|
||||
} else {
|
||||
|
||||
OPAL_OUTPUT_VERBOSE((10, ompi_dpm_base_output,
|
||||
"ompi:dpm:base:select: component %s does did not win the election",
|
||||
component->dpm_version.mca_component_name));
|
||||
|
||||
if (NULL == module->finalize) {
|
||||
opal_output(ompi_dpm_base_output,
|
||||
"It appears you are the victim of a stale library - please delete your installation lib directory and reinstall");
|
||||
} else {
|
||||
module->finalize();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* If we didn't find one to select, barf */
|
||||
|
||||
if (NULL == best_component) {
|
||||
return OMPI_ERROR;
|
||||
}
|
||||
|
||||
OPAL_OUTPUT_VERBOSE((10, ompi_dpm_base_output,
|
||||
"ompi:dpm:base:select: component %s was selected",
|
||||
best_component->dpm_version.mca_component_name));
|
||||
int ret, exit_status = OPAL_SUCCESS;
|
||||
ompi_dpm_base_component_t *best_component = NULL;
|
||||
ompi_dpm_base_module_t *best_module = NULL;
|
||||
|
||||
/* We have happiness -- save the component and module for later
|
||||
usage */
|
||||
|
||||
/*
|
||||
* Select the best component
|
||||
*/
|
||||
if( OPAL_SUCCESS != (ret = mca_base_select("dpm", ompi_dpm_base_output,
|
||||
&ompi_dpm_base_components_available,
|
||||
(mca_base_module_t **) &best_module,
|
||||
(mca_base_component_t **) &best_component) ) ) {
|
||||
/* This will only happen if no component was selected */
|
||||
exit_status = OMPI_ERR_NOT_FOUND;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
/* Save the winner */
|
||||
ompi_dpm = *best_module;
|
||||
ompi_dpm_base_selected_component = *best_component;
|
||||
|
||||
/* unload all components that were not selected */
|
||||
item = opal_list_get_first(&ompi_dpm_base_components_available);
|
||||
while(item != opal_list_get_end(&ompi_dpm_base_components_available)) {
|
||||
opal_list_item_t* next = opal_list_get_next(item);
|
||||
ompi_dpm_base_component_t* component;
|
||||
cli = (mca_base_component_list_item_t *) item;
|
||||
component = (ompi_dpm_base_component_t *) cli->cli_component;
|
||||
if(component != best_component) {
|
||||
|
||||
OPAL_OUTPUT_VERBOSE((10, ompi_dpm_base_output,
|
||||
"ompi:dpm:base:select: module %s unloaded",
|
||||
component->dpm_version.mca_component_name));
|
||||
|
||||
mca_base_component_repository_release((mca_base_component_t *) component);
|
||||
opal_list_remove_item(&ompi_dpm_base_components_available, item);
|
||||
OBJ_RELEASE(item);
|
||||
}
|
||||
item = next;
|
||||
}
|
||||
|
||||
|
||||
/* init the selected module */
|
||||
if (NULL != ompi_dpm.init) {
|
||||
if (OMPI_SUCCESS != (rc = ompi_dpm.init())) {
|
||||
return rc;
|
||||
if (OMPI_SUCCESS != (ret = ompi_dpm.init())) {
|
||||
exit_status = ret;
|
||||
goto cleanup;
|
||||
}
|
||||
}
|
||||
return OMPI_SUCCESS;
|
||||
|
||||
cleanup:
|
||||
return exit_status;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
|
||||
* Copyright (c) 2004-2008 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
|
||||
@ -164,20 +164,14 @@ typedef struct ompi_dpm_base_module_1_0_0_t ompi_dpm_base_module_t;
|
||||
OMPI_DECLSPEC extern ompi_dpm_base_module_t ompi_dpm;
|
||||
|
||||
|
||||
typedef struct ompi_dpm_base_module_1_0_0_t*
|
||||
(*ompi_dpm_base_component_init_fn_t)(int *priority);
|
||||
|
||||
|
||||
/**
|
||||
* Structure for DPM v1.0.0 components.
|
||||
*/
|
||||
struct ompi_dpm_base_component_1_0_0_t {
|
||||
/** MCA base component */
|
||||
mca_base_component_t dpm_version;
|
||||
mca_base_component_t base_version;
|
||||
/** MCA base data */
|
||||
mca_base_component_data_1_0_0_t dpm_data;
|
||||
/* component selection */
|
||||
ompi_dpm_base_component_init_fn_t dpm_init;
|
||||
mca_base_component_data_1_0_0_t base_data;
|
||||
};
|
||||
typedef struct ompi_dpm_base_component_1_0_0_t ompi_dpm_base_component_1_0_0_t;
|
||||
typedef struct ompi_dpm_base_component_1_0_0_t ompi_dpm_base_component_t;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
|
||||
* Copyright (c) 2004-2008 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
|
||||
@ -23,7 +23,7 @@
|
||||
|
||||
static int dpm_orte_component_open(void);
|
||||
static int dpm_orte_component_close(void);
|
||||
static ompi_dpm_base_module_t* dpm_orte_component_init( int* priority );
|
||||
static int dpm_orte_component_query(mca_base_module_t **module, int *priority);
|
||||
|
||||
ompi_dpm_base_component_t mca_dpm_orte_component = {
|
||||
/* First, the mca_base_component_t struct containing meta
|
||||
@ -40,17 +40,15 @@ ompi_dpm_base_component_t mca_dpm_orte_component = {
|
||||
OMPI_MINOR_VERSION, /* MCA component minor version */
|
||||
OMPI_RELEASE_VERSION, /* MCA component release version */
|
||||
dpm_orte_component_open, /* component open */
|
||||
dpm_orte_component_close /* component close */
|
||||
dpm_orte_component_close, /* component close */
|
||||
dpm_orte_component_query /* component query */
|
||||
},
|
||||
|
||||
/* Next the MCA v1.0.0 component meta data */
|
||||
|
||||
{
|
||||
/* This component is checkpoint ready */
|
||||
MCA_BASE_METADATA_PARAM_CHECKPOINT
|
||||
},
|
||||
|
||||
dpm_orte_component_init, /* component init */
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -64,9 +62,9 @@ int dpm_orte_component_close(void)
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
ompi_dpm_base_module_t* dpm_orte_component_init(int* priority)
|
||||
static int dpm_orte_component_query(mca_base_module_t **module, int *priority)
|
||||
{
|
||||
*priority = 50;
|
||||
|
||||
return &ompi_dpm_orte_module;
|
||||
*module = (mca_base_module_t *) &ompi_dpm_orte_module;
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2007 The Trustees of Indiana University.
|
||||
* Copyright (c) 2004-2008 The Trustees of Indiana University.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
||||
* All rights reserved.
|
||||
@ -29,110 +29,34 @@
|
||||
|
||||
int ompi_pubsub_base_select(void)
|
||||
{
|
||||
opal_list_item_t *item;
|
||||
mca_base_component_list_item_t *cli;
|
||||
ompi_pubsub_base_component_t *component, *best_component = NULL;
|
||||
ompi_pubsub_base_module_t *module, *best_module = NULL;
|
||||
int priority, best_priority = -1;
|
||||
int rc;
|
||||
|
||||
/* Query all the opened components and see if they want to run */
|
||||
|
||||
for (item = opal_list_get_first(&ompi_pubsub_base_components_available);
|
||||
opal_list_get_end(&ompi_pubsub_base_components_available) != item;
|
||||
item = opal_list_get_next(item)) {
|
||||
cli = (mca_base_component_list_item_t *) item;
|
||||
component = (ompi_pubsub_base_component_t *) cli->cli_component;
|
||||
|
||||
OPAL_OUTPUT_VERBOSE((10, ompi_pubsub_base_output,
|
||||
"ompi:pubsub:base:select: querying component %s",
|
||||
component->pubsub_version.mca_component_name));
|
||||
|
||||
/* Call the component's init function and see if it wants to be
|
||||
selected */
|
||||
|
||||
module = component->pubsub_init(&priority);
|
||||
|
||||
/* If we got a non-NULL module back, then the component wants
|
||||
to be considered for selection */
|
||||
|
||||
if (NULL != module) {
|
||||
/* If this is the best one, save it */
|
||||
if (priority > best_priority) {
|
||||
|
||||
/* If there was a previous best one, finalize */
|
||||
if (NULL != best_module) {
|
||||
|
||||
OPAL_OUTPUT_VERBOSE((10, ompi_pubsub_base_output,
|
||||
"ompi:pubsub:base:select: found better component - finalizing component %s",
|
||||
best_component->pubsub_version.mca_component_name));
|
||||
|
||||
best_module->finalize();
|
||||
}
|
||||
|
||||
/* Save the new best one */
|
||||
best_module = module;
|
||||
best_component = component;
|
||||
|
||||
/* update the best priority */
|
||||
best_priority = priority;
|
||||
} else {
|
||||
|
||||
OPAL_OUTPUT_VERBOSE((10, ompi_pubsub_base_output,
|
||||
"ompi:pubsub:base:select: component %s does did not win the election",
|
||||
component->pubsub_version.mca_component_name));
|
||||
|
||||
if (NULL == module->finalize) {
|
||||
opal_output(ompi_pubsub_base_output,
|
||||
"It appears you are the victim of a stale library - please delete your installation lib directory and reinstall");
|
||||
} else {
|
||||
module->finalize();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* If we didn't find one to select, barf */
|
||||
|
||||
if (NULL == best_component) {
|
||||
return OMPI_ERROR;
|
||||
}
|
||||
|
||||
OPAL_OUTPUT_VERBOSE((10, ompi_pubsub_base_output,
|
||||
"ompi:pubsub:base:select: component %s was selected",
|
||||
best_component->pubsub_version.mca_component_name));
|
||||
int ret, exit_status = OPAL_SUCCESS;
|
||||
ompi_pubsub_base_component_t *best_component = NULL;
|
||||
ompi_pubsub_base_module_t *best_module = NULL;
|
||||
|
||||
/* We have happiness -- save the component and module for later
|
||||
usage */
|
||||
|
||||
/*
|
||||
* Select the best component
|
||||
*/
|
||||
if( OPAL_SUCCESS != (ret = mca_base_select("pubsub", ompi_pubsub_base_output,
|
||||
&ompi_pubsub_base_components_available,
|
||||
(mca_base_module_t **) &best_module,
|
||||
(mca_base_component_t **) &best_component) ) ) {
|
||||
/* This will only happen if no component was selected */
|
||||
exit_status = OMPI_ERR_NOT_FOUND;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
/* Save the winner */
|
||||
ompi_pubsub = *best_module;
|
||||
ompi_pubsub_base_selected_component = *best_component;
|
||||
|
||||
/* unload all components that were not selected */
|
||||
item = opal_list_get_first(&ompi_pubsub_base_components_available);
|
||||
while(item != opal_list_get_end(&ompi_pubsub_base_components_available)) {
|
||||
opal_list_item_t* next = opal_list_get_next(item);
|
||||
ompi_pubsub_base_component_t* component;
|
||||
cli = (mca_base_component_list_item_t *) item;
|
||||
component = (ompi_pubsub_base_component_t *) cli->cli_component;
|
||||
if(component != best_component) {
|
||||
|
||||
OPAL_OUTPUT_VERBOSE((10, ompi_pubsub_base_output,
|
||||
"ompi:pubsub:base:select: module %s unloaded",
|
||||
component->pubsub_version.mca_component_name));
|
||||
|
||||
mca_base_component_repository_release((mca_base_component_t *) component);
|
||||
opal_list_remove_item(&ompi_pubsub_base_components_available, item);
|
||||
OBJ_RELEASE(item);
|
||||
}
|
||||
item = next;
|
||||
}
|
||||
|
||||
/* init the selected module */
|
||||
if (NULL != ompi_pubsub.init) {
|
||||
if (OMPI_SUCCESS != (rc = ompi_pubsub.init())) {
|
||||
return rc;
|
||||
if (OMPI_SUCCESS != (ret = ompi_pubsub.init())) {
|
||||
exit_status = ret;
|
||||
goto cleanup;
|
||||
}
|
||||
}
|
||||
return OMPI_SUCCESS;
|
||||
|
||||
cleanup:
|
||||
return exit_status;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
|
||||
* Copyright (c) 2004-2008 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
|
||||
@ -23,8 +23,7 @@
|
||||
|
||||
static int pubsub_orte_component_open(void);
|
||||
static int pubsub_orte_component_close(void);
|
||||
static ompi_pubsub_base_module_t*
|
||||
pubsub_orte_component_init( int* priority );
|
||||
static int pubsub_orte_component_query(mca_base_module_t **module, int *priority);
|
||||
|
||||
ompi_pubsub_orte_component_t mca_pubsub_orte_component = {
|
||||
{
|
||||
@ -42,27 +41,25 @@ ompi_pubsub_orte_component_t mca_pubsub_orte_component = {
|
||||
OMPI_MINOR_VERSION, /* MCA component minor version */
|
||||
OMPI_RELEASE_VERSION, /* MCA component release version */
|
||||
pubsub_orte_component_open, /* component open */
|
||||
pubsub_orte_component_close /* component close */
|
||||
pubsub_orte_component_close, /* component close */
|
||||
pubsub_orte_component_query /* component query */
|
||||
},
|
||||
|
||||
/* Next the MCA v1.0.0 component meta data */
|
||||
|
||||
{
|
||||
/* This component is checkpoint ready */
|
||||
MCA_BASE_METADATA_PARAM_CHECKPOINT
|
||||
},
|
||||
|
||||
pubsub_orte_component_init, /* component init */
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
int pubsub_orte_component_open(void)
|
||||
static int pubsub_orte_component_open(void)
|
||||
{
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
int pubsub_orte_component_close(void)
|
||||
static int pubsub_orte_component_close(void)
|
||||
{
|
||||
if (NULL != mca_pubsub_orte_component.server_uri) {
|
||||
free(mca_pubsub_orte_component.server_uri);
|
||||
@ -71,9 +68,9 @@ int pubsub_orte_component_close(void)
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
ompi_pubsub_base_module_t* pubsub_orte_component_init(int* priority)
|
||||
static int pubsub_orte_component_query(mca_base_module_t **module, int *priority)
|
||||
{
|
||||
mca_base_component_t *comp = &mca_pubsub_orte_component.super.pubsub_version;
|
||||
mca_base_component_t *comp = &mca_pubsub_orte_component.super.base_version;
|
||||
|
||||
mca_base_param_reg_string(comp, "server",
|
||||
"Contact info for ompi_server for publish/subscribe operations",
|
||||
@ -83,6 +80,6 @@ ompi_pubsub_base_module_t* pubsub_orte_component_init(int* priority)
|
||||
mca_pubsub_orte_component.server_found = false;
|
||||
|
||||
*priority = 50;
|
||||
|
||||
return &ompi_pubsub_orte_module;
|
||||
*module = (mca_base_module_t *) &ompi_pubsub_orte_module;
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
|
||||
* Copyright (c) 2004-2008 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
|
||||
@ -83,20 +83,14 @@ typedef struct ompi_pubsub_base_module_1_0_0_t ompi_pubsub_base_module_t;
|
||||
OMPI_DECLSPEC extern ompi_pubsub_base_module_t ompi_pubsub;
|
||||
|
||||
|
||||
typedef struct ompi_pubsub_base_module_1_0_0_t*
|
||||
(*ompi_pubsub_base_component_init_fn_t)(int *priority);
|
||||
|
||||
|
||||
/**
|
||||
* Structure for PUBSUB v1.0.0 components.
|
||||
*/
|
||||
struct ompi_pubsub_base_component_1_0_0_t {
|
||||
/** MCA base component */
|
||||
mca_base_component_t pubsub_version;
|
||||
mca_base_component_t base_version;
|
||||
/** MCA base data */
|
||||
mca_base_component_data_1_0_0_t pubsub_data;
|
||||
/* component selection */
|
||||
ompi_pubsub_base_component_init_fn_t pubsub_init;
|
||||
mca_base_component_data_1_0_0_t base_data;
|
||||
};
|
||||
typedef struct ompi_pubsub_base_component_1_0_0_t ompi_pubsub_base_component_1_0_0_t;
|
||||
typedef struct ompi_pubsub_base_component_1_0_0_t ompi_pubsub_base_component_t;
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
# Copyright (c) 2004-2008 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
|
||||
@ -45,6 +45,7 @@ libmca_base_la_SOURCES = \
|
||||
mca_base_component_repository.c \
|
||||
mca_base_components_open.c \
|
||||
mca_base_components_close.c \
|
||||
mca_base_components_select.c \
|
||||
mca_base_list.c \
|
||||
mca_base_open.c \
|
||||
mca_base_param.c \
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* Copyright (c) 2004-2008 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
|
||||
@ -93,6 +93,15 @@ OPAL_DECLSPEC int mca_base_open(void);
|
||||
*/
|
||||
OPAL_DECLSPEC int mca_base_close(void);
|
||||
|
||||
/**
|
||||
* A generic select function
|
||||
*
|
||||
*/
|
||||
OPAL_DECLSPEC int mca_base_select(const char *type_name, int output_id,
|
||||
opal_list_t *components_available,
|
||||
mca_base_module_t **best_module,
|
||||
mca_base_component_t **best_component);
|
||||
|
||||
/* mca_base_cmd_line.c */
|
||||
|
||||
OPAL_DECLSPEC int mca_base_cmd_line_setup(opal_cmd_line_t *cmd);
|
||||
|
167
opal/mca/base/mca_base_components_select.c
Обычный файл
167
opal/mca/base/mca_base_components_select.c
Обычный файл
@ -0,0 +1,167 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2008 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
* Corporation. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
*
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#include "opal_config.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "opal/class/opal_list.h"
|
||||
#include "opal/util/strncpy.h"
|
||||
#include "opal/util/argv.h"
|
||||
#include "opal/util/output.h"
|
||||
#include "opal/util/show_help.h"
|
||||
#include "opal/mca/mca.h"
|
||||
#include "opal/mca/base/base.h"
|
||||
#include "opal/mca/base/mca_base_component_repository.h"
|
||||
#include "opal/constants.h"
|
||||
|
||||
|
||||
int mca_base_select(const char *type_name, int output_id,
|
||||
opal_list_t *components_available,
|
||||
mca_base_module_t **best_module,
|
||||
mca_base_component_t **best_component)
|
||||
{
|
||||
mca_base_component_list_item_t *cli = NULL;
|
||||
mca_base_component_t *component = NULL;
|
||||
mca_base_module_t *module = NULL;
|
||||
opal_list_item_t *item = NULL;
|
||||
int priority = 0, best_priority = -1;
|
||||
char *include_list = NULL;
|
||||
char *tmp_str = NULL;
|
||||
|
||||
*best_module = NULL;
|
||||
*best_component = NULL;
|
||||
|
||||
/*
|
||||
* See if there is an include list
|
||||
*/
|
||||
asprintf(&tmp_str, "Which %s component to use (empty = auto-select)", type_name);
|
||||
mca_base_param_reg_string_name(type_name, NULL, tmp_str,
|
||||
false, false,
|
||||
NULL, &include_list);
|
||||
free(tmp_str);
|
||||
tmp_str = NULL;
|
||||
if (NULL == include_list || 0 == strlen(include_list)) {
|
||||
opal_output_verbose(10, output_id,
|
||||
"%s:select: Auto-selecting",
|
||||
type_name);
|
||||
} else {
|
||||
opal_output_verbose(10, output_id,
|
||||
"%s:select: Selecting from %s component(s)",
|
||||
type_name, include_list);
|
||||
}
|
||||
|
||||
/*
|
||||
* Traverse the list of available components.
|
||||
* For each call their 'query' functions to determine relative priority.
|
||||
*/
|
||||
for (item = opal_list_get_first(components_available);
|
||||
item != opal_list_get_end(components_available);
|
||||
item = opal_list_get_next(item) ) {
|
||||
cli = (mca_base_component_list_item_t *) item;
|
||||
component = (mca_base_component_t *) cli->cli_component;
|
||||
|
||||
/*
|
||||
* If there is an include list, make sure this item is in the list
|
||||
*/
|
||||
if( NULL != include_list && 0 < strlen(include_list) ) {
|
||||
if( 0 != strncmp(component->mca_component_name,
|
||||
include_list,
|
||||
strlen(include_list)) ) {
|
||||
opal_output_verbose(5, output_id,
|
||||
"mca:base:select: Skipping component [%s]. Not in the include list [%s]",
|
||||
component->mca_component_name,
|
||||
include_list);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* If there is a query function then use it.
|
||||
*/
|
||||
if (NULL == component->mca_query_component) {
|
||||
opal_output_verbose(5, output_id,
|
||||
"mca:base:select: Skipping component [%s]. It does not implement a query function",
|
||||
component->mca_component_name );
|
||||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
* Query this component for the module and priority
|
||||
*/
|
||||
opal_output_verbose(5, output_id,
|
||||
"mca:base:select: Querying component [%s]",
|
||||
component->mca_component_name);
|
||||
|
||||
component->mca_query_component(&module, &priority);
|
||||
|
||||
/*
|
||||
* If no module was returned, then skip component
|
||||
*/
|
||||
if (NULL == module) {
|
||||
opal_output_verbose(5, output_id,
|
||||
"mca:base:select: Skipping component [%s]. Query failed to return a module",
|
||||
component->mca_component_name );
|
||||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
* Determine if this is the best module we have seen by looking the priority
|
||||
*/
|
||||
opal_output_verbose(5, output_id,
|
||||
"mca:base:select: Query of component [%s] set priority to %d",
|
||||
component->mca_component_name,
|
||||
priority);
|
||||
if (priority > best_priority) {
|
||||
best_priority = priority;
|
||||
*best_component = component;
|
||||
*best_module = module;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Finished querying all components.
|
||||
* Make sure we found something in the process.
|
||||
*/
|
||||
if (NULL == *best_component) {
|
||||
opal_output_verbose(5, output_id,
|
||||
"mca:base:select: No component selected!");
|
||||
/*
|
||||
* Still close the non-selected components
|
||||
*/
|
||||
mca_base_components_close(0, /* Pass 0 to keep this from closing the output handle */
|
||||
components_available,
|
||||
NULL);
|
||||
return OPAL_ERROR;
|
||||
}
|
||||
|
||||
opal_output_verbose(5, output_id,
|
||||
"mca:base:select: Selected component [%s]",
|
||||
(*best_component)->mca_component_name);
|
||||
|
||||
/*
|
||||
* Close the non-selected components
|
||||
*/
|
||||
mca_base_components_close(output_id,
|
||||
components_available,
|
||||
(mca_base_component_t *) (*best_component));
|
||||
|
||||
|
||||
if( NULL != include_list ) {
|
||||
free(include_list);
|
||||
include_list = NULL;
|
||||
}
|
||||
|
||||
return OPAL_SUCCESS;
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
|
||||
* Copyright (c) 2004-2008 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
* Corporation. All rights reserved.
|
||||
* Copyright (c) 2004-2008 The University of Tennessee and The University
|
||||
@ -422,7 +422,6 @@ int mca_base_param_register_string(const char *type_name,
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Associate a keyval with a parameter index
|
||||
*/
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* Copyright (c) 2004-2008 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
|
||||
@ -44,9 +44,13 @@ mca_carto_auto_detect_component;
|
||||
|
||||
/**
|
||||
* carto query API function
|
||||
*
|
||||
* Query function for carto components. Simply returns a priority
|
||||
* to rank it against other available carto components (assumedly,
|
||||
* only one component will be available per platform, but it's
|
||||
* possible that there could be more than one available).
|
||||
*/
|
||||
const opal_carto_base_module_1_0_0_t *
|
||||
opal_carto_auto_detect_component_query(int *query);
|
||||
int opal_carto_auto_detect_component_query(mca_base_module_t **module, int *priority);
|
||||
|
||||
END_C_DECLS
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
|
||||
* Copyright (c) 2004-2008 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
|
||||
@ -66,23 +66,20 @@ const opal_carto_base_component_1_0_0_t mca_carto_auto_detect_component = {
|
||||
/* Component open and close functions */
|
||||
|
||||
auto_detect_open,
|
||||
NULL
|
||||
NULL,
|
||||
opal_carto_auto_detect_component_query
|
||||
},
|
||||
{
|
||||
|
||||
/* The component is checkpoint ready */
|
||||
MCA_BASE_METADATA_PARAM_CHECKPOINT
|
||||
},
|
||||
|
||||
/* Query function */
|
||||
|
||||
opal_carto_auto_detect_component_query
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
static int auto_detect_open(void)
|
||||
{
|
||||
mca_base_param_reg_int(&mca_carto_auto_detect_component.cartoc_version,
|
||||
mca_base_param_reg_int(&mca_carto_auto_detect_component.base_version,
|
||||
"priority",
|
||||
"Priority of the auto_detect carto component",
|
||||
false, false, 11, NULL);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* Copyright (c) 2004-2008 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
|
||||
@ -52,7 +52,7 @@ static int opal_carto_auto_detect_finalize(void);
|
||||
/*
|
||||
* Auto detect carto module
|
||||
*/
|
||||
static const opal_carto_base_module_1_0_0_t module = {
|
||||
static const opal_carto_base_module_1_0_0_t loc_module = {
|
||||
opal_carto_auto_detect_init,
|
||||
opal_carto_base_graph_get_host_graph,
|
||||
opal_carto_base_free_graph,
|
||||
@ -62,16 +62,16 @@ static const opal_carto_base_module_1_0_0_t module = {
|
||||
opal_carto_auto_detect_finalize,
|
||||
};
|
||||
|
||||
|
||||
const opal_carto_base_module_1_0_0_t *
|
||||
opal_carto_auto_detect_component_query(int *query)
|
||||
int opal_carto_auto_detect_component_query(mca_base_module_t **module, int *priority)
|
||||
{
|
||||
int param;
|
||||
|
||||
param = mca_base_param_find("carto", "auto_detect", "priority");
|
||||
mca_base_param_lookup_int(param, query);
|
||||
mca_base_param_lookup_int(param, priority);
|
||||
|
||||
return &module;
|
||||
*module = (mca_base_module_t *)&loc_module;
|
||||
|
||||
return OPAL_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* Copyright (c) 2004-2008 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
* Corporation. All rights reserved.
|
||||
* Copyright (c) 2004-2006 The University of Tennessee and The University
|
||||
@ -38,111 +38,36 @@ const opal_carto_base_module_1_0_0_t *opal_carto_base_module = NULL;
|
||||
|
||||
int opal_carto_base_select(void)
|
||||
{
|
||||
int priority = 0, best_priority = 0;
|
||||
opal_list_item_t *item = NULL;
|
||||
mca_base_component_list_item_t *cli = NULL;
|
||||
opal_carto_base_component_1_0_0_t *component = NULL,
|
||||
*best_component = NULL;
|
||||
const opal_carto_base_module_1_0_0_t *module = NULL,
|
||||
*best_module = NULL;
|
||||
char *value;
|
||||
int ret, exit_status = OPAL_SUCCESS;
|
||||
opal_carto_base_component_1_0_0_t *best_component = NULL;
|
||||
opal_carto_base_module_1_0_0_t *best_module = NULL;
|
||||
|
||||
/* Register the framework MCA param and look it up */
|
||||
|
||||
mca_base_param_reg_string_name("carto", NULL,
|
||||
"Which carto component to use (empty = auto-select)",
|
||||
false, false,
|
||||
NULL, &value);
|
||||
|
||||
if (NULL == value || 0 == strlen(value)) {
|
||||
opal_output_verbose(10, opal_carto_base_output,
|
||||
"carto:select: auto-selecting");
|
||||
} else {
|
||||
opal_output_verbose(10, opal_carto_base_output,
|
||||
"carto:select: looking for %s component",
|
||||
value);
|
||||
/*
|
||||
* Select the best component
|
||||
*/
|
||||
if( OPAL_SUCCESS != (ret = mca_base_select("carto", opal_carto_base_output,
|
||||
&opal_carto_base_components_opened,
|
||||
(mca_base_module_t **) &best_module,
|
||||
(mca_base_component_t **) &best_component) ) ) {
|
||||
/* This will only happen if no component was selected */
|
||||
exit_status = OPAL_ERR_NOT_FOUND;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
/* Traverse the list of available components; call their init
|
||||
functions. */
|
||||
|
||||
best_priority = -1;
|
||||
best_component = NULL;
|
||||
module = NULL;
|
||||
for (item = opal_list_get_first(&opal_carto_base_components_opened);
|
||||
opal_list_get_end(&opal_carto_base_components_opened) != item;
|
||||
item = opal_list_get_next(item) ) {
|
||||
cli = (mca_base_component_list_item_t *) item;
|
||||
component = (opal_carto_base_component_1_0_0_t *) cli->cli_component;
|
||||
|
||||
/* if there is an include list - item must be in the list to
|
||||
be included */
|
||||
|
||||
if (NULL != value && strlen(value) > 0 &&
|
||||
0 != strcmp(component->cartoc_version.mca_component_name,
|
||||
value)) {
|
||||
opal_output_verbose(10, opal_carto_base_output,
|
||||
"carto:select: skipping %s component",
|
||||
component->cartoc_version.mca_component_name);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (NULL == component->cartoc_query) {
|
||||
opal_output_verbose(10, opal_carto_base_output,
|
||||
"carto:select: no init function; ignoring component %s",
|
||||
component->cartoc_version.mca_component_name );
|
||||
continue;
|
||||
}
|
||||
opal_output_verbose(10, opal_carto_base_output,
|
||||
"carto:select: initializing component %s",
|
||||
component->cartoc_version.mca_component_name);
|
||||
module = component->cartoc_query(&priority);
|
||||
if (NULL == module) {
|
||||
opal_output_verbose(10, opal_carto_base_output,
|
||||
"carto:select: init returned failure for component %s",
|
||||
component->cartoc_version.mca_component_name );
|
||||
continue;
|
||||
}
|
||||
opal_output_verbose(10, opal_carto_base_output,
|
||||
"carto:select: init returned priority %d",
|
||||
priority );
|
||||
if (priority > best_priority) {
|
||||
best_priority = priority;
|
||||
best_component = component;
|
||||
best_module = module;
|
||||
}
|
||||
}
|
||||
|
||||
/* Finished querying all components. Check for the bozo case. */
|
||||
|
||||
if (NULL == best_component ) {
|
||||
return OPAL_ERR_NOT_FOUND;
|
||||
}
|
||||
|
||||
/* Now go through the opened list and close all the non-selected
|
||||
components */
|
||||
|
||||
mca_base_components_close(opal_carto_base_output,
|
||||
&opal_carto_base_components_opened,
|
||||
(mca_base_component_t *) best_component);
|
||||
|
||||
/* Save the winner */
|
||||
|
||||
opal_carto_base_component = best_component;
|
||||
opal_carto_base_module = best_module;
|
||||
opal_output_verbose(10, opal_carto_base_output,
|
||||
"carto:select: component %s selected",
|
||||
best_component->cartoc_version.mca_component_name);
|
||||
opal_carto_base_selected = true;
|
||||
opal_carto_base_module = best_module;
|
||||
opal_carto_base_selected = true;
|
||||
|
||||
/* Initialize the winner */
|
||||
|
||||
if (NULL != opal_carto_base_module) {
|
||||
if (OPAL_SUCCESS != opal_carto_base_module->carto_module_init()) {
|
||||
return OPAL_ERROR;
|
||||
exit_status = OPAL_ERROR;
|
||||
goto cleanup;
|
||||
}
|
||||
}
|
||||
|
||||
return OPAL_SUCCESS;
|
||||
cleanup:
|
||||
return exit_status;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* Copyright (c) 2004-2008 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
|
||||
@ -32,17 +32,6 @@
|
||||
#include "opal/mca/base/base.h"
|
||||
#include "opal/class/opal_graph.h"
|
||||
|
||||
|
||||
/**
|
||||
* Query function for carto components. Simply returns a priority
|
||||
* to rank it against other available carto components (assumedly,
|
||||
* only one component will be available per platform, but it's
|
||||
* possible that there could be more than one available).
|
||||
*/
|
||||
typedef const struct opal_carto_base_module_1_0_0_t *
|
||||
(*opal_carto_base_component_query_1_0_0_fn_t)
|
||||
(int *priority);
|
||||
|
||||
/**
|
||||
* type for carto graph
|
||||
*/
|
||||
@ -129,24 +118,21 @@ typedef int (*opal_carto_base_module_finalize_fn_t)(void);
|
||||
*/
|
||||
struct opal_carto_base_component_1_0_0_t {
|
||||
/** MCA base component */
|
||||
mca_base_component_t cartoc_version;
|
||||
mca_base_component_t base_version;
|
||||
/** MCA base data */
|
||||
mca_base_component_data_1_0_0_t cartoc_data;
|
||||
|
||||
/** Component query function */
|
||||
opal_carto_base_component_query_1_0_0_fn_t cartoc_query;
|
||||
mca_base_component_data_1_0_0_t base_data;
|
||||
};
|
||||
/**
|
||||
* Convenience typedef
|
||||
*/
|
||||
typedef struct opal_carto_base_component_1_0_0_t opal_carto_base_component_1_0_0_t;
|
||||
typedef struct opal_carto_base_component_1_0_0_t opal_carto_base_component_t;
|
||||
|
||||
|
||||
/**
|
||||
* Structure for carto v1.0.0 modules
|
||||
*/
|
||||
struct opal_carto_base_module_1_0_0_t {
|
||||
|
||||
/** Module initialization function */
|
||||
opal_carto_base_module_init_1_0_0_fn_t carto_module_init;
|
||||
/** Get host graph */
|
||||
@ -166,6 +152,7 @@ struct opal_carto_base_module_1_0_0_t {
|
||||
* Convenience typedef
|
||||
*/
|
||||
typedef struct opal_carto_base_module_1_0_0_t opal_carto_base_module_1_0_0_t;
|
||||
typedef struct opal_carto_base_module_1_0_0_t opal_carto_base_module_t;
|
||||
|
||||
|
||||
/*
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* Copyright (c) 2004-2008 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
|
||||
@ -102,9 +102,13 @@ mca_carto_file_component;
|
||||
|
||||
/**
|
||||
* carto query API function
|
||||
*
|
||||
* Query function for carto components. Simply returns a priority
|
||||
* to rank it against other available carto components (assumedly,
|
||||
* only one component will be available per platform, but it's
|
||||
* possible that there could be more than one available).
|
||||
*/
|
||||
const opal_carto_base_module_1_0_0_t *
|
||||
opal_carto_file_component_query(int *query);
|
||||
int opal_carto_file_component_query(mca_base_module_t **module, int *priority);
|
||||
|
||||
END_C_DECLS
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
|
||||
* Copyright (c) 2004-2008 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
|
||||
@ -66,17 +66,13 @@ const opal_carto_base_component_1_0_0_t mca_carto_file_component = {
|
||||
/* Component open and close functions */
|
||||
|
||||
file_open,
|
||||
NULL
|
||||
NULL,
|
||||
opal_carto_file_component_query
|
||||
},
|
||||
{
|
||||
|
||||
/* The component is checkpoint ready */
|
||||
MCA_BASE_METADATA_PARAM_CHECKPOINT
|
||||
},
|
||||
|
||||
/* Query function */
|
||||
|
||||
opal_carto_file_component_query
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -84,12 +80,12 @@ static int file_open(void)
|
||||
{
|
||||
int index;
|
||||
|
||||
mca_base_param_reg_int(&mca_carto_file_component.cartoc_version,
|
||||
mca_base_param_reg_int(&mca_carto_file_component.base_version,
|
||||
"priority",
|
||||
"Priority of the file carto component",
|
||||
false, false, 10, NULL);
|
||||
|
||||
mca_base_param_reg_string(&mca_carto_file_component.cartoc_version,
|
||||
mca_base_param_reg_string(&mca_carto_file_component.base_version,
|
||||
"path",
|
||||
"The path to the cartography file",
|
||||
false, false, NULL, &carto_file_path);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* Copyright (c) 2004-2008 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
|
||||
@ -59,7 +59,7 @@ static int opal_carto_file_parse(const char *cartofile);
|
||||
/*
|
||||
* File carto module
|
||||
*/
|
||||
static const opal_carto_base_module_1_0_0_t module = {
|
||||
static const opal_carto_base_module_1_0_0_t loc_module = {
|
||||
opal_carto_file_init,
|
||||
opal_carto_base_graph_get_host_graph,
|
||||
opal_carto_base_free_graph,
|
||||
@ -70,18 +70,19 @@ static const opal_carto_base_module_1_0_0_t module = {
|
||||
};
|
||||
|
||||
|
||||
const opal_carto_base_module_1_0_0_t *
|
||||
opal_carto_file_component_query(int *query)
|
||||
int opal_carto_file_component_query(mca_base_module_t **module, int *priority)
|
||||
{
|
||||
int param;
|
||||
|
||||
param = mca_base_param_find("carto", "file", "priority");
|
||||
mca_base_param_lookup_int(param, query);
|
||||
mca_base_param_lookup_int(param, priority);
|
||||
|
||||
param = mca_base_param_find("carto", "file", "path");
|
||||
mca_base_param_lookup_string(param, &carto_file_path);
|
||||
|
||||
return &module;
|
||||
*module = (mca_base_module_t *)&loc_module;
|
||||
|
||||
return OPAL_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
|
||||
* Copyright (c) 2004-2008 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
|
||||
@ -80,6 +80,7 @@ extern "C" {
|
||||
*/
|
||||
int opal_crs_base_none_open(void);
|
||||
int opal_crs_base_none_close(void);
|
||||
int opal_crs_base_none_query(mca_base_module_t **module, int *priority);
|
||||
|
||||
int opal_crs_base_none_module_init(void);
|
||||
int opal_crs_base_none_module_finalize(void);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2007 The Trustees of Indiana University.
|
||||
* Copyright (c) 2004-2008 The Trustees of Indiana University.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
||||
* All rights reserved.
|
||||
@ -78,6 +78,14 @@ int opal_crs_base_none_close(void)
|
||||
return OPAL_SUCCESS;
|
||||
}
|
||||
|
||||
int opal_crs_base_none_query(mca_base_module_t **module, int *priority)
|
||||
{
|
||||
*module = NULL;
|
||||
*priority = 0;
|
||||
|
||||
return OPAL_SUCCESS;
|
||||
}
|
||||
|
||||
int opal_crs_base_none_module_init(void)
|
||||
{
|
||||
|
||||
@ -121,7 +129,7 @@ int opal_crs_base_none_checkpoint(pid_t pid, opal_crs_base_snapshot_t *snapshot,
|
||||
/*
|
||||
* Create the snapshot directory
|
||||
*/
|
||||
snapshot->super.component_name = strdup(mca_crs_none_component.super.crs_version.mca_component_name);
|
||||
snapshot->super.component_name = strdup(mca_crs_none_component.super.base_version.mca_component_name);
|
||||
if( OPAL_SUCCESS != (ret = opal_crs_base_init_snapshot_directory(&snapshot->super) )) {
|
||||
opal_output(mca_crs_none_component.super.output_handle,
|
||||
"crs:none: checkpoint(): Error: Unable to initialize the directory for (%s).",
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2007 The Trustees of Indiana University.
|
||||
* Copyright (c) 2004-2008 The Trustees of Indiana University.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
||||
* All rights reserved.
|
||||
@ -18,6 +18,8 @@
|
||||
|
||||
#include "opal_config.h"
|
||||
|
||||
#include "unistd.h"
|
||||
|
||||
#include "opal/include/opal/constants.h"
|
||||
#include "opal/util/output.h"
|
||||
#include "opal/mca/mca.h"
|
||||
@ -45,7 +47,8 @@ static opal_crs_base_component_t none_component = {
|
||||
|
||||
/* Component open and close functions */
|
||||
opal_crs_base_none_open,
|
||||
opal_crs_base_none_close
|
||||
opal_crs_base_none_close,
|
||||
opal_crs_base_none_query
|
||||
},
|
||||
|
||||
/* Next the MCA v1.0.0 component meta data */
|
||||
@ -54,8 +57,6 @@ static opal_crs_base_component_t none_component = {
|
||||
MCA_BASE_METADATA_PARAM_CHECKPOINT
|
||||
},
|
||||
|
||||
/* Query Function */
|
||||
NULL,
|
||||
/* Verbosity level */
|
||||
0,
|
||||
/* opal_output handler */
|
||||
@ -90,14 +91,10 @@ static opal_crs_base_module_t none_module = {
|
||||
|
||||
int opal_crs_base_select(void)
|
||||
{
|
||||
int priority = 0, best_priority = -1;
|
||||
opal_list_item_t *item = NULL;
|
||||
mca_base_component_list_item_t *cli = NULL;
|
||||
opal_crs_base_component_t *component = NULL, *best_component = NULL;
|
||||
opal_crs_base_module_t *module = NULL, *best_module = NULL;
|
||||
char *crs_include_list = NULL;
|
||||
bool fail_on_non_selection = false;
|
||||
bool do_not_select = false;
|
||||
int ret, exit_status = OPAL_SUCCESS;
|
||||
opal_crs_base_component_t *best_component = NULL;
|
||||
opal_crs_base_module_t *best_module = NULL;
|
||||
char *include_list = NULL;
|
||||
int int_value = 0;
|
||||
|
||||
/*
|
||||
@ -117,130 +114,64 @@ int opal_crs_base_select(void)
|
||||
true, false,
|
||||
false,
|
||||
&int_value);
|
||||
if(0 != int_value)
|
||||
do_not_select = true;
|
||||
else
|
||||
do_not_select = false;
|
||||
|
||||
if(do_not_select) {
|
||||
if( OPAL_INT_TO_BOOL(int_value) ) {
|
||||
opal_output_verbose(10, opal_crs_base_output,
|
||||
"crs:select: Not selecting at this time!");
|
||||
return OPAL_SUCCESS;
|
||||
}
|
||||
|
||||
/* Register the framework MCA param and look it up */
|
||||
/*
|
||||
* Register the framework MCA param and look up include list
|
||||
*/
|
||||
mca_base_param_reg_string_name("crs", NULL,
|
||||
"Which CRS component to use (empty = auto-select)",
|
||||
false, false,
|
||||
NULL, &crs_include_list);
|
||||
NULL, &include_list);
|
||||
|
||||
if (NULL == crs_include_list || 0 == strlen(crs_include_list)) {
|
||||
if(NULL != include_list && 0 == strncmp(include_list, "none", strlen("none")) ){
|
||||
opal_output_verbose(10, opal_crs_base_output,
|
||||
"crs:select: auto-selecting");
|
||||
} else {
|
||||
opal_output_verbose(10, opal_crs_base_output,
|
||||
"crs:select: looking for %s component", crs_include_list);
|
||||
if(0 == strncmp(crs_include_list, "none", strlen("none")) ) {
|
||||
goto do_none_comp;
|
||||
}
|
||||
else {
|
||||
/* If we can't find the requested component, then fail */
|
||||
fail_on_non_selection = true;
|
||||
}
|
||||
}
|
||||
|
||||
/* Traverse the list of available components;
|
||||
* calling their init functions
|
||||
*/
|
||||
for (item = opal_list_get_first(&opal_crs_base_components_available);
|
||||
item != opal_list_get_end(&opal_crs_base_components_available);
|
||||
item = opal_list_get_next(item) ) {
|
||||
cli = (mca_base_component_list_item_t *) item;
|
||||
component = (opal_crs_base_component_t *) cli->cli_component;
|
||||
|
||||
/* If there is an include list -
|
||||
* the item must be in the list to be included :)
|
||||
*/
|
||||
if (NULL != crs_include_list &&
|
||||
0 < strlen(crs_include_list) &&
|
||||
0 != strncmp(component->crs_version.mca_component_name,
|
||||
crs_include_list, strlen(crs_include_list)) ) {
|
||||
opal_output_verbose(10, opal_crs_base_output,
|
||||
"crs:select: Skipping %s component",
|
||||
component->crs_version.mca_component_name);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (NULL == component->crs_query) {
|
||||
opal_output_verbose(10, opal_crs_base_output,
|
||||
"crs:select: No init function! Ignoring component %s",
|
||||
component->crs_version.mca_component_name );
|
||||
continue;
|
||||
}
|
||||
|
||||
opal_output_verbose(10, opal_crs_base_output,
|
||||
"crs:select: Initializing component %s",
|
||||
component->crs_version.mca_component_name);
|
||||
|
||||
module = component->crs_query(&priority);
|
||||
if (NULL == module) {
|
||||
opal_output_verbose(10, opal_crs_base_output,
|
||||
"crs:select: Init returned failure for component %s",
|
||||
component->crs_version.mca_component_name );
|
||||
continue;
|
||||
}
|
||||
|
||||
opal_output_verbose(10, opal_crs_base_output,
|
||||
"crs:select: Init returned priority %d",
|
||||
priority);
|
||||
if (priority > best_priority) {
|
||||
best_priority = priority;
|
||||
best_component = component;
|
||||
best_module = module;
|
||||
}
|
||||
}
|
||||
|
||||
/* Finished querying all components.
|
||||
* Check for the bozo case.
|
||||
*/
|
||||
do_none_comp:
|
||||
if (NULL == best_component) {
|
||||
if( fail_on_non_selection ) {
|
||||
return OPAL_ERROR;
|
||||
}
|
||||
else {
|
||||
opal_output_verbose(19, opal_crs_base_output,
|
||||
"crs:select: No component found, using the base component. ;(");
|
||||
best_component = &none_component;
|
||||
best_module = &none_module;
|
||||
}
|
||||
"crs:select: Using %s component",
|
||||
include_list);
|
||||
best_component = &none_component;
|
||||
best_module = &none_module;
|
||||
/* 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 */
|
||||
&opal_crs_base_components_available,
|
||||
NULL);
|
||||
goto skip_select;
|
||||
}
|
||||
|
||||
/* Go through the list and close
|
||||
* the non-selected components
|
||||
/*
|
||||
* Select the best component
|
||||
*/
|
||||
mca_base_components_close(0, /* We must pass it 0, to keep it from closing it */
|
||||
&opal_crs_base_components_available,
|
||||
(mca_base_component_t *) best_component);
|
||||
if( OPAL_SUCCESS != (ret = mca_base_select("crs", opal_crs_base_output,
|
||||
&opal_crs_base_components_available,
|
||||
(mca_base_module_t **) &best_module,
|
||||
(mca_base_component_t **) &best_component) ) ) {
|
||||
/* This will only happen if no component was selected */
|
||||
exit_status = OPAL_ERROR;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
skip_select:
|
||||
/* Save the winner */
|
||||
opal_crs_base_selected_component = *best_component;
|
||||
opal_crs = *best_module;
|
||||
opal_output_verbose(5, opal_crs_base_output,
|
||||
"crs:select: Component %s selected",
|
||||
best_component->crs_version.mca_component_name);
|
||||
|
||||
/* Initialize the winner */
|
||||
if (NULL != best_module) {
|
||||
if (OPAL_SUCCESS != opal_crs.crs_init()) {
|
||||
return OPAL_ERROR;
|
||||
exit_status = OPAL_ERROR;
|
||||
goto cleanup;
|
||||
}
|
||||
}
|
||||
|
||||
if( NULL != crs_include_list ) {
|
||||
free(crs_include_list);
|
||||
crs_include_list = NULL;
|
||||
cleanup:
|
||||
if( NULL != include_list ) {
|
||||
free(include_list);
|
||||
include_list = NULL;
|
||||
}
|
||||
|
||||
return OPAL_SUCCESS;
|
||||
|
||||
return exit_status;
|
||||
}
|
||||
|
@ -1,6 +1,5 @@
|
||||
|
||||
/*
|
||||
* Copyright (c) 2004-2007 The Trustees of Indiana University.
|
||||
* Copyright (c) 2004-2008 The Trustees of Indiana University.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
||||
* All rights reserved.
|
||||
@ -50,11 +49,11 @@ extern "C" {
|
||||
typedef struct opal_crs_blcr_component_t opal_crs_blcr_component_t;
|
||||
OPAL_MODULE_DECLSPEC extern opal_crs_blcr_component_t mca_crs_blcr_component;
|
||||
|
||||
int opal_crs_blcr_component_query(mca_base_module_t **module, int *priority);
|
||||
|
||||
/*
|
||||
* Module functions
|
||||
*/
|
||||
opal_crs_base_module_1_0_0_t *
|
||||
opal_crs_blcr_component_query(int *priority);
|
||||
int opal_crs_blcr_module_init(void);
|
||||
int opal_crs_blcr_module_finalize(void);
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2007 The Trustees of Indiana University.
|
||||
* Copyright (c) 2004-2008 The Trustees of Indiana University.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
||||
* All rights reserved.
|
||||
@ -49,7 +49,8 @@ opal_crs_blcr_component_t mca_crs_blcr_component = {
|
||||
|
||||
/* Component open and close functions */
|
||||
crs_blcr_open,
|
||||
crs_blcr_close
|
||||
crs_blcr_close,
|
||||
opal_crs_blcr_component_query
|
||||
},
|
||||
|
||||
/* Next the MCA v1.0.0 component meta data */
|
||||
@ -58,8 +59,6 @@ opal_crs_blcr_component_t mca_crs_blcr_component = {
|
||||
MCA_BASE_METADATA_PARAM_CHECKPOINT
|
||||
},
|
||||
|
||||
/* Query Function */
|
||||
opal_crs_blcr_component_query,
|
||||
/* Verbosity level */
|
||||
0,
|
||||
/* opal_output handler */
|
||||
@ -72,14 +71,14 @@ opal_crs_blcr_component_t mca_crs_blcr_component = {
|
||||
static int crs_blcr_open(void)
|
||||
{
|
||||
|
||||
mca_base_param_reg_int(&mca_crs_blcr_component.super.crs_version,
|
||||
mca_base_param_reg_int(&mca_crs_blcr_component.super.base_version,
|
||||
"priority",
|
||||
"Priority of the CRS blcr component",
|
||||
false, false,
|
||||
mca_crs_blcr_component.super.priority,
|
||||
&mca_crs_blcr_component.super.priority);
|
||||
|
||||
mca_base_param_reg_int(&mca_crs_blcr_component.super.crs_version,
|
||||
mca_base_param_reg_int(&mca_crs_blcr_component.super.base_version,
|
||||
"verbose",
|
||||
"Verbose level for the CRS blcr component",
|
||||
false, false,
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2007 The Trustees of Indiana University.
|
||||
* Copyright (c) 2004-2008 The Trustees of Indiana University.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
||||
* All rights reserved.
|
||||
@ -123,7 +123,7 @@ static pid_t my_pid = -1;
|
||||
|
||||
void opal_crs_blcr_construct(opal_crs_blcr_snapshot_t *snapshot) {
|
||||
snapshot->context_filename = NULL;
|
||||
snapshot->super.component_name = strdup(mca_crs_blcr_component.super.crs_version.mca_component_name);
|
||||
snapshot->super.component_name = strdup(mca_crs_blcr_component.super.base_version.mca_component_name);
|
||||
}
|
||||
|
||||
void opal_crs_blcr_destruct( opal_crs_blcr_snapshot_t *snapshot) {
|
||||
@ -134,15 +134,15 @@ void opal_crs_blcr_destruct( opal_crs_blcr_snapshot_t *snapshot) {
|
||||
/*****************
|
||||
* MCA Functions
|
||||
*****************/
|
||||
opal_crs_base_module_1_0_0_t *
|
||||
opal_crs_blcr_component_query(int *priority)
|
||||
int opal_crs_blcr_component_query(mca_base_module_t **module, int *priority)
|
||||
{
|
||||
opal_output_verbose(10, mca_crs_blcr_component.super.output_handle,
|
||||
"crs:blcr: component_query()");
|
||||
|
||||
*priority = mca_crs_blcr_component.super.priority;
|
||||
|
||||
return &blcr_module;
|
||||
*module = (mca_base_module_t *)&blcr_module;
|
||||
|
||||
return OPAL_SUCCESS;
|
||||
}
|
||||
|
||||
int opal_crs_blcr_module_init(void)
|
||||
@ -274,7 +274,7 @@ int opal_crs_blcr_checkpoint(pid_t pid, opal_crs_base_snapshot_t *base_snapshot,
|
||||
/*
|
||||
* Create the snapshot directory
|
||||
*/
|
||||
snapshot->super.component_name = strdup(mca_crs_blcr_component.super.crs_version.mca_component_name);
|
||||
snapshot->super.component_name = strdup(mca_crs_blcr_component.super.base_version.mca_component_name);
|
||||
if( OPAL_SUCCESS != (ret = opal_crs_base_init_snapshot_directory(&snapshot->super) )) {
|
||||
*state = OPAL_CRS_ERROR;
|
||||
opal_output(mca_crs_blcr_component.super.output_handle,
|
||||
@ -768,13 +768,13 @@ static int blcr_update_snapshot_metadata(opal_crs_blcr_snapshot_t *snapshot) {
|
||||
"crs:blcr: update_snapshot_metadata(%s)", snapshot->super.reference_name);
|
||||
|
||||
/* Bozo check to make sure this snapshot is ours */
|
||||
if ( 0 != strncmp(mca_crs_blcr_component.super.crs_version.mca_component_name,
|
||||
if ( 0 != strncmp(mca_crs_blcr_component.super.base_version.mca_component_name,
|
||||
snapshot->super.component_name,
|
||||
strlen(snapshot->super.component_name)) ) {
|
||||
exit_status = OPAL_ERROR;
|
||||
opal_output(mca_crs_blcr_component.super.output_handle,
|
||||
"crs:blcr: blcr_update_snapshot_metadata: Error: This snapshot (%s) is not intended for us (%s)\n",
|
||||
snapshot->super.component_name, mca_crs_blcr_component.super.crs_version.mca_component_name);
|
||||
snapshot->super.component_name, mca_crs_blcr_component.super.base_version.mca_component_name);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
@ -823,12 +823,12 @@ static int blcr_cold_start(opal_crs_blcr_snapshot_t *snapshot) {
|
||||
snapshot->super.component_name = strdup(component_name);
|
||||
|
||||
/* Compare the component strings to make sure this is our snapshot before going further */
|
||||
if ( 0 != strncmp(mca_crs_blcr_component.super.crs_version.mca_component_name,
|
||||
if ( 0 != strncmp(mca_crs_blcr_component.super.base_version.mca_component_name,
|
||||
component_name, strlen(component_name)) ) {
|
||||
exit_status = OPAL_ERROR;
|
||||
opal_output(mca_crs_blcr_component.super.output_handle,
|
||||
"crs:blcr: blcr_cold_start: Error: This snapshot (%s) is not intended for us (%s)\n",
|
||||
component_name, mca_crs_blcr_component.super.crs_version.mca_component_name);
|
||||
component_name, mca_crs_blcr_component.super.base_version.mca_component_name);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
|
@ -100,14 +100,6 @@ typedef struct opal_crs_base_snapshot_1_0_0_t opal_crs_base_snapshot_t;
|
||||
|
||||
OPAL_DECLSPEC OBJ_CLASS_DECLARATION(opal_crs_base_snapshot_t);
|
||||
|
||||
/**
|
||||
* Query function for CRS components.
|
||||
* Returns a priority to rank it agaianst other available CRS components.
|
||||
*/
|
||||
typedef struct opal_crs_base_module_1_0_0_t *
|
||||
(*opal_crs_base_component_query_1_0_0_fn_t)
|
||||
(int *priority);
|
||||
|
||||
/**
|
||||
* Module initialization function.
|
||||
* Returns OPAL_SUCCESS
|
||||
@ -222,13 +214,10 @@ typedef int (*opal_crs_base_module_reg_thread_fn_t)
|
||||
*/
|
||||
struct opal_crs_base_component_1_0_0_t {
|
||||
/** MCA base component */
|
||||
mca_base_component_t crs_version;
|
||||
mca_base_component_t base_version;
|
||||
/** MCA base data */
|
||||
mca_base_component_data_1_0_0_t crs_data;
|
||||
mca_base_component_data_1_0_0_t base_data;
|
||||
|
||||
/** Component Query for Selection Function */
|
||||
opal_crs_base_component_query_1_0_0_fn_t crs_query;
|
||||
|
||||
/** Verbosity Level */
|
||||
int verbose;
|
||||
/** Output Handle for opal_output */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2007 The Trustees of Indiana University.
|
||||
* Copyright (c) 2004-2008 The Trustees of Indiana University.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
||||
* All rights reserved.
|
||||
@ -63,11 +63,11 @@ extern "C" {
|
||||
typedef struct opal_crs_self_component_t opal_crs_self_component_t;
|
||||
OPAL_MODULE_DECLSPEC extern opal_crs_self_component_t mca_crs_self_component;
|
||||
|
||||
int opal_crs_self_component_query(mca_base_module_t **module, int *priority);
|
||||
|
||||
/*
|
||||
* Module functions
|
||||
*/
|
||||
opal_crs_base_module_1_0_0_t *
|
||||
opal_crs_self_component_query(int *priority);
|
||||
int opal_crs_self_module_init(void);
|
||||
int opal_crs_self_module_finalize(void);
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2007 The Trustees of Indiana University.
|
||||
* Copyright (c) 2004-2008 The Trustees of Indiana University.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
||||
* All rights reserved.
|
||||
@ -53,7 +53,8 @@ opal_crs_self_component_t mca_crs_self_component = {
|
||||
|
||||
/* Component open and close functions */
|
||||
crs_self_open,
|
||||
crs_self_close
|
||||
crs_self_close,
|
||||
opal_crs_self_component_query
|
||||
},
|
||||
|
||||
/* Next the MCA v1.0.0 component meta data */
|
||||
@ -62,8 +63,6 @@ opal_crs_self_component_t mca_crs_self_component = {
|
||||
MCA_BASE_METADATA_PARAM_CHECKPOINT
|
||||
},
|
||||
|
||||
/* Query Function */
|
||||
opal_crs_self_component_query,
|
||||
/* Verbosity level */
|
||||
0,
|
||||
/* opal_output handler */
|
||||
@ -91,14 +90,14 @@ static int crs_self_open(void)
|
||||
* This should be the last componet to ever get used since
|
||||
* it doesn't do anything.
|
||||
*/
|
||||
mca_base_param_reg_int(&mca_crs_self_component.super.crs_version,
|
||||
mca_base_param_reg_int(&mca_crs_self_component.super.base_version,
|
||||
"priority",
|
||||
"Priority of the CRS self component",
|
||||
false, false,
|
||||
mca_crs_self_component.super.priority,
|
||||
&mca_crs_self_component.super.priority);
|
||||
|
||||
mca_base_param_reg_int(&mca_crs_self_component.super.crs_version,
|
||||
mca_base_param_reg_int(&mca_crs_self_component.super.base_version,
|
||||
"verbose",
|
||||
"Verbose level for the CRS self component",
|
||||
false, false,
|
||||
@ -118,14 +117,14 @@ static int crs_self_open(void)
|
||||
/*
|
||||
* Handler names
|
||||
*/
|
||||
mca_base_param_reg_string(&mca_crs_self_component.super.crs_version,
|
||||
mca_base_param_reg_string(&mca_crs_self_component.super.base_version,
|
||||
"prefix",
|
||||
"Prefix for user defined callback functions",
|
||||
false, false,
|
||||
mca_crs_self_component.prefix,
|
||||
&mca_crs_self_component.prefix);
|
||||
|
||||
mca_base_param_reg_int(&mca_crs_self_component.super.crs_version,
|
||||
mca_base_param_reg_int(&mca_crs_self_component.super.base_version,
|
||||
"do_restart",
|
||||
"Start execution by calling restart callback",
|
||||
false, false,
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2007 The Trustees of Indiana University.
|
||||
* Copyright (c) 2004-2008 The Trustees of Indiana University.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
||||
* All rights reserved.
|
||||
@ -118,8 +118,7 @@ static int opal_crs_self_extract_callbacks(void);
|
||||
/*
|
||||
* MCA Functions
|
||||
*/
|
||||
opal_crs_base_module_1_0_0_t *
|
||||
opal_crs_self_component_query(int *priority)
|
||||
int opal_crs_self_component_query(mca_base_module_t **module, int *priority)
|
||||
{
|
||||
int ret;
|
||||
|
||||
@ -134,11 +133,13 @@ opal_crs_self_component_query(int *priority)
|
||||
if( OPAL_SUCCESS != ret ||
|
||||
!mca_crs_self_component.can_checkpoint ) {
|
||||
*priority = -1;
|
||||
return NULL;
|
||||
*module = NULL;
|
||||
return OPAL_ERROR;
|
||||
}
|
||||
else {
|
||||
*priority = mca_crs_self_component.super.priority;
|
||||
return &loc_module;
|
||||
*module = (mca_base_module_t *)&loc_module;
|
||||
return OPAL_SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
@ -292,7 +293,7 @@ int opal_crs_self_checkpoint(pid_t pid, opal_crs_base_snapshot_t *base_snapshot,
|
||||
/*
|
||||
* Create the snapshot directory
|
||||
*/
|
||||
snapshot->super.component_name = strdup(mca_crs_self_component.super.crs_version.mca_component_name);
|
||||
snapshot->super.component_name = strdup(mca_crs_self_component.super.base_version.mca_component_name);
|
||||
if( OPAL_SUCCESS != (ret = opal_crs_base_init_snapshot_directory(&snapshot->super) )) {
|
||||
*state = OPAL_CRS_ERROR;
|
||||
opal_output(mca_crs_self_component.super.output_handle,
|
||||
@ -613,12 +614,12 @@ static int self_cold_start(opal_crs_self_snapshot_t *snapshot) {
|
||||
snapshot->super.component_name = strdup(component_name);
|
||||
|
||||
/* Compare the strings to make sure this is our snapshot before going further */
|
||||
if ( 0 != strncmp(mca_crs_self_component.super.crs_version.mca_component_name,
|
||||
if ( 0 != strncmp(mca_crs_self_component.super.base_version.mca_component_name,
|
||||
component_name, strlen(component_name)) ) {
|
||||
exit_status = OPAL_ERROR;
|
||||
opal_output(mca_crs_self_component.super.output_handle,
|
||||
"crs:self: self_cold_start: Error: This snapshot (%s) is not intended for us (%s)\n",
|
||||
component_name, mca_crs_self_component.super.crs_version.mca_component_name);
|
||||
component_name, mca_crs_self_component.super.base_version.mca_component_name);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* Copyright (c) 2004-2008 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
* Corporation. All rights reserved.
|
||||
* Copyright (c) 2004-2006 The University of Tennessee and The University
|
||||
@ -37,110 +37,36 @@ const opal_maffinity_base_module_1_0_0_t *opal_maffinity_base_module = NULL;
|
||||
|
||||
int opal_maffinity_base_select(void)
|
||||
{
|
||||
int priority = 0, best_priority = 0;
|
||||
opal_list_item_t *item = NULL;
|
||||
mca_base_component_list_item_t *cli = NULL;
|
||||
opal_maffinity_base_component_1_0_0_t *component = NULL,
|
||||
*best_component = NULL;
|
||||
const opal_maffinity_base_module_1_0_0_t *module = NULL,
|
||||
*best_module = NULL;
|
||||
char *value;
|
||||
int ret, exit_status = OPAL_SUCCESS;
|
||||
opal_maffinity_base_component_1_0_0_t *best_component = NULL;
|
||||
opal_maffinity_base_module_1_0_0_t *best_module = NULL;
|
||||
|
||||
/* Register the framework MCA param and look it up */
|
||||
|
||||
mca_base_param_reg_string_name("maffinity", NULL,
|
||||
"Which maffinity component to use (empty = auto-select)",
|
||||
false, false,
|
||||
NULL, &value);
|
||||
if (NULL == value || 0 == strlen(value)) {
|
||||
opal_output_verbose(10, opal_maffinity_base_output,
|
||||
"maffinity:select: auto-selecting");
|
||||
} else {
|
||||
opal_output_verbose(10, opal_maffinity_base_output,
|
||||
"maffinity:select: looking for %s component",
|
||||
value);
|
||||
/*
|
||||
* Select the best component
|
||||
*/
|
||||
if( OPAL_SUCCESS != (ret = mca_base_select("maffinity", opal_maffinity_base_output,
|
||||
&opal_maffinity_base_components_opened,
|
||||
(mca_base_module_t **) &best_module,
|
||||
(mca_base_component_t **) &best_component) ) ) {
|
||||
/* This will only happen if no component was selected */
|
||||
exit_status = OPAL_ERR_NOT_FOUND;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
/* Traverse the list of available components; call their init
|
||||
functions. */
|
||||
|
||||
best_priority = -1;
|
||||
best_component = NULL;
|
||||
module = NULL;
|
||||
for (item = opal_list_get_first(&opal_maffinity_base_components_opened);
|
||||
opal_list_get_end(&opal_maffinity_base_components_opened) != item;
|
||||
item = opal_list_get_next(item) ) {
|
||||
cli = (mca_base_component_list_item_t *) item;
|
||||
component = (opal_maffinity_base_component_1_0_0_t *) cli->cli_component;
|
||||
|
||||
/* if there is an include list - item must be in the list to
|
||||
be included */
|
||||
|
||||
if (NULL != value && strlen(value) > 0 &&
|
||||
0 != strcmp(component->maffinityc_version.mca_component_name,
|
||||
value)) {
|
||||
opal_output_verbose(10, opal_maffinity_base_output,
|
||||
"maffinity:select: skipping %s component",
|
||||
component->maffinityc_version.mca_component_name);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (NULL == component->maffinityc_query) {
|
||||
opal_output_verbose(10, opal_maffinity_base_output,
|
||||
"pafinity:select: no init function; ignoring component %s",
|
||||
component->maffinityc_version.mca_component_name );
|
||||
continue;
|
||||
}
|
||||
opal_output_verbose(10, opal_maffinity_base_output,
|
||||
"maffinity:select: initializing component %s",
|
||||
component->maffinityc_version.mca_component_name);
|
||||
module = component->maffinityc_query(&priority);
|
||||
if (NULL == module) {
|
||||
opal_output_verbose(10, opal_maffinity_base_output,
|
||||
"maffinity:select: init returned failure for component %s",
|
||||
component->maffinityc_version.mca_component_name );
|
||||
continue;
|
||||
}
|
||||
opal_output_verbose(10, opal_maffinity_base_output,
|
||||
"maffinity:select: init returned priority %d",
|
||||
priority );
|
||||
if (priority > best_priority) {
|
||||
best_priority = priority;
|
||||
best_component = component;
|
||||
best_module = module;
|
||||
}
|
||||
}
|
||||
|
||||
/* Finished querying all components. Check for the bozo case. */
|
||||
|
||||
if (NULL == best_component ) {
|
||||
return OPAL_ERR_NOT_FOUND;
|
||||
}
|
||||
|
||||
/* Now go through the opened list and close all the non-selected
|
||||
components */
|
||||
|
||||
mca_base_components_close(opal_maffinity_base_output,
|
||||
&opal_maffinity_base_components_opened,
|
||||
(mca_base_component_t *) best_component);
|
||||
|
||||
/* Save the winner */
|
||||
|
||||
opal_maffinity_base_component = best_component;
|
||||
opal_maffinity_base_module = best_module;
|
||||
opal_output_verbose(10, opal_maffinity_base_output,
|
||||
"maffinity:select: component %s selected",
|
||||
best_component->maffinityc_version.mca_component_name);
|
||||
opal_maffinity_base_selected = true;
|
||||
opal_maffinity_base_module = best_module;
|
||||
opal_maffinity_base_selected = true;
|
||||
|
||||
/* Initialize the winner */
|
||||
|
||||
if (NULL != opal_maffinity_base_module) {
|
||||
if (OPAL_SUCCESS != opal_maffinity_base_module->maff_module_init()) {
|
||||
return OPAL_ERROR;
|
||||
exit_status = OPAL_ERROR;
|
||||
goto cleanup;
|
||||
}
|
||||
}
|
||||
|
||||
return OPAL_SUCCESS;
|
||||
cleanup:
|
||||
return exit_status;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* Copyright (c) 2004-2008 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
* Corporation. All rights reserved.
|
||||
* Copyright (c) 2004-2006 The University of Tennessee and The University
|
||||
@ -45,9 +45,13 @@ extern "C" {
|
||||
|
||||
/**
|
||||
* maffinity query API function
|
||||
*
|
||||
* Query function for maffinity components. Simply returns a priority
|
||||
* to rank it against other available maffinity components (assumedly,
|
||||
* only one component will be available per platform, but it's
|
||||
* possible that there could be more than one available).
|
||||
*/
|
||||
const opal_maffinity_base_module_1_0_0_t *
|
||||
opal_maffinity_first_use_component_query(int *query);
|
||||
int opal_maffinity_first_use_component_query(mca_base_module_t **module, int *priority);
|
||||
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
|
||||
* Copyright (c) 2004-2008 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
|
||||
@ -59,7 +59,8 @@ const opal_maffinity_base_component_1_0_0_t mca_maffinity_first_use_component =
|
||||
/* Component open and close functions */
|
||||
|
||||
first_use_open,
|
||||
NULL
|
||||
NULL,
|
||||
opal_maffinity_first_use_component_query
|
||||
},
|
||||
|
||||
/* Next the MCA v1.0.0 component meta data */
|
||||
@ -67,17 +68,13 @@ const opal_maffinity_base_component_1_0_0_t mca_maffinity_first_use_component =
|
||||
{
|
||||
/* The component is checkpoint ready */
|
||||
MCA_BASE_METADATA_PARAM_CHECKPOINT
|
||||
},
|
||||
|
||||
/* Query function */
|
||||
|
||||
opal_maffinity_first_use_component_query
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
static int first_use_open(void)
|
||||
{
|
||||
mca_base_param_reg_int(&mca_maffinity_first_use_component.maffinityc_version,
|
||||
mca_base_param_reg_int(&mca_maffinity_first_use_component.base_version,
|
||||
"priority",
|
||||
"Priority of the first_use maffinity component",
|
||||
false, false, 10, NULL);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* Copyright (c) 2004-2008 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
|
||||
@ -36,27 +36,24 @@ static int first_use_module_set(opal_maffinity_base_segment_t *segments,
|
||||
/*
|
||||
* First_Use maffinity module
|
||||
*/
|
||||
static const opal_maffinity_base_module_1_0_0_t module = {
|
||||
|
||||
static const opal_maffinity_base_module_1_0_0_t loc_module = {
|
||||
/* Initialization function */
|
||||
|
||||
first_use_module_init,
|
||||
|
||||
/* Module function pointers */
|
||||
|
||||
first_use_module_set
|
||||
};
|
||||
|
||||
|
||||
const opal_maffinity_base_module_1_0_0_t *
|
||||
opal_maffinity_first_use_component_query(int *query)
|
||||
int opal_maffinity_first_use_component_query(mca_base_module_t **module, int *priority)
|
||||
{
|
||||
int param;
|
||||
|
||||
param = mca_base_param_find("maffinity", "first_use", "priority");
|
||||
mca_base_param_lookup_int(param, query);
|
||||
mca_base_param_lookup_int(param, priority);
|
||||
|
||||
return &module;
|
||||
*module = (mca_base_module_t *)&loc_module;
|
||||
|
||||
return OPAL_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* Copyright (c) 2004-2008 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
|
||||
@ -45,9 +45,13 @@ extern "C" {
|
||||
|
||||
/**
|
||||
* maffinity query API function
|
||||
*
|
||||
* Query function for maffinity components. Simply returns a priority
|
||||
* to rank it against other available maffinity components (assumedly,
|
||||
* only one component will be available per platform, but it's
|
||||
* possible that there could be more than one available).
|
||||
*/
|
||||
const opal_maffinity_base_module_1_0_0_t *
|
||||
opal_maffinity_libnuma_component_query(int *query);
|
||||
int opal_maffinity_libnuma_component_query(mca_base_module_t **module, int *priority);
|
||||
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
|
||||
* Copyright (c) 2004-2008 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
|
||||
@ -59,7 +59,8 @@ const opal_maffinity_base_component_1_0_0_t mca_maffinity_libnuma_component = {
|
||||
/* Component open and close functions */
|
||||
|
||||
libnuma_open,
|
||||
NULL
|
||||
NULL,
|
||||
opal_maffinity_libnuma_component_query
|
||||
},
|
||||
|
||||
/* Next the MCA v1.0.0 component meta data */
|
||||
@ -67,17 +68,13 @@ const opal_maffinity_base_component_1_0_0_t mca_maffinity_libnuma_component = {
|
||||
{
|
||||
/* The component is checkpoint ready */
|
||||
MCA_BASE_METADATA_PARAM_CHECKPOINT
|
||||
},
|
||||
|
||||
/* Query function */
|
||||
|
||||
opal_maffinity_libnuma_component_query
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
static int libnuma_open(void)
|
||||
{
|
||||
mca_base_param_reg_int(&mca_maffinity_libnuma_component.maffinityc_version,
|
||||
mca_base_param_reg_int(&mca_maffinity_libnuma_component.base_version,
|
||||
"priority",
|
||||
"Priority of the libnuma maffinity component",
|
||||
false, false, 25, NULL);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* Copyright (c) 2004-2008 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
|
||||
@ -37,30 +37,27 @@ static int libnuma_module_set(opal_maffinity_base_segment_t *segments,
|
||||
/*
|
||||
* Libnuma maffinity module
|
||||
*/
|
||||
static const opal_maffinity_base_module_1_0_0_t module = {
|
||||
|
||||
static const opal_maffinity_base_module_1_0_0_t loc_module = {
|
||||
/* Initialization function */
|
||||
|
||||
libnuma_module_init,
|
||||
|
||||
/* Module function pointers */
|
||||
|
||||
libnuma_module_set
|
||||
};
|
||||
|
||||
|
||||
const opal_maffinity_base_module_1_0_0_t *
|
||||
opal_maffinity_libnuma_component_query(int *query)
|
||||
int opal_maffinity_libnuma_component_query(mca_base_module_t **module, int *priority)
|
||||
{
|
||||
int param;
|
||||
|
||||
if (-1 == numa_available()) {
|
||||
return NULL;
|
||||
return OPAL_ERROR;
|
||||
}
|
||||
param = mca_base_param_find("maffinity", "libnuma", "priority");
|
||||
mca_base_param_lookup_int(param, query);
|
||||
mca_base_param_lookup_int(param, priority);
|
||||
|
||||
return &module;
|
||||
*module = (mca_base_module_t *)&loc_module;
|
||||
|
||||
return OPAL_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* Copyright (c) 2004-2008 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
|
||||
@ -60,18 +60,6 @@
|
||||
#include "opal/mca/base/base.h"
|
||||
#include "opal/mca/maffinity/maffinity_types.h"
|
||||
|
||||
|
||||
/**
|
||||
* Query function for maffinity components. Simply returns a priority
|
||||
* to rank it against other available maffinity components (assumedly,
|
||||
* only one component will be available per platform, but it's
|
||||
* possible that there could be more than one available).
|
||||
*/
|
||||
typedef const struct opal_maffinity_base_module_1_0_0_t *
|
||||
(*opal_maffinity_base_component_query_1_0_0_fn_t)
|
||||
(int *priority);
|
||||
|
||||
|
||||
/**
|
||||
* Module initialization function. Should return OPAL_SUCCESS.
|
||||
*/
|
||||
@ -101,12 +89,9 @@ typedef int (*opal_maffinity_base_module_set_fn_t)
|
||||
*/
|
||||
struct opal_maffinity_base_component_1_0_0_t {
|
||||
/** MCA base component */
|
||||
mca_base_component_t maffinityc_version;
|
||||
mca_base_component_t base_version;
|
||||
/** MCA base data */
|
||||
mca_base_component_data_1_0_0_t maffinityc_data;
|
||||
|
||||
/** Component query function */
|
||||
opal_maffinity_base_component_query_1_0_0_fn_t maffinityc_query;
|
||||
mca_base_component_data_1_0_0_t base_data;
|
||||
};
|
||||
/**
|
||||
* Convenience typedef
|
||||
@ -118,7 +103,6 @@ typedef struct opal_maffinity_base_component_1_0_0_t opal_maffinity_base_compone
|
||||
* Structure for maffinity v1.0.0 modules
|
||||
*/
|
||||
struct opal_maffinity_base_module_1_0_0_t {
|
||||
|
||||
/** Module initialization function */
|
||||
opal_maffinity_base_module_init_1_0_0_fn_t maff_module_init;
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
|
||||
* Copyright (c) 2004-2008 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
|
||||
@ -29,6 +29,23 @@
|
||||
#include "opal/class/opal_list.h"
|
||||
#include "opal/util/cmd_line.h"
|
||||
|
||||
/**
|
||||
* Common type for all MCA modules.
|
||||
*
|
||||
* An instance of this type is always the first element in MCA
|
||||
* modules, allowing the module to be associated with a
|
||||
* particular version of a specific framework, and to publish its own
|
||||
* name and version.
|
||||
*/
|
||||
struct mca_base_module_t {
|
||||
int dummy_value;
|
||||
};
|
||||
/**
|
||||
* Convenience typedef.
|
||||
*/
|
||||
typedef struct mca_base_module_t mca_base_module_t;
|
||||
|
||||
|
||||
/**
|
||||
* MCA component open function.
|
||||
*
|
||||
@ -87,6 +104,23 @@ typedef int (*mca_base_open_component_fn_t)(void);
|
||||
*/
|
||||
typedef int (*mca_base_close_component_fn_t)(void);
|
||||
|
||||
/** MCA component query function
|
||||
*
|
||||
* @retval OPAL_SUCCESS The component successfully queried.
|
||||
*
|
||||
* @retval any_other_value Some error occurred, but is likely to be
|
||||
* ignored.
|
||||
*
|
||||
* @param module The module to be used if this component is selected.
|
||||
*
|
||||
* @param priority The priority of this component.
|
||||
*
|
||||
* This function is used by the mca_base_select function to find the highest
|
||||
* priority component to select. Frameworks are free to implement their own
|
||||
* query function, but must also implment their own select function as a result.
|
||||
*
|
||||
*/
|
||||
typedef int (*mca_base_query_component_fn_t)(mca_base_module_t **module, int *priority);
|
||||
|
||||
/**
|
||||
* Maximum length of MCA framework string names.
|
||||
@ -139,6 +173,8 @@ struct mca_base_component_t {
|
||||
/**< Method for opening this component. */
|
||||
mca_base_close_component_fn_t mca_close_component;
|
||||
/**< Method for closing this component. */
|
||||
mca_base_query_component_fn_t mca_query_component;
|
||||
/**< Method for querying this component. */
|
||||
};
|
||||
/**
|
||||
* Convenience typedef.
|
||||
|
@ -1,6 +1,8 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2007 High Performance Computing Center Stuttgart,
|
||||
* University of Stuttgart. All rights reserved.
|
||||
* Copyright (c) 2004-2008 The Trustees of Indiana University.
|
||||
* All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -29,116 +31,40 @@ const opal_memchecker_base_module_1_0_0_t *opal_memchecker_base_module = NULL;
|
||||
|
||||
int opal_memchecker_base_select(void)
|
||||
{
|
||||
|
||||
#if OMPI_WANT_MEMCHECKER
|
||||
int ret, exit_status = OPAL_SUCCESS;
|
||||
opal_memchecker_base_component_1_0_0_t *best_component = NULL;
|
||||
opal_memchecker_base_module_1_0_0_t *best_module = NULL;
|
||||
|
||||
int priority = 0, best_priority = 0;
|
||||
opal_list_item_t *item = NULL;
|
||||
mca_base_component_list_item_t *cli = NULL;
|
||||
opal_memchecker_base_component_1_0_0_t *component = NULL,
|
||||
*best_component = NULL;
|
||||
const opal_memchecker_base_module_1_0_0_t *module = NULL,
|
||||
*best_module = NULL;
|
||||
char *value;
|
||||
|
||||
|
||||
/* Register the framework MCA param and look it up */
|
||||
|
||||
mca_base_param_reg_string_name("memchecker", NULL,
|
||||
"Which memchecker component to use (empty = auto-select)",
|
||||
false, false,
|
||||
NULL, &value);
|
||||
if (NULL == value || 0 == strlen(value)) {
|
||||
opal_output_verbose(10, opal_memchecker_base_output,
|
||||
"memchecker:select: auto-selecting");
|
||||
} else {
|
||||
opal_output_verbose(10, opal_memchecker_base_output,
|
||||
"memchecker:select: looking for %s component",
|
||||
value);
|
||||
/*
|
||||
* Select the best component
|
||||
*/
|
||||
if( OPAL_SUCCESS != (ret = mca_base_select("memchecker", opal_memchecker_base_output,
|
||||
&opal_memchecker_base_components_opened,
|
||||
(mca_base_module_t **) &best_module,
|
||||
(mca_base_component_t **) &best_component) ) ) {
|
||||
/* This will only happen if no component was selected */
|
||||
exit_status = OPAL_ERR_NOT_FOUND;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
/* Traverse the list of available components; call their init
|
||||
functions. */
|
||||
|
||||
best_priority = -1;
|
||||
best_component = NULL;
|
||||
module = NULL;
|
||||
for (item = opal_list_get_first(&opal_memchecker_base_components_opened);
|
||||
opal_list_get_end(&opal_memchecker_base_components_opened) != item;
|
||||
item = opal_list_get_next(item) ) {
|
||||
cli = (mca_base_component_list_item_t *) item;
|
||||
component = (opal_memchecker_base_component_1_0_0_t *) cli->cli_component;
|
||||
|
||||
/* if there is an include list - item must be in the list to
|
||||
be included */
|
||||
|
||||
if (NULL != value && strlen(value) > 0 &&
|
||||
0 != strcmp(component->memchecker_version.mca_component_name,
|
||||
value)) {
|
||||
opal_output_verbose(10, opal_memchecker_base_output,
|
||||
"memchecker:select: skipping %s component",
|
||||
component->memchecker_version.mca_component_name);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (NULL == component->memchecker_query) {
|
||||
opal_output_verbose(10, opal_memchecker_base_output,
|
||||
"pafinity:select: no init function; ignoring component %s",
|
||||
component->memchecker_version.mca_component_name );
|
||||
continue;
|
||||
}
|
||||
opal_output_verbose(10, opal_memchecker_base_output,
|
||||
"memchecker:select: initializing component %s",
|
||||
component->memchecker_version.mca_component_name);
|
||||
module = component->memchecker_query(&priority);
|
||||
if (NULL == module) {
|
||||
opal_output_verbose(10, opal_memchecker_base_output,
|
||||
"memchecker:select: init returned failure for component %s",
|
||||
component->memchecker_version.mca_component_name );
|
||||
continue;
|
||||
}
|
||||
opal_output_verbose(10, opal_memchecker_base_output,
|
||||
"memchecker:select: init returned priority %d",
|
||||
priority );
|
||||
if (priority > best_priority) {
|
||||
best_priority = priority;
|
||||
best_component = component;
|
||||
best_module = module;
|
||||
}
|
||||
}
|
||||
|
||||
/* Finished querying all components. Check for the bozo case. */
|
||||
|
||||
if (NULL == best_component ) {
|
||||
return OPAL_ERR_NOT_FOUND;
|
||||
}
|
||||
|
||||
/* Now go through the opened list and close all the non-selected
|
||||
components */
|
||||
|
||||
mca_base_components_close(opal_memchecker_base_output,
|
||||
&opal_memchecker_base_components_opened,
|
||||
(mca_base_component_t *) best_component);
|
||||
|
||||
/* Save the winner */
|
||||
|
||||
opal_memchecker_base_component = best_component;
|
||||
opal_memchecker_base_module = best_module;
|
||||
opal_output_verbose(10, opal_memchecker_base_output,
|
||||
"memchecker:select: component %s selected",
|
||||
best_component->memchecker_version.mca_component_name);
|
||||
opal_memchecker_base_selected = true;
|
||||
opal_memchecker_base_module = best_module;
|
||||
opal_memchecker_base_selected = true;
|
||||
|
||||
/* Initialize the winner */
|
||||
|
||||
if (NULL != opal_memchecker_base_module) {
|
||||
if (OPAL_SUCCESS != opal_memchecker_base_module->init()) {
|
||||
return OPAL_ERROR;
|
||||
exit_status = OPAL_ERROR;
|
||||
goto cleanup;
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* OMPI_WANT_MEMCHECKER */
|
||||
|
||||
cleanup:
|
||||
return exit_status;
|
||||
#else
|
||||
return OPAL_SUCCESS;
|
||||
#endif /* OMPI_WANT_MEMCHECKER */
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,8 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2007 High Performance Computing Center Stuttgart,
|
||||
* University of Stuttgart. All rights reserved.
|
||||
* Copyright (c) 2004-2008 The Trustees of Indiana University.
|
||||
* All rights reserved.
|
||||
*
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
@ -37,16 +39,6 @@
|
||||
#include "opal/mca/mca.h"
|
||||
#include "opal/mca/base/base.h"
|
||||
|
||||
/**
|
||||
* Query function for memchecker components. Simply returns a priority
|
||||
* to rank it against other available memchecker components (assumedly,
|
||||
* only one component will be available per platform, but it's
|
||||
* possible that there could be more than one available).
|
||||
*/
|
||||
typedef const struct opal_memchecker_base_module_1_0_0_t *
|
||||
(*opal_memchecker_base_component_query_1_0_0_fn_t)
|
||||
(int *priority);
|
||||
|
||||
/**
|
||||
* Module initialization function. Should return OPAL_SUCCESS.
|
||||
*/
|
||||
@ -121,24 +113,21 @@ typedef int (*opal_memchecker_base_module_set_vbits_fn_t)(void * p, char * vbits
|
||||
*/
|
||||
struct opal_memchecker_base_component_1_0_0_t {
|
||||
/** MCA base component */
|
||||
mca_base_component_t memchecker_version;
|
||||
mca_base_component_t base_version;
|
||||
/** MCA base data */
|
||||
mca_base_component_data_1_0_0_t memchecker_data;
|
||||
|
||||
/** Component query function */
|
||||
opal_memchecker_base_component_query_1_0_0_fn_t memchecker_query;
|
||||
mca_base_component_data_1_0_0_t base_data;
|
||||
};
|
||||
|
||||
/**
|
||||
* Convenience typedef
|
||||
*/
|
||||
typedef struct opal_memchecker_base_component_1_0_0_t opal_memchecker_base_component_1_0_0_t;
|
||||
typedef struct opal_memchecker_base_component_1_0_0_t opal_memchecker_base_component_t;
|
||||
|
||||
/**
|
||||
* Structure for memchecker v1.0.0 modules
|
||||
*/
|
||||
struct opal_memchecker_base_module_1_0_0_t {
|
||||
|
||||
/** Module initialization function */
|
||||
opal_memchecker_base_module_init_1_0_0_fn_t init;
|
||||
|
||||
@ -183,6 +172,7 @@ struct opal_memchecker_base_module_1_0_0_t {
|
||||
* Convenience typedef
|
||||
*/
|
||||
typedef struct opal_memchecker_base_module_1_0_0_t opal_memchecker_base_module_1_0_0_t;
|
||||
typedef struct opal_memchecker_base_module_1_0_0_t opal_memchecker_base_module_t;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -1,6 +1,8 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2007 High Performance Computing Center Stuttgart,
|
||||
* University of Stuttgart. All rights reserved.
|
||||
* Copyright (c) 2004-2008 The Trustees of Indiana University.
|
||||
* All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -34,9 +36,13 @@ OPAL_DECLSPEC extern const opal_memchecker_base_component_1_0_0_t
|
||||
|
||||
/**
|
||||
* memchecker query API function
|
||||
*
|
||||
* Query function for memchecker components. Simply returns a priority
|
||||
* to rank it against other available memchecker components (assumedly,
|
||||
* only one component will be available per platform, but it's
|
||||
* possible that there could be more than one available).
|
||||
*/
|
||||
const opal_memchecker_base_module_1_0_0_t *
|
||||
opal_memchecker_valgrind_component_query(int *query);
|
||||
int opal_memchecker_valgrind_component_query(mca_base_module_t **module, int *priority);
|
||||
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
}
|
||||
|
@ -1,6 +1,8 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2007 High Performance Computing Center Stuttgart,
|
||||
* University of Stuttgart. All rights reserved.
|
||||
* Copyright (c) 2004-2008 The Trustees of Indiana University.
|
||||
* All rights reserved.
|
||||
*
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
@ -60,16 +62,15 @@ const opal_memchecker_base_component_1_0_0_t mca_memchecker_valgrind_component =
|
||||
/* Component open and close functions */
|
||||
|
||||
valgrind_open,
|
||||
valgrind_close
|
||||
},
|
||||
valgrind_close,
|
||||
opal_memchecker_valgrind_component_query
|
||||
|
||||
},
|
||||
/* Next the MCA v1.0.0 component meta data */
|
||||
{
|
||||
false /* Valgrind does not offer functionality to safe the state */
|
||||
},
|
||||
|
||||
/* Query function */
|
||||
opal_memchecker_valgrind_component_query
|
||||
/* Valgrind does not offer functionality to save the state */
|
||||
MCA_BASE_METADATA_PARAM_CHECKPOINT
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
@ -1,6 +1,8 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2007 High Performance Computing Center Stuttgart,
|
||||
* University of Stuttgart. All rights reserved.
|
||||
* Copyright (c) 2004-2008 The Trustees of Indiana University.
|
||||
* All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -49,10 +51,8 @@ static int valgrind_module_set_vbits(void * p, char * vbits, size_t len);
|
||||
/*
|
||||
* Valgrind memchecker module
|
||||
*/
|
||||
static const opal_memchecker_base_module_1_0_0_t module = {
|
||||
|
||||
static const opal_memchecker_base_module_1_0_0_t loc_module = {
|
||||
/* Initialization function */
|
||||
|
||||
valgrind_module_init,
|
||||
|
||||
/* Module function pointers */
|
||||
@ -69,15 +69,16 @@ static const opal_memchecker_base_module_1_0_0_t module = {
|
||||
};
|
||||
|
||||
|
||||
const opal_memchecker_base_module_1_0_0_t *
|
||||
opal_memchecker_valgrind_component_query(int *query)
|
||||
int opal_memchecker_valgrind_component_query(mca_base_module_t **module, int *priority)
|
||||
{
|
||||
int param;
|
||||
|
||||
param = mca_base_param_find("memchecker", "valgrind", "priority");
|
||||
mca_base_param_lookup_int(param, query);
|
||||
mca_base_param_lookup_int(param, priority);
|
||||
|
||||
return &module;
|
||||
*module = (mca_base_module_t *)&loc_module;
|
||||
|
||||
return OPAL_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* Copyright (c) 2004-2008 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
* Corporation. All rights reserved.
|
||||
* Copyright (c) 2004-2006 The University of Tennessee and The University
|
||||
@ -38,110 +38,35 @@ const opal_paffinity_base_module_1_1_0_t *opal_paffinity_base_module = NULL;
|
||||
|
||||
int opal_paffinity_base_select(void)
|
||||
{
|
||||
int priority = 0, best_priority = 0;
|
||||
opal_list_item_t *item = NULL;
|
||||
mca_base_component_list_item_t *cli = NULL;
|
||||
opal_paffinity_base_component_1_1_0_t *component = NULL,
|
||||
*best_component = NULL;
|
||||
const opal_paffinity_base_module_1_1_0_t *module = NULL,
|
||||
*best_module = NULL;
|
||||
char *value;
|
||||
int ret, exit_status = OPAL_SUCCESS;
|
||||
opal_paffinity_base_component_1_1_0_t *best_component = NULL;
|
||||
opal_paffinity_base_module_1_1_0_t *best_module = NULL;
|
||||
|
||||
/* Register the framework MCA param and look it up */
|
||||
|
||||
mca_base_param_reg_string_name("paffinity", NULL,
|
||||
"Which paffinity component to use (empty = auto-select)",
|
||||
false, false,
|
||||
NULL, &value);
|
||||
if (NULL == value || 0 == strlen(value)) {
|
||||
opal_output_verbose(10, opal_paffinity_base_output,
|
||||
"paffinity:select: auto-selecting");
|
||||
} else {
|
||||
opal_output_verbose(10, opal_paffinity_base_output,
|
||||
"paffinity:select: looking for %s component",
|
||||
value);
|
||||
/*
|
||||
* Select the best component
|
||||
*/
|
||||
if( OPAL_SUCCESS != (ret = mca_base_select("paffinity", opal_paffinity_base_output,
|
||||
&opal_paffinity_base_components_opened,
|
||||
(mca_base_module_t **) &best_module,
|
||||
(mca_base_component_t **) &best_component) ) ) {
|
||||
/* This will only happen if no component was selected */
|
||||
exit_status = OPAL_ERR_NOT_FOUND;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
/* Traverse the list of available components; call their init
|
||||
functions. */
|
||||
|
||||
best_priority = -1;
|
||||
best_component = NULL;
|
||||
module = NULL;
|
||||
for (item = opal_list_get_first(&opal_paffinity_base_components_opened);
|
||||
opal_list_get_end(&opal_paffinity_base_components_opened) != item;
|
||||
item = opal_list_get_next(item) ) {
|
||||
cli = (mca_base_component_list_item_t *) item;
|
||||
component = (opal_paffinity_base_component_1_1_0_t *) cli->cli_component;
|
||||
|
||||
/* if there is an include list - item must be in the list to
|
||||
be included */
|
||||
|
||||
if (NULL != value && strlen(value) > 0 &&
|
||||
0 != strcmp(component->paffinityc_version.mca_component_name,
|
||||
value)) {
|
||||
opal_output_verbose(10, opal_paffinity_base_output,
|
||||
"paffinity:select: skipping %s component",
|
||||
component->paffinityc_version.mca_component_name);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (NULL == component->paffinityc_query) {
|
||||
opal_output_verbose(10, opal_paffinity_base_output,
|
||||
"pafinity:select: no init function; ignoring component %s",
|
||||
component->paffinityc_version.mca_component_name );
|
||||
continue;
|
||||
}
|
||||
opal_output_verbose(10, opal_paffinity_base_output,
|
||||
"paffinity:select: initializing component %s",
|
||||
component->paffinityc_version.mca_component_name);
|
||||
module = component->paffinityc_query(&priority);
|
||||
if (NULL == module) {
|
||||
opal_output_verbose(10, opal_paffinity_base_output,
|
||||
"paffinity:select: init returned failure for component %s",
|
||||
component->paffinityc_version.mca_component_name );
|
||||
continue;
|
||||
}
|
||||
opal_output_verbose(10, opal_paffinity_base_output,
|
||||
"paffinity:select: init returned priority %d",
|
||||
priority );
|
||||
if (priority > best_priority) {
|
||||
best_priority = priority;
|
||||
best_component = component;
|
||||
best_module = module;
|
||||
}
|
||||
}
|
||||
|
||||
/* Finished querying all components. Check for the bozo case. */
|
||||
|
||||
if (NULL == best_component ) {
|
||||
return OPAL_ERR_NOT_FOUND;
|
||||
}
|
||||
|
||||
/* Now go through the opened list and close all the non-selected
|
||||
components */
|
||||
|
||||
mca_base_components_close(opal_paffinity_base_output,
|
||||
&opal_paffinity_base_components_opened,
|
||||
(mca_base_component_t *) best_component);
|
||||
|
||||
/* Save the winner */
|
||||
|
||||
opal_paffinity_base_component = best_component;
|
||||
opal_paffinity_base_module = best_module;
|
||||
opal_output_verbose(10, opal_paffinity_base_output,
|
||||
"paffinity:select: component %s selected",
|
||||
best_component->paffinityc_version.mca_component_name);
|
||||
opal_paffinity_base_selected = true;
|
||||
opal_paffinity_base_module = best_module;
|
||||
opal_paffinity_base_selected = true;
|
||||
|
||||
/* Initialize the winner */
|
||||
|
||||
if (NULL != opal_paffinity_base_module) {
|
||||
if (OPAL_SUCCESS != opal_paffinity_base_module->paff_module_init()) {
|
||||
return OPAL_ERROR;
|
||||
exit_status = OPAL_ERROR;
|
||||
goto cleanup;
|
||||
}
|
||||
}
|
||||
|
||||
return OPAL_SUCCESS;
|
||||
cleanup:
|
||||
return exit_status;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* Copyright (c) 2004-2008 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
|
||||
@ -59,9 +59,13 @@ extern "C" {
|
||||
|
||||
/**
|
||||
* paffinity query API function
|
||||
*
|
||||
* Query function for paffinity components. Simply returns a priority
|
||||
* to rank it against other available paffinity components (assumedly,
|
||||
* only one component will be available per platform, but it's
|
||||
* possible that there could be more than one available).
|
||||
*/
|
||||
const opal_paffinity_base_module_1_1_0_t *
|
||||
opal_paffinity_linux_component_query(int *query);
|
||||
int opal_paffinity_linux_component_query(mca_base_module_t **module, int *priority);
|
||||
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
|
||||
* Copyright (c) 2004-2008 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
|
||||
@ -66,23 +66,19 @@ const opal_paffinity_base_component_1_1_0_t mca_paffinity_linux_component = {
|
||||
/* Component open and close functions */
|
||||
|
||||
linux_open,
|
||||
NULL
|
||||
NULL,
|
||||
opal_paffinity_linux_component_query
|
||||
},
|
||||
{
|
||||
|
||||
/* The component is checkpoint ready */
|
||||
MCA_BASE_METADATA_PARAM_CHECKPOINT
|
||||
},
|
||||
|
||||
/* Query function */
|
||||
|
||||
opal_paffinity_linux_component_query
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
static int linux_open(void)
|
||||
{
|
||||
mca_base_param_reg_int(&mca_paffinity_linux_component.paffinityc_version,
|
||||
mca_base_param_reg_int(&mca_paffinity_linux_component.base_version,
|
||||
"priority",
|
||||
"Priority of the linux paffinity component",
|
||||
false, false, 10, NULL);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* Copyright (c) 2004-2008 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
|
||||
@ -52,14 +52,11 @@ static int linux_module_get_core_info(int socket, int *num_cores, int *max_core_
|
||||
/*
|
||||
* Linux paffinity module
|
||||
*/
|
||||
static const opal_paffinity_base_module_1_1_0_t module = {
|
||||
|
||||
static const opal_paffinity_base_module_1_1_0_t loc_module = {
|
||||
/* Initialization function */
|
||||
|
||||
linux_module_init,
|
||||
|
||||
/* Module function pointers */
|
||||
|
||||
linux_module_set,
|
||||
linux_module_get,
|
||||
linux_module_map_to_processor_id,
|
||||
@ -70,16 +67,16 @@ static const opal_paffinity_base_module_1_1_0_t module = {
|
||||
NULL
|
||||
};
|
||||
|
||||
|
||||
const opal_paffinity_base_module_1_1_0_t *
|
||||
opal_paffinity_linux_component_query(int *query)
|
||||
int opal_paffinity_linux_component_query(mca_base_module_t **module, int *priority)
|
||||
{
|
||||
int param;
|
||||
|
||||
param = mca_base_param_find("paffinity", "linux", "priority");
|
||||
mca_base_param_lookup_int(param, query);
|
||||
mca_base_param_lookup_int(param, priority);
|
||||
|
||||
return &module;
|
||||
*module = (mca_base_module_t *)&loc_module;
|
||||
|
||||
return OPAL_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* Copyright (c) 2004-2008 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
|
||||
@ -138,17 +138,6 @@ typedef struct opal_paffinity_base_cpu_set_t {
|
||||
|
||||
/***************************************************************************/
|
||||
|
||||
/**
|
||||
* Query function for paffinity components. Simply returns a priority
|
||||
* to rank it against other available paffinity components (assumedly,
|
||||
* only one component will be available per platform, but it's
|
||||
* possible that there could be more than one available).
|
||||
*/
|
||||
typedef const struct opal_paffinity_base_module_1_1_0_t *
|
||||
(*opal_paffinity_base_component_query_1_1_0_fn_t)
|
||||
(int *priority);
|
||||
|
||||
|
||||
/**
|
||||
* Module initialization function. Should return OPAL_SUCCESS.
|
||||
*/
|
||||
@ -228,24 +217,21 @@ typedef int (*opal_paffinity_base_module_finalize_fn_t)(void);
|
||||
*/
|
||||
struct opal_paffinity_base_component_1_1_0_t {
|
||||
/** MCA base component */
|
||||
mca_base_component_t paffinityc_version;
|
||||
mca_base_component_t base_version;
|
||||
/** MCA base data */
|
||||
mca_base_component_data_1_0_0_t paffinityc_data;
|
||||
|
||||
/** Component query function */
|
||||
opal_paffinity_base_component_query_1_1_0_fn_t paffinityc_query;
|
||||
mca_base_component_data_1_0_0_t base_data;
|
||||
};
|
||||
/**
|
||||
* Convenience typedef
|
||||
*/
|
||||
typedef struct opal_paffinity_base_component_1_1_0_t opal_paffinity_base_component_1_1_0_t;
|
||||
typedef struct opal_paffinity_base_component_1_1_0_t opal_paffinity_base_component_t;
|
||||
|
||||
|
||||
/**
|
||||
* Structure for paffinity v1.0.0 modules
|
||||
*/
|
||||
struct opal_paffinity_base_module_1_1_0_t {
|
||||
|
||||
/** Module initialization function */
|
||||
opal_paffinity_base_module_init_1_1_0_fn_t paff_module_init;
|
||||
|
||||
@ -277,6 +263,7 @@ struct opal_paffinity_base_module_1_1_0_t {
|
||||
* Convenience typedef
|
||||
*/
|
||||
typedef struct opal_paffinity_base_module_1_1_0_t opal_paffinity_base_module_1_1_0_t;
|
||||
typedef struct opal_paffinity_base_module_1_1_0_t opal_paffinity_base_module_t;
|
||||
|
||||
|
||||
/*
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* Copyright (c) 2004-2008 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
|
||||
@ -40,9 +40,7 @@ extern "C" {
|
||||
/*
|
||||
* paffinity API functions
|
||||
*/
|
||||
|
||||
const opal_paffinity_base_module_1_1_0_t *
|
||||
opal_paffinity_solaris_component_query(int *query);
|
||||
int opal_paffinity_solaris_component_query(mca_base_module_t **module, int *priority);
|
||||
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
|
||||
* Copyright (c) 2004-2008 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
|
||||
@ -66,25 +66,20 @@ const opal_paffinity_base_component_1_1_0_t mca_paffinity_solaris_component = {
|
||||
/* Component open and close functions */
|
||||
|
||||
solaris_open,
|
||||
NULL
|
||||
NULL,
|
||||
opal_paffinity_solaris_component_query
|
||||
},
|
||||
|
||||
/* Next the MCA v1.0.0 component meta data */
|
||||
|
||||
{
|
||||
/* The component is checkpoint ready */
|
||||
MCA_BASE_METADATA_PARAM_CHECKPOINT
|
||||
},
|
||||
|
||||
/* Query function */
|
||||
|
||||
opal_paffinity_solaris_component_query
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
static int solaris_open(void)
|
||||
{
|
||||
mca_base_param_reg_int(&mca_paffinity_solaris_component.paffinityc_version,
|
||||
mca_base_param_reg_int(&mca_paffinity_solaris_component.base_version,
|
||||
"priority",
|
||||
"Priority of the solaris paffinity component",
|
||||
false, false, 10, NULL);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* Copyright (c) 2004-2008 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
|
||||
@ -52,14 +52,11 @@ static int solaris_module_get_core_info(int socket, int *num_cores, int *max_cor
|
||||
/*
|
||||
* Solaris paffinity module
|
||||
*/
|
||||
static const opal_paffinity_base_module_1_1_0_t module = {
|
||||
|
||||
static const opal_paffinity_base_module_1_1_0_t loc_module = {
|
||||
/* Initialization function */
|
||||
|
||||
solaris_module_init,
|
||||
|
||||
/* Module function pointers */
|
||||
|
||||
solaris_module_set,
|
||||
solaris_module_get,
|
||||
solaris_module_map_to_processor_id,
|
||||
@ -70,16 +67,16 @@ static const opal_paffinity_base_module_1_1_0_t module = {
|
||||
solaris_module_finalize
|
||||
};
|
||||
|
||||
|
||||
const opal_paffinity_base_module_1_1_0_t *
|
||||
opal_paffinity_solaris_component_query(int *query)
|
||||
int opal_paffinity_solaris_component_query(mca_base_module_t **module, int *priority)
|
||||
{
|
||||
int param;
|
||||
|
||||
param = mca_base_param_find("paffinity", "solaris", "priority");
|
||||
mca_base_param_lookup_int(param, query);
|
||||
mca_base_param_lookup_int(param, priority);
|
||||
|
||||
return &module;
|
||||
*module = (mca_base_module_t *)&loc_module;
|
||||
|
||||
return OPAL_SUCCESS;
|
||||
}
|
||||
|
||||
/* do nothing here. both mpirun and processes would run init(), but
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* Copyright (c) 2004-2008 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
* Corporation. All rights reserved.
|
||||
* Copyright (c) 2004-2006 The University of Tennessee and The University
|
||||
@ -59,8 +59,7 @@ extern "C" {
|
||||
/**
|
||||
* paffinity query API function
|
||||
*/
|
||||
const opal_paffinity_base_module_1_1_0_t *
|
||||
opal_paffinity_windows_component_query(int *query);
|
||||
int opal_paffinity_windows_component_query(mca_base_module_t **module, int *priority);
|
||||
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
|
||||
* Copyright (c) 2004-2008 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
|
||||
@ -65,25 +65,20 @@ const opal_paffinity_base_component_1_1_0_t mca_paffinity_windows_component = {
|
||||
/* Component open and close functions */
|
||||
|
||||
windows_open,
|
||||
NULL
|
||||
NULL,
|
||||
opal_paffinity_windows_component_query
|
||||
},
|
||||
|
||||
/* Next the MCA v1.0.0 component meta data */
|
||||
|
||||
{
|
||||
/* The component is checkpoint ready */
|
||||
MCA_BASE_METADATA_PARAM_CHECKPOINT
|
||||
},
|
||||
|
||||
/* Query function */
|
||||
|
||||
opal_paffinity_windows_component_query
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
static int windows_open(void)
|
||||
{
|
||||
mca_base_param_reg_int(&mca_paffinity_windows_component.paffinityc_version,
|
||||
mca_base_param_reg_int(&mca_paffinity_windows_component.base_version,
|
||||
"priority",
|
||||
"Priority of the windows paffinity component",
|
||||
false, false, 10, NULL);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* Copyright (c) 2004-2008 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
* Corporation. All rights reserved.
|
||||
* Copyright (c) 2004-2006 The University of Tennessee and The University
|
||||
@ -43,10 +43,8 @@ static SYSTEM_INFO sys_info;
|
||||
/*
|
||||
* Linux paffinity module
|
||||
*/
|
||||
static const opal_paffinity_base_module_1_1_0_t module = {
|
||||
|
||||
static const opal_paffinity_base_module_1_1_0_t loc_module = {
|
||||
/* Initialization function */
|
||||
|
||||
windows_module_init,
|
||||
|
||||
/* Module function pointers */
|
||||
@ -60,16 +58,16 @@ static const opal_paffinity_base_module_1_1_0_t module = {
|
||||
windows_module_finalize
|
||||
};
|
||||
|
||||
|
||||
const opal_paffinity_base_module_1_1_0_t *
|
||||
opal_paffinity_windows_component_query(int *query)
|
||||
int opal_paffinity_windows_component_query(mca_base_module_t **module, int *priority)
|
||||
{
|
||||
int param;
|
||||
|
||||
param = mca_base_param_find("paffinity", "windows", "priority");
|
||||
mca_base_param_lookup_int(param, query);
|
||||
mca_base_param_lookup_int(param, priority);
|
||||
|
||||
return &module;
|
||||
*module = (mca_base_module_t *)&loc_module;
|
||||
|
||||
return OPAL_SUCCESS;
|
||||
}
|
||||
|
||||
static int windows_module_finalize(void)
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
|
||||
* Copyright (c) 2004-2008 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
|
||||
@ -224,12 +224,12 @@ main(int argc, char *argv[])
|
||||
* Make sure we have selected the proper component
|
||||
*/
|
||||
if(0 != strncmp(expected_crs_comp,
|
||||
opal_crs_base_selected_component.crs_version.mca_component_name,
|
||||
opal_crs_base_selected_component.base_version.mca_component_name,
|
||||
strlen(expected_crs_comp)) ) {
|
||||
opal_show_help("help-opal-restart.txt", "comp_select_mismatch",
|
||||
true,
|
||||
expected_crs_comp,
|
||||
opal_crs_base_selected_component.crs_version.mca_component_name,
|
||||
opal_crs_base_selected_component.base_version.mca_component_name,
|
||||
ret);
|
||||
exit_status = ret;
|
||||
goto cleanup;
|
||||
@ -281,7 +281,7 @@ main(int argc, char *argv[])
|
||||
if(!opal_restart_globals.forked) {
|
||||
opal_show_help("help-opal-restart.txt", "failed-to-exec", true,
|
||||
expected_crs_comp,
|
||||
opal_crs_base_selected_component.crs_version.mca_component_name);
|
||||
opal_crs_base_selected_component.base_version.mca_component_name);
|
||||
exit_status = ret;
|
||||
goto cleanup;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* Copyright (c) 2004-2008 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
|
||||
@ -34,12 +34,6 @@ int orte_errmgr_base_close(void)
|
||||
{
|
||||
OPAL_TRACE(5);
|
||||
|
||||
/* If we have a selected component and module, then finalize it */
|
||||
|
||||
if (orte_errmgr_base_selected) {
|
||||
orte_errmgr_base_selected_component.errmgr_finalize();
|
||||
}
|
||||
|
||||
/* Close all remaining available components (may be one if this is a
|
||||
OMPI RTE program, or [possibly] multiple if this is ompi_info) */
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* Copyright (c) 2004-2008 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
|
||||
@ -23,6 +23,7 @@
|
||||
#include "opal/mca/base/base.h"
|
||||
|
||||
#include "orte/mca/errmgr/base/base.h"
|
||||
#include "orte/mca/errmgr/base/errmgr_private.h"
|
||||
|
||||
|
||||
/**
|
||||
@ -31,71 +32,27 @@
|
||||
*/
|
||||
int orte_errmgr_base_select(void)
|
||||
{
|
||||
opal_list_item_t *item;
|
||||
mca_base_component_list_item_t *cli;
|
||||
mca_errmgr_base_component_t *component, *best_component = NULL;
|
||||
orte_errmgr_base_module_t *module, *best_module = NULL;
|
||||
int priority, best_priority = -1;
|
||||
int ret, exit_status = OPAL_SUCCESS;
|
||||
mca_errmgr_base_component_t *best_component = NULL;
|
||||
orte_errmgr_base_module_t *best_module = NULL;
|
||||
|
||||
/* Iterate through all the available components */
|
||||
|
||||
for (item = opal_list_get_first(&orte_errmgr_base_components_available);
|
||||
item != opal_list_get_end(&orte_errmgr_base_components_available);
|
||||
item = opal_list_get_next(item)) {
|
||||
cli = (mca_base_component_list_item_t *) item;
|
||||
component = (mca_errmgr_base_component_t *) cli->cli_component;
|
||||
|
||||
/* Call the component's init function and see if it wants to be
|
||||
selected */
|
||||
|
||||
module = component->errmgr_init(&priority);
|
||||
|
||||
/* If we got a non-NULL module back, then the component wants to
|
||||
be selected. So save its multi/hidden values and save the
|
||||
module with the highest priority */
|
||||
|
||||
if (NULL != module) {
|
||||
/* If this is the best one, save it */
|
||||
|
||||
if (priority > best_priority) {
|
||||
|
||||
/* If there was a previous best one, finalize */
|
||||
|
||||
if (NULL != best_component) {
|
||||
best_component->errmgr_finalize();
|
||||
}
|
||||
|
||||
/* Save the new best one */
|
||||
|
||||
best_module = module;
|
||||
best_component = component;
|
||||
|
||||
/* update the best priority */
|
||||
best_priority = priority;
|
||||
}
|
||||
|
||||
/* If it's not the best one, finalize it */
|
||||
|
||||
else {
|
||||
component->errmgr_finalize();
|
||||
}
|
||||
/*
|
||||
* Select the best component
|
||||
*/
|
||||
if( OPAL_SUCCESS != (ret = mca_base_select("errmgr", orte_errmgr_base_output,
|
||||
&orte_errmgr_base_components_available,
|
||||
(mca_base_module_t **) &best_module,
|
||||
(mca_base_component_t **) &best_component) ) ) {
|
||||
/* This will only happen if no component was selected */
|
||||
exit_status = ORTE_ERR_NOT_FOUND;
|
||||
goto cleanup;
|
||||
}
|
||||
}
|
||||
|
||||
/* If we didn't find one to select, then we have a big problem */
|
||||
/* Save the winner */
|
||||
orte_errmgr = *best_module;
|
||||
orte_errmgr_base_selected_component = *best_component;
|
||||
orte_errmgr_base_selected = true;
|
||||
|
||||
if (NULL == best_component) {
|
||||
return ORTE_ERROR;
|
||||
}
|
||||
|
||||
/* We have happiness -- save the component and module for later
|
||||
usage */
|
||||
|
||||
orte_errmgr = *best_module;
|
||||
orte_errmgr_base_selected_component = *best_component;
|
||||
orte_errmgr_base_selected = true;
|
||||
|
||||
/* all done */
|
||||
|
||||
return ORTE_SUCCESS;
|
||||
cleanup:
|
||||
return exit_status;
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* -*- C -*-
|
||||
*
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* Copyright (c) 2004-2008 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
|
||||
@ -33,18 +33,11 @@ BEGIN_C_DECLS
|
||||
/*
|
||||
* Module open / close
|
||||
*/
|
||||
int orte_errmgr_default_open(void);
|
||||
int orte_errmgr_default_close(void);
|
||||
int orte_errmgr_default_component_open(void);
|
||||
int orte_errmgr_default_component_close(void);
|
||||
int orte_errmgr_default_component_query(mca_base_module_t **module, int *priority);
|
||||
|
||||
|
||||
/*
|
||||
* Startup / Shutdown
|
||||
*/
|
||||
orte_errmgr_base_module_t*
|
||||
orte_errmgr_default_component_init(int *priority);
|
||||
|
||||
int orte_errmgr_default_finalize(void);
|
||||
|
||||
/*
|
||||
* Component API functions
|
||||
*/
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* -*- C -*-
|
||||
*
|
||||
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
|
||||
* Copyright (c) 2004-2008 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
|
||||
@ -52,19 +52,18 @@ mca_errmgr_base_component_t mca_errmgr_default_component = {
|
||||
{
|
||||
ORTE_ERRMGR_BASE_VERSION_1_3_0,
|
||||
|
||||
"default", /* MCA module name */
|
||||
ORTE_MAJOR_VERSION, /* MCA module major version */
|
||||
ORTE_MINOR_VERSION, /* MCA module minor version */
|
||||
ORTE_RELEASE_VERSION, /* MCA module release version */
|
||||
orte_errmgr_default_open, /* module open */
|
||||
orte_errmgr_default_close /* module close */
|
||||
"default", /* MCA component name */
|
||||
ORTE_MAJOR_VERSION, /* MCA component major version */
|
||||
ORTE_MINOR_VERSION, /* MCA component minor version */
|
||||
ORTE_RELEASE_VERSION, /* MCA component release version */
|
||||
orte_errmgr_default_component_open, /* component open */
|
||||
orte_errmgr_default_component_close, /* component close */
|
||||
orte_errmgr_default_component_query /* component query */
|
||||
},
|
||||
{
|
||||
/* The component is checkpoint ready */
|
||||
MCA_BASE_METADATA_PARAM_CHECKPOINT
|
||||
},
|
||||
orte_errmgr_default_component_init, /* module init */
|
||||
orte_errmgr_default_finalize /* module shutdown */
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
@ -81,7 +80,7 @@ orte_errmgr_base_module_t orte_errmgr_default = {
|
||||
/*
|
||||
* Open the component
|
||||
*/
|
||||
int orte_errmgr_default_open(void)
|
||||
int orte_errmgr_default_component_open(void)
|
||||
{
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
@ -89,33 +88,24 @@ int orte_errmgr_default_open(void)
|
||||
/*
|
||||
* Close the component
|
||||
*/
|
||||
int orte_errmgr_default_close(void)
|
||||
int orte_errmgr_default_component_close(void)
|
||||
{
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
||||
orte_errmgr_base_module_t*
|
||||
orte_errmgr_default_component_init(int *priority)
|
||||
int orte_errmgr_default_component_query(mca_base_module_t **module, int *priority)
|
||||
{
|
||||
/* If we are not an HNP, then don't pick us! */
|
||||
if (!orte_process_info.hnp) {
|
||||
/* don't take me! */
|
||||
return NULL;
|
||||
*module = NULL;
|
||||
return ORTE_ERROR;
|
||||
}
|
||||
|
||||
/* Return a module (choose an arbitrary, positive priority --
|
||||
it's only relevant compared to other components). */
|
||||
|
||||
*priority = 10;
|
||||
|
||||
return &orte_errmgr_default;
|
||||
}
|
||||
|
||||
/*
|
||||
* finalize routine
|
||||
*/
|
||||
int orte_errmgr_default_finalize(void)
|
||||
{
|
||||
/* All done */
|
||||
*module = (mca_base_module_t *)&orte_errmgr_default;
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* Copyright (c) 2004-2008 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
|
||||
@ -149,22 +149,11 @@ typedef orte_errmgr_base_module_1_3_0_t orte_errmgr_base_module_t;
|
||||
|
||||
/*
|
||||
* ERRMGR Component
|
||||
*/
|
||||
|
||||
typedef orte_errmgr_base_module_t* (*orte_errmgr_base_component_init_fn_t)(int *priority);
|
||||
|
||||
typedef int (*orte_errmgr_base_component_finalize_fn_t)(void);
|
||||
|
||||
/*
|
||||
* the standard component data structure
|
||||
*/
|
||||
|
||||
struct mca_errmgr_base_component_1_3_0_t {
|
||||
mca_base_component_t errmgr_version;
|
||||
mca_base_component_data_1_0_0_t errmgr_data;
|
||||
|
||||
orte_errmgr_base_component_init_fn_t errmgr_init;
|
||||
orte_errmgr_base_component_finalize_fn_t errmgr_finalize;
|
||||
mca_base_component_t base_version;
|
||||
mca_base_component_data_1_0_0_t base_data;
|
||||
};
|
||||
typedef struct mca_errmgr_base_component_1_3_0_t mca_errmgr_base_component_1_3_0_t;
|
||||
typedef mca_errmgr_base_component_1_3_0_t mca_errmgr_base_component_t;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* Copyright (c) 2004-2008 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
|
||||
@ -26,7 +26,7 @@ BEGIN_C_DECLS
|
||||
*/
|
||||
int orte_ess_alps_component_open(void);
|
||||
int orte_ess_alps_component_close(void);
|
||||
orte_ess_base_module_t* orte_ess_alps_component_init(int *priority);
|
||||
int orte_ess_alps_component_query(mca_base_module_t **module, int *priority);
|
||||
|
||||
|
||||
END_C_DECLS
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
|
||||
* Copyright (c) 2004-2008 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
|
||||
@ -52,17 +52,14 @@ orte_ess_base_component_t mca_ess_alps_component = {
|
||||
|
||||
/* Component open and close functions */
|
||||
orte_ess_alps_component_open,
|
||||
orte_ess_alps_component_close
|
||||
orte_ess_alps_component_close,
|
||||
orte_ess_alps_component_query
|
||||
},
|
||||
|
||||
/* Next the MCA v1.0.0 component meta data */
|
||||
{
|
||||
/* The component is not checkpoint ready */
|
||||
MCA_BASE_METADATA_PARAM_NONE
|
||||
},
|
||||
|
||||
/* Initialization / querying functions */
|
||||
orte_ess_alps_component_init
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -73,11 +70,11 @@ orte_ess_alps_component_open(void)
|
||||
}
|
||||
|
||||
|
||||
orte_ess_base_module_t *
|
||||
orte_ess_alps_component_init(int *priority)
|
||||
int orte_ess_alps_component_query(mca_base_module_t **module, int *priority)
|
||||
{
|
||||
*priority = 35;
|
||||
return &orte_ess_alps_module;
|
||||
*module = (mca_base_module_t *)&orte_ess_alps_module;
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* Copyright (c) 2004-2008 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
|
||||
@ -43,7 +43,7 @@ orte_ess_base_close(void)
|
||||
component = (orte_ess_base_component_t *) cli->cli_component;
|
||||
opal_output_verbose(10, 0,
|
||||
"orte_ess_base_close: module %s unloaded",
|
||||
component->ess_version.mca_component_name);
|
||||
component->base_version.mca_component_name);
|
||||
mca_base_component_repository_release((mca_base_component_t *) component);
|
||||
OBJ_RELEASE(item);
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* Copyright (c) 2004-2008 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
|
||||
@ -37,8 +37,10 @@
|
||||
|
||||
opal_list_t orte_ess_base_components_available;
|
||||
orte_ess_base_module_t orte_ess = {
|
||||
NULL,
|
||||
NULL
|
||||
NULL, /* init */
|
||||
NULL, /* finalize */
|
||||
NULL, /* abort */
|
||||
NULL /* ft_event */
|
||||
};
|
||||
int orte_ess_base_output;
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* Copyright (c) 2004-2008 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
|
||||
@ -32,77 +32,26 @@ extern opal_list_t orte_ess_base_components_available;
|
||||
int
|
||||
orte_ess_base_select(void)
|
||||
{
|
||||
opal_list_item_t *item;
|
||||
mca_base_component_list_item_t *cli;
|
||||
int selected_priority = -1;
|
||||
orte_ess_base_component_t *selected_component = NULL;
|
||||
orte_ess_base_module_t *selected_module = NULL;
|
||||
|
||||
/* Traverse the list of opened modules; call their init functions. */
|
||||
for(item = opal_list_get_first(&orte_ess_base_components_available);
|
||||
item != opal_list_get_end(&orte_ess_base_components_available);
|
||||
item = opal_list_get_next(item)) {
|
||||
orte_ess_base_component_t* component;
|
||||
|
||||
cli = (mca_base_component_list_item_t *) item;
|
||||
component = (orte_ess_base_component_t *) cli->cli_component;
|
||||
int ret, exit_status = OPAL_SUCCESS;
|
||||
orte_ess_base_component_t *best_component = NULL;
|
||||
orte_ess_base_module_t *best_module = NULL;
|
||||
|
||||
opal_output_verbose(5, orte_ess_base_output,
|
||||
"orte_ess_base_select: initializing %s component %s",
|
||||
component->ess_version.mca_type_name,
|
||||
component->ess_version.mca_component_name);
|
||||
|
||||
if (NULL == component->ess_init) {
|
||||
opal_output_verbose(5, orte_ess_base_output,
|
||||
"orte_ess_base_select: no init function; ignoring component");
|
||||
} else {
|
||||
int priority;
|
||||
orte_ess_base_module_t* module = component->ess_init(&priority);
|
||||
|
||||
/* If the component didn't initialize, remove it from the opened
|
||||
list and remove it from the component repository */
|
||||
if (NULL == module) {
|
||||
opal_output_verbose(5, orte_ess_base_output,
|
||||
"orte_ess_base_select: init returned failure");
|
||||
continue;
|
||||
}
|
||||
|
||||
if(priority > selected_priority) {
|
||||
selected_priority = priority;
|
||||
selected_component = component;
|
||||
selected_module = module;
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Select the best component
|
||||
*/
|
||||
if( OPAL_SUCCESS != (ret = mca_base_select("ess", orte_ess_base_output,
|
||||
&orte_ess_base_components_available,
|
||||
(mca_base_module_t **) &best_module,
|
||||
(mca_base_component_t **) &best_component) ) ) {
|
||||
/* This will only happen if no component was selected */
|
||||
exit_status = ORTE_ERR_NOT_FOUND;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (NULL == selected_component) {
|
||||
return ORTE_ERR_NOT_FOUND;
|
||||
}
|
||||
/* Save the winner */
|
||||
/* No global component structure */
|
||||
orte_ess = *best_module;
|
||||
|
||||
/* unload all components that were not selected */
|
||||
item = opal_list_get_first(&orte_ess_base_components_available);
|
||||
while(item != opal_list_get_end(&orte_ess_base_components_available)) {
|
||||
opal_list_item_t* next = opal_list_get_next(item);
|
||||
orte_ess_base_component_t* component;
|
||||
cli = (mca_base_component_list_item_t *) item;
|
||||
component = (orte_ess_base_component_t *) cli->cli_component;
|
||||
if(component != selected_component) {
|
||||
opal_output_verbose(5, orte_ess_base_output,
|
||||
"orte_ess_base_select: module %s unloaded",
|
||||
component->ess_version.mca_component_name);
|
||||
mca_base_component_repository_release((mca_base_component_t *) component);
|
||||
opal_list_remove_item(&orte_ess_base_components_available, item);
|
||||
OBJ_RELEASE(item);
|
||||
}
|
||||
item = next;
|
||||
}
|
||||
|
||||
/* setup reference to selected module */
|
||||
if(NULL != selected_module) {
|
||||
opal_output_verbose(5, orte_ess_base_output,
|
||||
"orte_ess_base_select: module %s selected",
|
||||
selected_component->ess_version.mca_component_name);
|
||||
orte_ess = *selected_module;
|
||||
}
|
||||
return ORTE_SUCCESS;
|
||||
cleanup:
|
||||
return exit_status;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* Copyright (c) 2004-2008 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
|
||||
@ -26,7 +26,7 @@ BEGIN_C_DECLS
|
||||
*/
|
||||
int orte_ess_cnos_component_open(void);
|
||||
int orte_ess_cnos_component_close(void);
|
||||
orte_ess_base_module_t* orte_ess_cnos_component_init(int *priority);
|
||||
int orte_ess_cnos_component_query(mca_base_module_t **module, int *priority);
|
||||
|
||||
|
||||
END_C_DECLS
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
|
||||
* Copyright (c) 2004-2008 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
|
||||
@ -50,17 +50,14 @@ orte_ess_base_component_t mca_ess_cnos_component = {
|
||||
|
||||
/* Component open and close functions */
|
||||
orte_ess_cnos_component_open,
|
||||
orte_ess_cnos_component_close
|
||||
orte_ess_cnos_component_close,
|
||||
orte_ess_cnos_component_query
|
||||
},
|
||||
|
||||
/* Next the MCA v1.0.0 component meta data */
|
||||
{
|
||||
/* The component is not checkpoint ready */
|
||||
MCA_BASE_METADATA_PARAM_NONE
|
||||
},
|
||||
|
||||
/* Initialization / querying functions */
|
||||
orte_ess_cnos_component_init
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -71,8 +68,7 @@ orte_ess_cnos_component_open(void)
|
||||
}
|
||||
|
||||
|
||||
orte_ess_base_module_t *
|
||||
orte_ess_cnos_component_init(int *priority)
|
||||
int orte_ess_cnos_component_query(mca_base_module_t **module, int *priority)
|
||||
{
|
||||
/* since we are not launched by an ORTE launcher,
|
||||
* we want to be selected ahead of the singleton
|
||||
@ -81,7 +77,8 @@ orte_ess_cnos_component_init(int *priority)
|
||||
* the singleton's
|
||||
*/
|
||||
*priority = 60;
|
||||
return &orte_ess_cnos_module;
|
||||
*module = (mca_base_module_t *)&orte_ess_cnos_module;
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
|
4
orte/mca/ess/env/ess_env.h
поставляемый
4
orte/mca/ess/env/ess_env.h
поставляемый
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* Copyright (c) 2004-2008 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
* Corporation. All rights reserved.
|
||||
* Copyright (c) 2004-2006 The University of Tennessee and The University
|
||||
@ -26,7 +26,7 @@ BEGIN_C_DECLS
|
||||
*/
|
||||
int orte_ess_env_component_open(void);
|
||||
int orte_ess_env_component_close(void);
|
||||
orte_ess_base_module_t* orte_ess_env_component_init(int *priority);
|
||||
int orte_ess_env_component_query(mca_base_module_t **module, int *priority);
|
||||
|
||||
|
||||
ORTE_MODULE_DECLSPEC extern orte_ess_base_component_t mca_ess_env_component;
|
||||
|
23
orte/mca/ess/env/ess_env_component.c
поставляемый
23
orte/mca/ess/env/ess_env_component.c
поставляемый
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
|
||||
* Copyright (c) 2004-2008 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
|
||||
@ -52,17 +52,14 @@ orte_ess_base_component_t mca_ess_env_component = {
|
||||
|
||||
/* Component open and close functions */
|
||||
orte_ess_env_component_open,
|
||||
orte_ess_env_component_close
|
||||
orte_ess_env_component_close,
|
||||
orte_ess_env_component_query
|
||||
},
|
||||
|
||||
/* Next the MCA v1.0.0 component meta data */
|
||||
{
|
||||
/* The component is checkpoint ready */
|
||||
MCA_BASE_METADATA_PARAM_CHECKPOINT
|
||||
},
|
||||
|
||||
/* Initialization / querying functions */
|
||||
orte_ess_env_component_init
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -72,11 +69,8 @@ orte_ess_env_component_open(void)
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
orte_ess_base_module_t *
|
||||
orte_ess_env_component_init(int *priority)
|
||||
int orte_ess_env_component_query(mca_base_module_t **module, int *priority)
|
||||
{
|
||||
|
||||
/* we are the env module, so set the priority to
|
||||
* be higher than the tool component so that a
|
||||
* tool launched as a distributed set of procs
|
||||
@ -92,11 +86,14 @@ orte_ess_env_component_init(int *priority)
|
||||
*/
|
||||
if (NULL != orte_process_info.my_hnp_uri) {
|
||||
*priority = 20;
|
||||
return &orte_ess_env_module;
|
||||
*module = (mca_base_module_t *)&orte_ess_env_module;
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
||||
/* if not, then return NULL - we cannot be selected */
|
||||
return NULL;
|
||||
*priority = -1;
|
||||
*module = NULL;
|
||||
return ORTE_ERROR;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* Copyright (c) 2004-2008 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
|
||||
@ -31,23 +31,6 @@
|
||||
|
||||
BEGIN_C_DECLS
|
||||
|
||||
/*
|
||||
* Module and component structures
|
||||
*/
|
||||
struct orte_ess_base_module_1_0_0_t;
|
||||
typedef struct orte_ess_base_module_1_0_0_t orte_ess_base_module_1_0_0_t;
|
||||
typedef orte_ess_base_module_1_0_0_t orte_ess_base_module_t;
|
||||
|
||||
struct orte_ess_base_component_1_0_0_t;
|
||||
typedef struct orte_ess_base_component_1_0_0_t orte_ess_base_component_1_0_0_t;
|
||||
typedef orte_ess_base_component_1_0_0_t orte_ess_base_component_t;
|
||||
|
||||
/**
|
||||
* Selection function
|
||||
*/
|
||||
typedef orte_ess_base_module_t*
|
||||
(*orte_ess_base_component_init_fn_t)(int *priority);
|
||||
|
||||
/*
|
||||
* API functions
|
||||
*/
|
||||
@ -147,16 +130,18 @@ struct orte_ess_base_module_1_0_0_t {
|
||||
orte_ess_base_module_proc_get_node_rank_fn_t get_node_rank;
|
||||
orte_ess_base_module_ft_event_fn_t ft_event;
|
||||
};
|
||||
typedef struct orte_ess_base_module_1_0_0_t orte_ess_base_module_1_0_0_t;
|
||||
typedef struct orte_ess_base_module_1_0_0_t orte_ess_base_module_t;
|
||||
|
||||
|
||||
/*
|
||||
* the standard component data structure
|
||||
*/
|
||||
struct orte_ess_base_component_1_0_0_t {
|
||||
mca_base_component_t ess_version;
|
||||
mca_base_component_data_1_0_0_t ess_data;
|
||||
orte_ess_base_component_init_fn_t ess_init;
|
||||
mca_base_component_t base_version;
|
||||
mca_base_component_data_1_0_0_t base_data;
|
||||
};
|
||||
typedef struct orte_ess_base_component_1_0_0_t orte_ess_base_component_1_0_0_t;
|
||||
typedef struct orte_ess_base_component_1_0_0_t orte_ess_base_component_t;
|
||||
|
||||
/*
|
||||
* Macro for use in components that are of type ess v1.0.0
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* Copyright (c) 2004-2008 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
* Corporation. All rights reserved.
|
||||
* Copyright (c) 2004-2006 The University of Tennessee and The University
|
||||
@ -26,7 +26,7 @@ BEGIN_C_DECLS
|
||||
*/
|
||||
int orte_ess_hnp_component_open(void);
|
||||
int orte_ess_hnp_component_close(void);
|
||||
orte_ess_base_module_t* orte_ess_hnp_component_init(int *priority);
|
||||
int orte_ess_hnp_component_query(mca_base_module_t **module, int *priority);
|
||||
|
||||
|
||||
ORTE_MODULE_DECLSPEC extern orte_ess_base_component_t mca_ess_hnp_component;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
|
||||
* Copyright (c) 2004-2008 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
|
||||
@ -52,17 +52,14 @@ orte_ess_base_component_t mca_ess_hnp_component = {
|
||||
|
||||
/* Component open and close functions */
|
||||
orte_ess_hnp_component_open,
|
||||
orte_ess_hnp_component_close
|
||||
orte_ess_hnp_component_close,
|
||||
orte_ess_hnp_component_query
|
||||
},
|
||||
|
||||
/* Next the MCA v1.0.0 component meta data */
|
||||
{
|
||||
/* The component is checkpoint ready */
|
||||
MCA_BASE_METADATA_PARAM_CHECKPOINT
|
||||
},
|
||||
|
||||
/* Initialization / querying functions */
|
||||
orte_ess_hnp_component_init
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -73,8 +70,7 @@ orte_ess_hnp_component_open(void)
|
||||
}
|
||||
|
||||
|
||||
orte_ess_base_module_t *
|
||||
orte_ess_hnp_component_init(int *priority)
|
||||
int orte_ess_hnp_component_query(mca_base_module_t **module, int *priority)
|
||||
{
|
||||
|
||||
/* we are the hnp module - we need to be selected
|
||||
@ -82,12 +78,14 @@ orte_ess_hnp_component_init(int *priority)
|
||||
*/
|
||||
if (orte_process_info.hnp) {
|
||||
*priority = 100;
|
||||
return &orte_ess_hnp_module;
|
||||
*module = (mca_base_module_t *)&orte_ess_hnp_module;
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
||||
/* else, we are not */
|
||||
*priority = -1;
|
||||
return NULL;
|
||||
*module = NULL;
|
||||
return ORTE_ERROR;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* Copyright (c) 2004-2008 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
|
||||
@ -29,7 +29,7 @@ ORTE_MODULE_DECLSPEC extern orte_ess_base_component_t mca_ess_lsf_component;
|
||||
*/
|
||||
int orte_ess_lsf_component_open(void);
|
||||
int orte_ess_lsf_component_close(void);
|
||||
orte_ess_base_module_t* orte_ess_lsf_component_init(int *priority);
|
||||
int orte_ess_lsf_component_query(mca_base_module_t **module, int *priority);
|
||||
|
||||
END_C_DECLS
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
|
||||
* Copyright (c) 2004-2008 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
|
||||
@ -49,17 +49,14 @@ orte_ess_base_component_t mca_ess_lsf_component = {
|
||||
|
||||
/* Component open and close functions */
|
||||
orte_ess_lsf_component_open,
|
||||
orte_ess_lsf_component_close
|
||||
orte_ess_lsf_component_close,
|
||||
orte_ess_lsf_component_query
|
||||
},
|
||||
|
||||
/* Next the MCA v1.0.0 component meta data */
|
||||
{
|
||||
/* The component is not checkpoint ready */
|
||||
MCA_BASE_METADATA_PARAM_NONE
|
||||
},
|
||||
|
||||
/* Initialization / querying functions */
|
||||
orte_ess_lsf_component_init
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -69,7 +66,7 @@ int orte_ess_lsf_component_open(void)
|
||||
}
|
||||
|
||||
|
||||
orte_ess_base_module_t *orte_ess_lsf_component_init(int *priority)
|
||||
int orte_ess_lsf_component_query(mca_base_module_t **module, int *priority)
|
||||
{
|
||||
/* Are we running under an LSF job? Were
|
||||
* we given a path back to the HNP? If the
|
||||
@ -80,11 +77,14 @@ orte_ess_base_module_t *orte_ess_lsf_component_init(int *priority)
|
||||
if (NULL != getenv("LSB_JOBID") &&
|
||||
NULL != orte_process_info.my_hnp_uri) {
|
||||
*priority = 40;
|
||||
return &orte_ess_lsf_module;
|
||||
*module = (mca_base_module_t *)&orte_ess_lsf_module;
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
||||
/* nope, not here */
|
||||
return NULL;
|
||||
*priority = -1;
|
||||
*module = NULL;
|
||||
return ORTE_ERROR;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* Copyright (c) 2004-2008 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
|
||||
@ -23,7 +23,7 @@ BEGIN_C_DECLS
|
||||
|
||||
int orte_ess_portals_utcp_component_open(void);
|
||||
int orte_ess_portals_utcp_component_close(void);
|
||||
orte_ess_base_module_t* orte_ess_portals_utcp_component_init(int *priority);
|
||||
int orte_ess_portals_utcp_component_query(mca_base_module_t **module, int *priority);
|
||||
|
||||
END_C_DECLS
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
|
||||
* Copyright (c) 2004-2008 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
|
||||
@ -52,17 +52,14 @@ orte_ess_base_component_t mca_ess_portals_utcp_component = {
|
||||
|
||||
/* Component open and close functions */
|
||||
orte_ess_portals_utcp_component_open,
|
||||
orte_ess_portals_utcp_component_close
|
||||
orte_ess_portals_utcp_component_close,
|
||||
orte_ess_portals_utcp_component_query
|
||||
},
|
||||
|
||||
/* Next the MCA v1.0.0 component meta data */
|
||||
{
|
||||
/* The component is not checkpoint ready */
|
||||
MCA_BASE_METADATA_PARAM_NONE
|
||||
},
|
||||
|
||||
/* Initialization / querying functions */
|
||||
orte_ess_portals_utcp_component_init
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -73,8 +70,7 @@ orte_ess_portals_utcp_component_open(void)
|
||||
}
|
||||
|
||||
|
||||
orte_ess_base_module_t *
|
||||
orte_ess_portals_utcp_component_init(int *priority)
|
||||
int orte_ess_portals_utcp_component_query(mca_base_module_t **module, int *priority)
|
||||
{
|
||||
/* since we are not launched by an ORTE launcher,
|
||||
* we want to be selected ahead of the singleton
|
||||
@ -82,10 +78,15 @@ orte_ess_portals_utcp_component_init(int *priority)
|
||||
* So ensure that our priority is higher than
|
||||
* the singleton's
|
||||
*/
|
||||
if (NULL == getenv("PTL_MY_RID")) return NULL;
|
||||
if (NULL == getenv("PTL_MY_RID")) {
|
||||
*priority = -1;
|
||||
*module = NULL;
|
||||
return ORTE_ERROR;
|
||||
}
|
||||
|
||||
*priority = 60;
|
||||
return &orte_ess_portals_utcp_module;
|
||||
*module = (mca_base_module_t *)&orte_ess_portals_utcp_module;
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* Copyright (c) 2004-2008 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
* Corporation. All rights reserved.
|
||||
* Copyright (c) 2004-2006 The University of Tennessee and The University
|
||||
@ -26,7 +26,7 @@ BEGIN_C_DECLS
|
||||
*/
|
||||
int orte_ess_singleton_component_open(void);
|
||||
int orte_ess_singleton_component_close(void);
|
||||
orte_ess_base_module_t* orte_ess_singleton_component_init(int *priority);
|
||||
int orte_ess_singleton_component_query(mca_base_module_t **module, int *priority);
|
||||
|
||||
ORTE_MODULE_DECLSPEC extern orte_ess_base_component_t mca_ess_singleton_component;
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
|
||||
* Copyright (c) 2004-2008 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
|
||||
@ -54,17 +54,14 @@ orte_ess_base_component_t mca_ess_singleton_component = {
|
||||
|
||||
/* Component open and close functions */
|
||||
orte_ess_singleton_component_open,
|
||||
orte_ess_singleton_component_close
|
||||
orte_ess_singleton_component_close,
|
||||
orte_ess_singleton_component_query
|
||||
},
|
||||
|
||||
/* Next the MCA v1.0.0 component meta data */
|
||||
{
|
||||
/* The component is not checkpoint ready */
|
||||
MCA_BASE_METADATA_PARAM_NONE
|
||||
},
|
||||
|
||||
/* Initialization / querying functions */
|
||||
orte_ess_singleton_component_init
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -74,9 +71,7 @@ orte_ess_singleton_component_open(void)
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
orte_ess_base_module_t *
|
||||
orte_ess_singleton_component_init(int *priority)
|
||||
int orte_ess_singleton_component_query(mca_base_module_t **module, int *priority)
|
||||
{
|
||||
/* if we are an HNP, daemon, or tool, then we
|
||||
* are definitely not a singleton!
|
||||
@ -84,7 +79,8 @@ orte_ess_singleton_component_init(int *priority)
|
||||
if (orte_process_info.hnp ||
|
||||
orte_process_info.daemon ||
|
||||
orte_process_info.tool) {
|
||||
return NULL;
|
||||
*module = NULL;
|
||||
return ORTE_ERROR;
|
||||
}
|
||||
|
||||
/* okay, we still could be a singleton or
|
||||
@ -93,7 +89,8 @@ orte_ess_singleton_component_init(int *priority)
|
||||
* not a singleton
|
||||
*/
|
||||
if (NULL != orte_process_info.my_hnp_uri) {
|
||||
return NULL;
|
||||
*module = NULL;
|
||||
return ORTE_ERROR;
|
||||
}
|
||||
|
||||
/* okay, we could still be an application process,
|
||||
@ -104,7 +101,8 @@ orte_ess_singleton_component_init(int *priority)
|
||||
* want to be selected as we must be a singleton
|
||||
*/
|
||||
*priority = 25;
|
||||
return &orte_ess_singleton_module;
|
||||
*module = (mca_base_module_t *)&orte_ess_singleton_module;
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* Copyright (c) 2004-2008 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
|
||||
@ -28,7 +28,7 @@ ORTE_MODULE_DECLSPEC extern orte_ess_base_component_t mca_ess_slurm_component;
|
||||
*/
|
||||
int orte_ess_slurm_component_open(void);
|
||||
int orte_ess_slurm_component_close(void);
|
||||
orte_ess_base_module_t* orte_ess_slurm_component_init(int *priority);
|
||||
int orte_ess_slurm_component_query(mca_base_module_t **module, int *priority);
|
||||
|
||||
/*
|
||||
* Startup / Shutdown
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
|
||||
* Copyright (c) 2004-2008 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
|
||||
@ -52,17 +52,14 @@ orte_ess_base_component_t mca_ess_slurm_component = {
|
||||
|
||||
/* Component open and close functions */
|
||||
orte_ess_slurm_component_open,
|
||||
orte_ess_slurm_component_close
|
||||
orte_ess_slurm_component_close,
|
||||
orte_ess_slurm_component_query
|
||||
},
|
||||
|
||||
/* Next the MCA v1.0.0 component meta data */
|
||||
{
|
||||
/* The component is checkpoint ready */
|
||||
MCA_BASE_METADATA_PARAM_CHECKPOINT
|
||||
},
|
||||
|
||||
/* Initialization / querying functions */
|
||||
orte_ess_slurm_component_init
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -73,8 +70,7 @@ orte_ess_slurm_component_open(void)
|
||||
}
|
||||
|
||||
|
||||
orte_ess_base_module_t *
|
||||
orte_ess_slurm_component_init(int *priority)
|
||||
int orte_ess_slurm_component_query(mca_base_module_t **module, int *priority)
|
||||
{
|
||||
/* Are we running under a SLURM job? Were
|
||||
* we given a path back to the HNP? If the
|
||||
@ -85,12 +81,14 @@ orte_ess_slurm_component_init(int *priority)
|
||||
if (NULL != getenv("SLURM_JOBID") &&
|
||||
NULL != orte_process_info.my_hnp_uri) {
|
||||
*priority = 30;
|
||||
return &orte_ess_slurm_module;
|
||||
*module = (mca_base_module_t *)&orte_ess_slurm_module;
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
||||
/* Sadly, no */
|
||||
|
||||
return NULL;
|
||||
*priority = -1;
|
||||
*module = NULL;
|
||||
return ORTE_ERROR;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* Copyright (c) 2004-2008 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
* Corporation. All rights reserved.
|
||||
* Copyright (c) 2004-2006 The University of Tennessee and The University
|
||||
@ -26,7 +26,7 @@ BEGIN_C_DECLS
|
||||
*/
|
||||
int orte_ess_tool_component_open(void);
|
||||
int orte_ess_tool_component_close(void);
|
||||
orte_ess_base_module_t* orte_ess_tool_component_init(int *priority);
|
||||
int orte_ess_tool_component_query(mca_base_module_t **module, int *priority);
|
||||
|
||||
|
||||
ORTE_MODULE_DECLSPEC extern orte_ess_base_component_t mca_ess_tool_component;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
|
||||
* Copyright (c) 2004-2008 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
|
||||
@ -52,17 +52,14 @@ orte_ess_base_component_t mca_ess_tool_component = {
|
||||
|
||||
/* Component open and close functions */
|
||||
orte_ess_tool_component_open,
|
||||
orte_ess_tool_component_close
|
||||
orte_ess_tool_component_close,
|
||||
orte_ess_tool_component_query
|
||||
},
|
||||
|
||||
/* Next the MCA v1.0.0 component meta data */
|
||||
{
|
||||
/* The component is checkpoint ready */
|
||||
MCA_BASE_METADATA_PARAM_CHECKPOINT
|
||||
},
|
||||
|
||||
/* Initialization / querying functions */
|
||||
orte_ess_tool_component_init
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -73,10 +70,8 @@ orte_ess_tool_component_open(void)
|
||||
}
|
||||
|
||||
|
||||
orte_ess_base_module_t *
|
||||
orte_ess_tool_component_init(int *priority)
|
||||
int orte_ess_tool_component_query(mca_base_module_t **module, int *priority)
|
||||
{
|
||||
|
||||
/* if we are a tool, we want to be selected
|
||||
* UNLESS some enviro-specific component takes
|
||||
* precedence. This would happen, for example,
|
||||
@ -84,12 +79,14 @@ orte_ess_tool_component_init(int *priority)
|
||||
*/
|
||||
if (orte_process_info.tool) {
|
||||
*priority = 10;
|
||||
return &orte_ess_tool_module;
|
||||
*module = (mca_base_module_t *)&orte_ess_tool_module;
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
||||
/* else, don't */
|
||||
*priority = -1;
|
||||
return NULL;
|
||||
*module = NULL;
|
||||
return ORTE_ERROR;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
|
||||
* Copyright (c) 2004-2008 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
|
||||
@ -94,8 +94,9 @@ typedef uint8_t orte_filem_cmd_flag_t;
|
||||
* These are to be used when no component is selected.
|
||||
* They just return success, and empty strings as necessary.
|
||||
*/
|
||||
int orte_filem_base_none_open(void);
|
||||
int orte_filem_base_none_close(void);
|
||||
ORTE_DECLSPEC int orte_filem_base_none_open(void);
|
||||
ORTE_DECLSPEC int orte_filem_base_none_close(void);
|
||||
ORTE_DECLSPEC int orte_filem_base_none_query(mca_base_module_t **module, int *priority);
|
||||
|
||||
int orte_filem_base_module_init(void);
|
||||
int orte_filem_base_module_finalize(void);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2007 The Trustees of Indiana University.
|
||||
* Copyright (c) 2004-2008 The Trustees of Indiana University.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
||||
* All rights reserved.
|
||||
@ -155,6 +155,14 @@ int orte_filem_base_none_close(void)
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
||||
int orte_filem_base_none_query(mca_base_module_t **module, int *priority)
|
||||
{
|
||||
*module = NULL;
|
||||
*priority = 0;
|
||||
|
||||
return OPAL_SUCCESS;
|
||||
}
|
||||
|
||||
int orte_filem_base_module_init(void)
|
||||
{
|
||||
return ORTE_SUCCESS;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2007 The Trustees of Indiana University.
|
||||
* Copyright (c) 2004-2008 The Trustees of Indiana University.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
||||
* All rights reserved.
|
||||
@ -41,7 +41,8 @@ static orte_filem_base_component_t none_component = {
|
||||
|
||||
/* Component open and close functions */
|
||||
orte_filem_base_none_open,
|
||||
orte_filem_base_none_close
|
||||
orte_filem_base_none_close,
|
||||
orte_filem_base_none_query
|
||||
},
|
||||
|
||||
/* Next the MCA v1.0.0 component meta data */
|
||||
@ -50,8 +51,6 @@ static orte_filem_base_component_t none_component = {
|
||||
true
|
||||
},
|
||||
|
||||
/* Query Function */
|
||||
NULL,
|
||||
/* Verbosity level */
|
||||
0,
|
||||
/* opal_output handler */
|
||||
@ -73,124 +72,63 @@ static orte_filem_base_module_t none_module = {
|
||||
|
||||
int orte_filem_base_select(void)
|
||||
{
|
||||
int priority = 0, best_priority = -1;
|
||||
opal_list_item_t *item = NULL;
|
||||
mca_base_component_list_item_t *cli = NULL;
|
||||
orte_filem_base_component_t *component = NULL, *best_component = NULL;
|
||||
orte_filem_base_module_t *module = NULL, *best_module = NULL;
|
||||
char *filem_include_list = NULL;
|
||||
bool fail_on_non_selection = false;
|
||||
int ret, exit_status = OPAL_SUCCESS;
|
||||
orte_filem_base_component_t *best_component = NULL;
|
||||
orte_filem_base_module_t *best_module = NULL;
|
||||
char *include_list = NULL;
|
||||
|
||||
/* Register the framework MCA param and look it up */
|
||||
/*
|
||||
* Register the framework MCA param and look up include list
|
||||
*/
|
||||
mca_base_param_reg_string_name("filem", NULL,
|
||||
"Which FileM component to use (empty = auto-select)",
|
||||
"Which FILEM component to use (empty = auto-select)",
|
||||
false, false,
|
||||
NULL, &filem_include_list);
|
||||
|
||||
if (NULL == filem_include_list || 0 == strlen(filem_include_list)) {
|
||||
opal_output_verbose(10, orte_filem_base_output,
|
||||
"filem:select: auto-selecting");
|
||||
} else {
|
||||
opal_output_verbose(10, orte_filem_base_output,
|
||||
"filem:select: looking for %s component", filem_include_list);
|
||||
if(0 == strncmp(filem_include_list, "none", strlen("none")) ) {
|
||||
goto do_none_comp;
|
||||
}
|
||||
else {
|
||||
fail_on_non_selection = true;
|
||||
}
|
||||
}
|
||||
|
||||
/* Traverse the list of available components;
|
||||
* calling their init functions
|
||||
*/
|
||||
for (item = opal_list_get_first(&orte_filem_base_components_available);
|
||||
item != opal_list_get_end(&orte_filem_base_components_available);
|
||||
item = opal_list_get_next(item) ) {
|
||||
cli = (mca_base_component_list_item_t *) item;
|
||||
component = (orte_filem_base_component_t *) cli->cli_component;
|
||||
|
||||
/* If there is an include list -
|
||||
* the item must be in the list to be included :)
|
||||
*/
|
||||
if (NULL != filem_include_list &&
|
||||
0 < strlen(filem_include_list) &&
|
||||
0 != strncmp(component->filem_version.mca_component_name,
|
||||
filem_include_list, strlen(filem_include_list)) ) {
|
||||
opal_output_verbose(10, orte_filem_base_output,
|
||||
"filem:select: Skipping %s component",
|
||||
component->filem_version.mca_component_name);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (NULL == component->filem_query) {
|
||||
opal_output_verbose(10, orte_filem_base_output,
|
||||
"filem:select: No init function! Ignoring component %s",
|
||||
component->filem_version.mca_component_name );
|
||||
continue;
|
||||
}
|
||||
|
||||
opal_output_verbose(10, orte_filem_base_output,
|
||||
"filem:select: Initializing component %s",
|
||||
component->filem_version.mca_component_name);
|
||||
NULL, &include_list);
|
||||
|
||||
module = component->filem_query(&priority);
|
||||
if (NULL == module) {
|
||||
opal_output_verbose(10, orte_filem_base_output,
|
||||
"filem:select: Init returned failure for component %s",
|
||||
component->filem_version.mca_component_name );
|
||||
continue;
|
||||
}
|
||||
|
||||
if(NULL != include_list && 0 == strncmp(include_list, "none", strlen("none")) ){
|
||||
opal_output_verbose(10, orte_filem_base_output,
|
||||
"filem:select: Init returned priority %d",
|
||||
priority);
|
||||
if (priority > best_priority) {
|
||||
best_priority = priority;
|
||||
best_component = component;
|
||||
best_module = module;
|
||||
}
|
||||
"filem:select: Using %s component",
|
||||
include_list);
|
||||
best_component = &none_component;
|
||||
best_module = &none_module;
|
||||
/* 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 */
|
||||
&orte_filem_base_components_available,
|
||||
NULL);
|
||||
goto skip_select;
|
||||
}
|
||||
|
||||
/* Finished querying all components.
|
||||
* Check for the bozo case.
|
||||
*/
|
||||
do_none_comp:
|
||||
if (NULL == best_component ) {
|
||||
if( fail_on_non_selection ) {
|
||||
return ORTE_ERROR;
|
||||
}
|
||||
else {
|
||||
opal_output_verbose(10, orte_filem_base_output,
|
||||
"filem:select: No component found, using the base component. ;(");
|
||||
best_component = &none_component;
|
||||
best_module = &none_module;
|
||||
}
|
||||
}
|
||||
|
||||
/* Go through the list and close
|
||||
* the non-selected components
|
||||
*/
|
||||
mca_base_components_close(0, /* We must pass it 0, to keep it from closing it */
|
||||
&orte_filem_base_components_available,
|
||||
(mca_base_component_t *) best_component);
|
||||
|
||||
/*
|
||||
* Select the best component
|
||||
*/
|
||||
if( OPAL_SUCCESS != (ret = mca_base_select("filem", orte_filem_base_output,
|
||||
&orte_filem_base_components_available,
|
||||
(mca_base_module_t **) &best_module,
|
||||
(mca_base_component_t **) &best_component) ) ) {
|
||||
/* This will only happen if no component was selected */
|
||||
exit_status = ORTE_ERROR;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
skip_select:
|
||||
/* Save the winner */
|
||||
orte_filem_base_selected_component = *best_component;
|
||||
orte_filem = *best_module;
|
||||
opal_output_verbose(5, orte_filem_base_output,
|
||||
"filem:select: Component %s selected",
|
||||
best_component->filem_version.mca_component_name);
|
||||
|
||||
/* Initialize the winner */
|
||||
if (NULL != best_module) {
|
||||
if (ORTE_SUCCESS != orte_filem.filem_init() ) {
|
||||
return ORTE_ERROR;
|
||||
if (OPAL_SUCCESS != orte_filem.filem_init()) {
|
||||
exit_status = OPAL_ERROR;
|
||||
goto cleanup;
|
||||
}
|
||||
}
|
||||
|
||||
if( NULL != filem_include_list ) {
|
||||
free(filem_include_list);
|
||||
cleanup:
|
||||
if( NULL != include_list ) {
|
||||
free(include_list);
|
||||
include_list = NULL;
|
||||
}
|
||||
return ORTE_SUCCESS;
|
||||
|
||||
return exit_status;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
|
||||
* Copyright (c) 2004-2008 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
|
||||
@ -162,14 +162,6 @@ typedef struct orte_filem_base_request_1_0_0_t orte_filem_base_request_t;
|
||||
|
||||
ORTE_DECLSPEC OBJ_CLASS_DECLARATION(orte_filem_base_request_t);
|
||||
|
||||
/**
|
||||
* Query function for FILEM components.
|
||||
* Returns a priority to rank it agaianst other available FILEM components.
|
||||
*/
|
||||
typedef struct orte_filem_base_module_1_0_0_t *
|
||||
(*orte_filem_base_component_query_1_0_0_fn_t)
|
||||
(int *priority);
|
||||
|
||||
/**
|
||||
* Module initialization function.
|
||||
* Returns ORTE_SUCCESS
|
||||
@ -313,13 +305,10 @@ typedef int (*orte_filem_base_wait_all_fn_t)
|
||||
*/
|
||||
struct orte_filem_base_component_1_0_0_t {
|
||||
/** MCA base component */
|
||||
mca_base_component_t filem_version;
|
||||
mca_base_component_t base_version;
|
||||
/** MCA base data */
|
||||
mca_base_component_data_1_0_0_t filem_data;
|
||||
mca_base_component_data_1_0_0_t base_data;
|
||||
|
||||
/** Component Query for Selection Function */
|
||||
orte_filem_base_component_query_1_0_0_fn_t filem_query;
|
||||
|
||||
/** Verbosity Level */
|
||||
int verbose;
|
||||
/** Output Handle for opal_output */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2007 The Trustees of Indiana University.
|
||||
* Copyright (c) 2004-2008 The Trustees of Indiana University.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
||||
* All rights reserved.
|
||||
@ -56,11 +56,11 @@ extern "C" {
|
||||
extern int orte_filem_rsh_max_incomming;
|
||||
extern int orte_filem_rsh_max_outgoing;
|
||||
|
||||
int orte_filem_rsh_component_query(mca_base_module_t **module, int *priority);
|
||||
|
||||
/*
|
||||
* Module functions
|
||||
*/
|
||||
orte_filem_base_module_1_0_0_t *
|
||||
orte_filem_rsh_component_query(int *priority);
|
||||
int orte_filem_rsh_module_init(void);
|
||||
int orte_filem_rsh_module_finalize(void);
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2007 The Trustees of Indiana University.
|
||||
* Copyright (c) 2004-2008 The Trustees of Indiana University.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
||||
* All rights reserved.
|
||||
@ -58,7 +58,8 @@ orte_filem_rsh_component_t mca_filem_rsh_component = {
|
||||
|
||||
/* Component open and close functions */
|
||||
filem_rsh_open,
|
||||
filem_rsh_close
|
||||
filem_rsh_close,
|
||||
orte_filem_rsh_component_query
|
||||
},
|
||||
|
||||
/* Next the MCA v1.0.0 component meta data */
|
||||
@ -66,9 +67,7 @@ orte_filem_rsh_component_t mca_filem_rsh_component = {
|
||||
/* The component is checkpoint ready */
|
||||
MCA_BASE_METADATA_PARAM_CHECKPOINT
|
||||
},
|
||||
|
||||
/* Query Function */
|
||||
orte_filem_rsh_component_query,
|
||||
|
||||
/* Verbosity level */
|
||||
0,
|
||||
/* opal_output handler */
|
||||
@ -86,14 +85,14 @@ orte_filem_rsh_component_t mca_filem_rsh_component = {
|
||||
|
||||
static int filem_rsh_open(void)
|
||||
{
|
||||
mca_base_param_reg_int(&mca_filem_rsh_component.super.filem_version,
|
||||
mca_base_param_reg_int(&mca_filem_rsh_component.super.base_version,
|
||||
"priority",
|
||||
"Priority of the FILEM rsh component",
|
||||
false, false,
|
||||
mca_filem_rsh_component.super.priority,
|
||||
&mca_filem_rsh_component.super.priority);
|
||||
|
||||
mca_base_param_reg_int(&mca_filem_rsh_component.super.filem_version,
|
||||
mca_base_param_reg_int(&mca_filem_rsh_component.super.base_version,
|
||||
"verbose",
|
||||
"Verbose level for the FILEM rsh component",
|
||||
false, false,
|
||||
@ -110,20 +109,20 @@ static int filem_rsh_open(void)
|
||||
mca_filem_rsh_component.super.output_handle = orte_filem_base_output;
|
||||
}
|
||||
|
||||
mca_base_param_reg_string(&mca_filem_rsh_component.super.filem_version,
|
||||
mca_base_param_reg_string(&mca_filem_rsh_component.super.base_version,
|
||||
"rcp",
|
||||
"The rsh cp command for the FILEM rsh component",
|
||||
false, false,
|
||||
"scp",
|
||||
&mca_filem_rsh_component.cp_command);
|
||||
mca_base_param_reg_string(&mca_filem_rsh_component.super.filem_version,
|
||||
mca_base_param_reg_string(&mca_filem_rsh_component.super.base_version,
|
||||
"rsh",
|
||||
"The remote shell command for the FILEM rsh component",
|
||||
false, false,
|
||||
"ssh",
|
||||
&mca_filem_rsh_component.remote_sh_command);
|
||||
|
||||
mca_base_param_reg_int(&mca_filem_rsh_component.super.filem_version,
|
||||
mca_base_param_reg_int(&mca_filem_rsh_component.super.base_version,
|
||||
"max_incomming",
|
||||
"Maximum number of incomming connections",
|
||||
false, false,
|
||||
@ -134,7 +133,7 @@ static int filem_rsh_open(void)
|
||||
orte_filem_rsh_max_incomming = 1;
|
||||
}
|
||||
|
||||
mca_base_param_reg_int(&mca_filem_rsh_component.super.filem_version,
|
||||
mca_base_param_reg_int(&mca_filem_rsh_component.super.base_version,
|
||||
"max_outgoing",
|
||||
"Maximum number of out going connections (Currently not used)",
|
||||
false, false,
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2007 The Trustees of Indiana University.
|
||||
* Copyright (c) 2004-2008 The Trustees of Indiana University.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
||||
* All rights reserved.
|
||||
@ -203,15 +203,15 @@ static orte_filem_base_module_t loc_module = {
|
||||
/*
|
||||
* MCA Functions
|
||||
*/
|
||||
orte_filem_base_module_1_0_0_t *
|
||||
orte_filem_rsh_component_query(int *priority)
|
||||
int orte_filem_rsh_component_query(mca_base_module_t **module, int *priority)
|
||||
{
|
||||
OPAL_OUTPUT_VERBOSE((10, mca_filem_rsh_component.super.output_handle,
|
||||
"filem:rsh: component_query()"));
|
||||
|
||||
*priority = mca_filem_rsh_component.super.priority;
|
||||
*module = (mca_base_module_t *)&loc_module;
|
||||
|
||||
return &loc_module;
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
||||
int orte_filem_rsh_module_init(void)
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* Copyright (c) 2004-2008 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
|
||||
@ -31,62 +31,33 @@
|
||||
*/
|
||||
int orte_grpcomm_base_select(void)
|
||||
{
|
||||
opal_list_item_t *item;
|
||||
mca_base_component_list_item_t *cli;
|
||||
orte_grpcomm_base_component_t *component, *best_component = NULL;
|
||||
orte_grpcomm_base_module_t *module, *best_module = NULL;
|
||||
int priority, best_priority = -1;
|
||||
|
||||
/* Iterate through all the available components */
|
||||
|
||||
for (item = opal_list_get_first(&mca_grpcomm_base_components_available);
|
||||
item != opal_list_get_end(&mca_grpcomm_base_components_available);
|
||||
item = opal_list_get_next(item)) {
|
||||
cli = (mca_base_component_list_item_t *) item;
|
||||
component = (orte_grpcomm_base_component_t *) cli->cli_component;
|
||||
|
||||
/* Call the component's init function and see if it wants to be
|
||||
* selected
|
||||
*/
|
||||
|
||||
module = component->grpcomm_init(&priority);
|
||||
|
||||
/* If we got a non-NULL module back, then the component wants to
|
||||
* be selected. So save the module with the highest priority
|
||||
*/
|
||||
|
||||
if (NULL != module) {
|
||||
/* If this is the best one, save it */
|
||||
|
||||
if (priority > best_priority) {
|
||||
|
||||
/* Save the new best one */
|
||||
|
||||
best_module = module;
|
||||
best_component = component;
|
||||
|
||||
/* update the best priority */
|
||||
best_priority = priority;
|
||||
}
|
||||
|
||||
}
|
||||
int ret, exit_status = ORTE_SUCCESS;
|
||||
orte_grpcomm_base_component_t *best_component = NULL;
|
||||
orte_grpcomm_base_module_t *best_module = NULL;
|
||||
|
||||
/*
|
||||
* Select the best component
|
||||
*/
|
||||
if( OPAL_SUCCESS != (ret = mca_base_select("grpcomm", orte_grpcomm_base_output,
|
||||
&mca_grpcomm_base_components_available,
|
||||
(mca_base_module_t **) &best_module,
|
||||
(mca_base_component_t **) &best_component) ) ) {
|
||||
/* This will only happen if no component was selected */
|
||||
exit_status = ORTE_ERR_NOT_FOUND;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
/* If we didn't find one to select, barf */
|
||||
|
||||
if (NULL == best_component) {
|
||||
return ORTE_ERROR;
|
||||
}
|
||||
|
||||
/* We have happiness */
|
||||
|
||||
/* Save the winner */
|
||||
/* No global component structure */
|
||||
orte_grpcomm = *best_module;
|
||||
if (ORTE_SUCCESS != orte_grpcomm.init()) {
|
||||
/* ouch! */
|
||||
return ORTE_ERROR;
|
||||
|
||||
if (ORTE_SUCCESS != (ret = orte_grpcomm.init()) ) {
|
||||
exit_status = ret;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
mca_grpcomm_base_selected = true;
|
||||
|
||||
/* all done */
|
||||
|
||||
return ORTE_SUCCESS;
|
||||
|
||||
cleanup:
|
||||
return exit_status;
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* -*- C -*-
|
||||
*
|
||||
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
|
||||
* Copyright (c) 2004-2008 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
* Corporation. All rights reserved.
|
||||
* Copyright (c) 2004-2006 The University of Tennessee and The University
|
||||
@ -49,7 +49,7 @@ extern orte_grpcomm_basic_globals_t orte_grpcomm_basic;
|
||||
*/
|
||||
int orte_grpcomm_basic_open(void);
|
||||
int orte_grpcomm_basic_close(void);
|
||||
orte_grpcomm_base_module_t* orte_grpcomm_basic_init(int *priority);
|
||||
int orte_grpcomm_basic_component_query(mca_base_module_t **module, int *priority);
|
||||
|
||||
|
||||
/*
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* -*- C -*-
|
||||
*
|
||||
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
|
||||
* Copyright (c) 2004-2008 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
|
||||
@ -62,13 +62,13 @@ orte_grpcomm_base_component_t mca_grpcomm_basic_component = {
|
||||
ORTE_MINOR_VERSION, /* MCA module minor version */
|
||||
ORTE_RELEASE_VERSION, /* MCA module release version */
|
||||
orte_grpcomm_basic_open, /* module open */
|
||||
orte_grpcomm_basic_close /* module close */
|
||||
orte_grpcomm_basic_close, /* module close */
|
||||
orte_grpcomm_basic_component_query /* module query */
|
||||
},
|
||||
{
|
||||
/* The component is checkpoint ready */
|
||||
MCA_BASE_METADATA_PARAM_CHECKPOINT
|
||||
},
|
||||
orte_grpcomm_basic_init /* component init */
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
@ -80,7 +80,7 @@ orte_grpcomm_basic_globals_t orte_grpcomm_basic;
|
||||
int orte_grpcomm_basic_open(void)
|
||||
{
|
||||
char *mode;
|
||||
mca_base_component_t *c = &mca_grpcomm_basic_component.grpcomm_version;
|
||||
mca_base_component_t *c = &mca_grpcomm_basic_component.base_version;
|
||||
int tmp;
|
||||
|
||||
mca_base_param_reg_int(c, "xcast_linear_xover",
|
||||
@ -117,10 +117,10 @@ int orte_grpcomm_basic_close(void)
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
||||
orte_grpcomm_base_module_t* orte_grpcomm_basic_init(int *priority)
|
||||
int orte_grpcomm_basic_component_query(mca_base_module_t **module, int *priority)
|
||||
{
|
||||
/* we are the default, so set a low priority so we can be overridden */
|
||||
*priority = 1;
|
||||
|
||||
return &orte_grpcomm_basic_module;
|
||||
*module = (mca_base_module_t *)&orte_grpcomm_basic_module;
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* -*- C -*-
|
||||
*
|
||||
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
|
||||
* Copyright (c) 2004-2008 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
* Corporation. All rights reserved.
|
||||
* Copyright (c) 2004-2006 The University of Tennessee and The University
|
||||
@ -37,7 +37,7 @@ BEGIN_C_DECLS
|
||||
*/
|
||||
int orte_grpcomm_cnos_open(void);
|
||||
int orte_grpcomm_cnos_close(void);
|
||||
orte_grpcomm_base_module_t* orte_grpcomm_cnos_init(int *priority);
|
||||
int orte_grpcomm_cnos_query(mca_base_module_t **module, int *priority);
|
||||
|
||||
|
||||
/*
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* -*- C -*-
|
||||
*
|
||||
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
|
||||
* Copyright (c) 2004-2008 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
|
||||
@ -52,13 +52,13 @@ orte_grpcomm_base_component_t mca_grpcomm_cnos_component = {
|
||||
ORTE_MINOR_VERSION, /* MCA module minor version */
|
||||
ORTE_RELEASE_VERSION, /* MCA module release version */
|
||||
orte_grpcomm_cnos_open, /* module open */
|
||||
orte_grpcomm_cnos_close /* module close */
|
||||
orte_grpcomm_cnos_close, /* module close */
|
||||
orte_grpcomm_cnos_query /* module query */
|
||||
},
|
||||
{
|
||||
/* The component is checkpoint ready */
|
||||
MCA_BASE_METADATA_PARAM_CHECKPOINT
|
||||
},
|
||||
orte_grpcomm_cnos_init, /* component init */
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
@ -77,11 +77,11 @@ int orte_grpcomm_cnos_close(void)
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
||||
orte_grpcomm_base_module_t* orte_grpcomm_cnos_init(int *priority)
|
||||
int orte_grpcomm_cnos_query(mca_base_module_t **module, int *priority)
|
||||
{
|
||||
/* we are the default, so set a low priority so we can be overridden */
|
||||
*priority = 50;
|
||||
|
||||
return &orte_grpcomm_cnos_module;
|
||||
*module = (mca_base_module_t *)&orte_grpcomm_cnos_module;
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
||||
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
x
Ссылка в новой задаче
Block a user