2005-03-14 20:57:21 +00:00
|
|
|
/*
|
2005-11-05 19:57:48 +00:00
|
|
|
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
|
|
|
* University Research and Technology
|
|
|
|
* Corporation. All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
|
|
* of Tennessee Research Foundation. All rights
|
|
|
|
* reserved.
|
2005-03-14 20:57:21 +00:00
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
* University of Stuttgart. All rights reserved.
|
2005-03-24 12:43:37 +00:00
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
2005-03-14 20:57:21 +00:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#include "orte_config.h"
|
|
|
|
|
2006-02-12 01:33:29 +00:00
|
|
|
#include "orte/orte_constants.h"
|
2005-03-14 20:57:21 +00:00
|
|
|
|
2006-02-12 01:33:29 +00:00
|
|
|
#include "opal/mca/mca.h"
|
|
|
|
#include "opal/mca/base/base.h"
|
2005-07-03 23:31:27 +00:00
|
|
|
#include "opal/util/output.h"
|
2006-02-12 01:33:29 +00:00
|
|
|
#include "orte/mca/rds/base/base.h"
|
2005-03-14 20:57:21 +00:00
|
|
|
|
|
|
|
|
|
|
|
OBJ_CLASS_INSTANCE(orte_rds_base_selected_t,
|
2005-07-03 16:22:16 +00:00
|
|
|
opal_list_item_t, NULL, NULL);
|
2005-03-14 20:57:21 +00:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function for selecting all available modules.
|
|
|
|
*/
|
|
|
|
int orte_rds_base_select(void)
|
|
|
|
{
|
2005-07-03 16:22:16 +00:00
|
|
|
opal_list_item_t *item;
|
2005-03-14 20:57:21 +00:00
|
|
|
mca_base_component_list_item_t *cli;
|
|
|
|
orte_rds_base_component_t *component;
|
2005-08-24 10:25:53 +00:00
|
|
|
orte_rds_base_module_t *module = NULL;
|
2005-03-14 20:57:21 +00:00
|
|
|
|
2006-09-14 21:29:51 +00:00
|
|
|
/* if we are using the "null" component, then do nothing */
|
|
|
|
if (orte_rds_base.no_op_selected) {
|
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2005-03-14 20:57:21 +00:00
|
|
|
/* Iterate through all the available components */
|
|
|
|
|
2005-07-03 16:22:16 +00:00
|
|
|
for (item = opal_list_get_first(&orte_rds_base.rds_components);
|
|
|
|
item != opal_list_get_end(&orte_rds_base.rds_components);
|
|
|
|
item = opal_list_get_next(item)) {
|
2005-03-14 20:57:21 +00:00
|
|
|
cli = (mca_base_component_list_item_t *) item;
|
|
|
|
component = (orte_rds_base_component_t *) cli->cli_component;
|
|
|
|
|
|
|
|
/* Call the component's init function and see if it wants to be
|
|
|
|
* selected
|
|
|
|
*/
|
|
|
|
module = component->rds_init();
|
|
|
|
|
|
|
|
/* If we got a non-NULL module back, then the component wants to
|
|
|
|
* be selected.
|
|
|
|
*/
|
|
|
|
if (NULL != module) {
|
|
|
|
orte_rds_base_selected_t* selected = OBJ_NEW(orte_rds_base_selected_t);
|
|
|
|
selected->module = module;
|
|
|
|
selected->component = component;
|
2005-07-03 16:22:16 +00:00
|
|
|
opal_list_append(&orte_rds_base.rds_selected, &selected->super);
|
2005-03-14 20:57:21 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-07-03 16:22:16 +00:00
|
|
|
if (opal_list_is_empty(&orte_rds_base.rds_selected)) {
|
2005-07-03 23:31:27 +00:00
|
|
|
opal_output(orte_rds_base.rds_output,
|
2005-03-14 20:57:21 +00:00
|
|
|
"rda:select: no components available!");
|
|
|
|
return ORTE_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
|
|
|
|