1
1

Protect us against the scenario where filem is included in enable-mca-no-build

This commit was SVN r27122.
Этот коммит содержится в:
Ralph Castain 2012-08-23 13:52:06 +00:00
родитель d141d94bd7
Коммит 286c610712
4 изменённых файлов: 126 добавлений и 185 удалений

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

@ -9,6 +9,8 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2012 Los Alamos National Security, LLC.
* All rights reserved
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -20,9 +22,7 @@
#include "orte_config.h"
#if !ORTE_DISABLE_FULL_SUPPORT
#include "orte/mca/rml/rml.h"
#endif
#include "orte/mca/filem/filem.h"
@ -42,7 +42,6 @@ BEGIN_C_DECLS
*/
ORTE_DECLSPEC int orte_filem_base_open(void);
#if !ORTE_DISABLE_FULL_SUPPORT
/*
* cmds for base receive
*/
@ -113,6 +112,10 @@ typedef uint8_t orte_filem_cmd_flag_t;
int orte_filem_base_none_rm_nb( orte_filem_base_request_t *request);
int orte_filem_base_none_wait( orte_filem_base_request_t *request);
int orte_filem_base_none_wait_all( opal_list_t *request_list);
int orte_filem_base_none_preposition_files(opal_list_t *file_set,
orte_filem_completion_cbfunc_t cbfunc,
void *cbdata);
int orte_filem_base_none_link_local_files(orte_job_t *jdata);
/**
* Some utility functions
@ -136,8 +139,6 @@ typedef uint8_t orte_filem_cmd_flag_t;
*/
ORTE_DECLSPEC int orte_filem_base_prepare_request(orte_filem_base_request_t *request, int move_type);
#endif /* ORTE_DISABLE_FULL_SUPPORT */
END_C_DECLS
#endif /* ORTE_FILEM_BASE_H */

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

@ -7,6 +7,8 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2012 Los Alamos National Security, LLC.
* All rights reserved
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -220,6 +222,22 @@ int orte_filem_base_none_wait_all(opal_list_t *request_list)
return ORTE_SUCCESS;
}
int orte_filem_base_none_preposition_files(opal_list_t *file_set,
orte_filem_completion_cbfunc_t cbfunc,
void *cbdata)
{
if (NULL != cbfunc) {
cbfunc(ORTE_SUCCESS, cbdata);
}
return ORTE_SUCCESS;
}
int orte_filem_base_none_link_local_files(orte_job_t *jdata)
{
return ORTE_SUCCESS;
}
/********************
* Utility functions
********************/

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

@ -7,6 +7,8 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2012 Los Alamos National Security, LLC.
* All rights reserved
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -33,12 +35,18 @@
*/
ORTE_DECLSPEC int orte_filem_base_output = -1;
ORTE_DECLSPEC orte_filem_base_module_t orte_filem = {
NULL, /* filem_init */
NULL, /* filem_finalize */
NULL, /* put */
NULL, /* get */
NULL /* rm */
orte_filem_base_module_init,
orte_filem_base_module_finalize,
orte_filem_base_none_put,
orte_filem_base_none_put_nb,
orte_filem_base_none_get,
orte_filem_base_none_get_nb,
orte_filem_base_none_rm,
orte_filem_base_none_rm_nb,
orte_filem_base_none_wait,
orte_filem_base_none_wait_all,
orte_filem_base_none_preposition_files,
orte_filem_base_none_link_local_files
};
opal_list_t orte_filem_base_components_available;
orte_filem_base_component_t orte_filem_base_selected_component;
@ -50,27 +58,10 @@ bool orte_filem_base_is_active = false;
*/
int orte_filem_base_open(void)
{
char *str_value = NULL;
orte_filem_base_output = opal_output_open(NULL);
orte_filem_base_is_active = false;
/*
* Which FileM component to open
* - NULL or "" = auto-select
* - "none" = Empty component
* - ow. select that specific component
*/
mca_base_param_reg_string_name("filem", NULL,
"Which Filem component to use (empty = auto-select)",
false, false,
NULL, &str_value);
if( NULL != str_value ) {
free(str_value);
str_value = NULL;
}
/* Open up all available components */
if (OPAL_SUCCESS !=
mca_base_components_open("filem",

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

@ -7,6 +7,8 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2012 Los Alamos National Security, LLC.
* All rights reserved
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -32,75 +34,11 @@
#include "orte/mca/filem/base/base.h"
static orte_filem_base_component_t none_component = {
{
ORTE_FILEM_BASE_VERSION_2_0_0,
/* Component name and version */
"none",
ORTE_MAJOR_VERSION,
ORTE_MINOR_VERSION,
ORTE_RELEASE_VERSION,
/* Component open and close functions */
orte_filem_base_none_open,
orte_filem_base_none_close,
orte_filem_base_none_query
},
{
/* This component is checkpointable */
MCA_BASE_METADATA_PARAM_CHECKPOINT
},
};
static orte_filem_base_module_t none_module = {
/** Initialization Function */
orte_filem_base_module_init,
/** Finalization Function */
orte_filem_base_module_finalize,
orte_filem_base_none_put,
orte_filem_base_none_put_nb,
orte_filem_base_none_get,
orte_filem_base_none_get_nb,
orte_filem_base_none_rm,
orte_filem_base_none_rm_nb,
orte_filem_base_none_wait,
orte_filem_base_none_wait_all
};
int orte_filem_base_select(void)
{
int exit_status = OPAL_SUCCESS;
int exit_status = ORTE_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 up include list
*/
mca_base_param_reg_string_name("filem", NULL,
"Which FILEM component to use (empty = auto-select)",
false, false,
NULL, &include_list);
/* If we do not have any components to select this is ok. The user likely
* decided not to build with filem components. Just use the none
* component and move on.
*/
if( 0 >= opal_list_get_size(&orte_filem_base_components_available) ||
(NULL != include_list && 0 == strncmp(include_list, "none", strlen("none")) ) ) {
opal_output_verbose(1, orte_filem_base_output,
"filem:select: Warning: Using none component. Some functionality (e.g., --preload-binary) will not work in this mode.");
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;
}
/*
* Select the best component
@ -109,29 +47,22 @@ int orte_filem_base_select(void)
&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;
/* It is okay to not select anything - we'll just retain
* the default none module
*/
return ORTE_SUCCESS;
}
skip_select:
/* Save the winner */
orte_filem_base_selected_component = *best_component;
orte_filem = *best_module;
/* Initialize the winner */
if (NULL != best_module) {
if (OPAL_SUCCESS != orte_filem.filem_init()) {
exit_status = OPAL_ERROR;
goto cleanup;
if (NULL != orte_filem.filem_init) {
if (ORTE_SUCCESS != orte_filem.filem_init()) {
exit_status = ORTE_ERROR;
}
}
cleanup:
if( NULL != include_list ) {
free(include_list);
include_list = NULL;
}
return exit_status;
}