2004-07-02 01:24:53 +00:00
|
|
|
/*
|
2004-11-22 01:38:40 +00:00
|
|
|
* Copyright (c) 2004-2005 The Trustees of Indiana University.
|
|
|
|
* All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
|
|
|
* All rights reserved.
|
2004-11-28 20:09:25 +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.
|
2004-11-22 01:38:40 +00:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
2004-07-02 01:24:53 +00:00
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2005-03-14 20:57:21 +00:00
|
|
|
#include "orte_config.h"
|
|
|
|
#include "include/orte_constants.h"
|
|
|
|
|
2004-07-02 01:24:53 +00:00
|
|
|
#include "mca/mca.h"
|
|
|
|
#include "mca/base/base.h"
|
2004-09-09 15:23:41 +00:00
|
|
|
#include "mca/base/mca_base_param.h"
|
2005-05-01 00:58:06 +00:00
|
|
|
#include "mca/errmgr/errmgr.h"
|
2004-07-12 02:44:25 +00:00
|
|
|
#include "util/output.h"
|
2005-03-14 20:57:21 +00:00
|
|
|
|
2005-05-01 00:58:06 +00:00
|
|
|
#include "dps/dps.h"
|
|
|
|
|
2004-07-02 01:24:53 +00:00
|
|
|
#include "mca/ns/base/base.h"
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The following file was created by configure. It contains extern
|
|
|
|
* statements and the definition of an array of pointers to each
|
2004-08-02 00:24:22 +00:00
|
|
|
* component's public mca_base_component_t struct.
|
2004-07-02 01:24:53 +00:00
|
|
|
*/
|
|
|
|
|
2004-08-02 00:24:22 +00:00
|
|
|
#include "mca/ns/base/static-components.h"
|
2004-07-02 01:24:53 +00:00
|
|
|
|
2004-07-11 02:31:30 +00:00
|
|
|
/*
|
|
|
|
* globals
|
|
|
|
*/
|
|
|
|
|
2005-03-14 20:57:21 +00:00
|
|
|
orte_process_name_t orte_name_all = {ORTE_CELLID_MAX, ORTE_JOBID_MAX, ORTE_VPID_MAX};
|
|
|
|
|
2004-07-02 01:24:53 +00:00
|
|
|
/*
|
|
|
|
* Global variables
|
|
|
|
*/
|
|
|
|
int mca_ns_base_output = -1;
|
2005-03-14 20:57:21 +00:00
|
|
|
mca_ns_base_module_t orte_ns = {
|
|
|
|
orte_ns_base_module_init_not_available,
|
|
|
|
orte_ns_base_create_cellid_not_available,
|
|
|
|
orte_ns_base_assign_cellid_to_process,
|
|
|
|
orte_ns_base_create_jobid_not_available,
|
|
|
|
orte_ns_base_create_process_name,
|
|
|
|
orte_ns_base_copy_process_name,
|
|
|
|
orte_ns_base_convert_string_to_process_name,
|
|
|
|
orte_ns_base_get_vpid_range_not_available,
|
|
|
|
orte_ns_base_free_name,
|
|
|
|
orte_ns_base_get_proc_name_string,
|
|
|
|
orte_ns_base_get_vpid_string,
|
|
|
|
orte_ns_base_convert_vpid_to_string,
|
|
|
|
orte_ns_base_convert_string_to_vpid,
|
|
|
|
orte_ns_base_get_jobid_string,
|
|
|
|
orte_ns_base_convert_jobid_to_string,
|
|
|
|
orte_ns_base_convert_string_to_jobid,
|
|
|
|
orte_ns_base_get_cellid_string,
|
|
|
|
orte_ns_base_convert_cellid_to_string,
|
|
|
|
orte_ns_base_convert_string_to_cellid,
|
|
|
|
orte_ns_base_get_vpid,
|
|
|
|
orte_ns_base_get_jobid,
|
|
|
|
orte_ns_base_get_cellid,
|
|
|
|
orte_ns_base_compare,
|
|
|
|
orte_ns_base_derive_vpid,
|
|
|
|
orte_ns_base_assign_rml_tag_not_available,
|
2005-05-01 00:54:12 +00:00
|
|
|
orte_ns_base_define_data_type_not_available,
|
2005-03-14 20:57:21 +00:00
|
|
|
orte_ns_base_set_my_name,
|
|
|
|
orte_ns_base_get_peers
|
2004-12-03 21:05:22 +00:00
|
|
|
};
|
2004-07-11 04:34:47 +00:00
|
|
|
bool mca_ns_base_selected = false;
|
|
|
|
ompi_list_t mca_ns_base_components_available;
|
|
|
|
mca_ns_base_component_t mca_ns_base_selected_component;
|
2004-07-02 01:24:53 +00:00
|
|
|
|
|
|
|
|
2004-10-20 18:18:07 +00:00
|
|
|
/* constructor - used to initialize namelist instance */
|
2005-03-14 20:57:21 +00:00
|
|
|
static void orte_name_services_namelist_construct(orte_name_services_namelist_t* list)
|
2004-10-20 18:18:07 +00:00
|
|
|
{
|
|
|
|
list->name = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* destructor - used to free any resources held by instance */
|
2005-03-14 20:57:21 +00:00
|
|
|
static void orte_name_services_namelist_destructor(orte_name_services_namelist_t* list)
|
2004-10-20 18:18:07 +00:00
|
|
|
{
|
|
|
|
if (NULL != list->name) {
|
|
|
|
free(list->name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* define instance of ompi_class_t */
|
|
|
|
OBJ_CLASS_INSTANCE(
|
2005-03-14 20:57:21 +00:00
|
|
|
orte_name_services_namelist_t, /* type name */
|
2004-10-20 18:18:07 +00:00
|
|
|
ompi_list_item_t, /* parent "class" name */
|
2005-03-14 20:57:21 +00:00
|
|
|
orte_name_services_namelist_construct, /* constructor */
|
|
|
|
orte_name_services_namelist_destructor); /* destructor */
|
2004-10-20 18:18:07 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2004-07-02 01:24:53 +00:00
|
|
|
/**
|
2004-07-11 04:34:47 +00:00
|
|
|
* Function for finding and opening either all MCA components, or the one
|
2004-07-02 01:24:53 +00:00
|
|
|
* that was specifically requested via a MCA parameter.
|
|
|
|
*/
|
2005-03-14 20:57:21 +00:00
|
|
|
int orte_ns_base_open(void)
|
2004-07-02 01:24:53 +00:00
|
|
|
{
|
2005-05-01 00:58:06 +00:00
|
|
|
int param, value, rc;
|
|
|
|
orte_data_type_t tmp;
|
2005-03-24 20:23:15 +00:00
|
|
|
|
|
|
|
/* Debugging / verbose output */
|
|
|
|
|
|
|
|
param = mca_base_param_register_int("ns", "base", "verbose",
|
|
|
|
NULL, 0);
|
|
|
|
mca_base_param_lookup_int(param, &value);
|
|
|
|
if (value != 0) {
|
|
|
|
mca_ns_base_output = ompi_output_open(NULL);
|
|
|
|
} else {
|
|
|
|
mca_ns_base_output = -1;
|
|
|
|
}
|
2004-07-12 02:44:25 +00:00
|
|
|
|
2005-05-01 00:58:06 +00:00
|
|
|
/* register the base system types with the DPS */
|
|
|
|
tmp = ORTE_NAME;
|
|
|
|
if (ORTE_SUCCESS != (rc = orte_dps.register_type(orte_ns_base_pack_name,
|
|
|
|
orte_ns_base_unpack_name,
|
|
|
|
"ORTE_NAME", &tmp))) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
|
|
|
|
tmp = ORTE_VPID;
|
|
|
|
if (ORTE_SUCCESS != (rc = orte_dps.register_type(orte_ns_base_pack_vpid,
|
|
|
|
orte_ns_base_unpack_vpid,
|
|
|
|
"ORTE_VPID", &tmp))) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
|
|
|
|
tmp = ORTE_JOBID;
|
|
|
|
if (ORTE_SUCCESS != (rc = orte_dps.register_type(orte_ns_base_pack_jobid,
|
|
|
|
orte_ns_base_unpack_jobid,
|
|
|
|
"ORTE_JOBID", &tmp))) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
|
|
|
|
tmp = ORTE_CELLID;
|
|
|
|
if (ORTE_SUCCESS != (rc = orte_dps.register_type(orte_ns_base_pack_cellid,
|
|
|
|
orte_ns_base_unpack_cellid,
|
|
|
|
"ORTE_CELLID", &tmp))) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
|
2005-03-24 20:23:15 +00:00
|
|
|
/* Open up all available components */
|
2005-04-13 03:19:48 +00:00
|
|
|
|
2005-03-24 20:23:15 +00:00
|
|
|
if (ORTE_SUCCESS !=
|
|
|
|
mca_base_components_open("ns", 0, mca_ns_base_static_components,
|
2005-04-13 03:19:48 +00:00
|
|
|
&mca_ns_base_components_available, true)) {
|
2005-03-24 20:23:15 +00:00
|
|
|
return ORTE_ERROR;
|
|
|
|
}
|
2004-07-12 02:44:25 +00:00
|
|
|
|
2005-03-24 20:23:15 +00:00
|
|
|
/* All done */
|
2004-07-02 01:24:53 +00:00
|
|
|
|
2005-03-24 20:23:15 +00:00
|
|
|
return ORTE_SUCCESS;
|
2004-07-02 01:24:53 +00:00
|
|
|
}
|