2005-03-14 23:57:21 +03: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.
|
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
* University of Stuttgart. All rights reserved.
|
2005-03-24 15:43:37 +03:00
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
2005-03-14 23:57:21 +03:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
|
|
|
* $HEADER$
|
|
|
|
*
|
|
|
|
* These symbols are in a file by themselves to provide nice linker
|
|
|
|
* semantics. Since linkers generally pull in symbols by object
|
|
|
|
* files, keeping these symbols as the only symbols in this file
|
|
|
|
* prevents utility programs such as "ompi_info" from having to import
|
|
|
|
* entire components just to query their version and parameters.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "ompi_config.h"
|
|
|
|
|
|
|
|
#include "include/orte_constants.h"
|
|
|
|
#include "mca/pls/pls.h"
|
|
|
|
#include "pls_poe.h"
|
2005-04-19 10:39:27 +04:00
|
|
|
#include "util/path.h"
|
2005-07-04 04:13:44 +04:00
|
|
|
#include "opal/util/argv.h"
|
2005-03-14 23:57:21 +03:00
|
|
|
#include "mca/pls/poe/pls-poe-version.h"
|
|
|
|
#include "mca/base/mca_base_param.h"
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Public string showing the pls ompi_poe component version number
|
|
|
|
*/
|
|
|
|
const char *mca_pls_poe_component_version_string =
|
|
|
|
"Open MPI poe pls MCA component version " MCA_pls_poe_VERSION;
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Local variable
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Instantiate the public struct with all of our public information
|
|
|
|
* and pointers to our public functions in it
|
|
|
|
*/
|
|
|
|
|
2005-04-19 10:39:27 +04:00
|
|
|
orte_pls_poe_component_t mca_pls_poe_component = {
|
|
|
|
{
|
2005-03-14 23:57:21 +03:00
|
|
|
/* First, the mca_component_t struct containing meta information
|
|
|
|
about the component itself */
|
|
|
|
|
|
|
|
{
|
|
|
|
/* Indicate that we are a pls v1.0.0 component (which also
|
|
|
|
implies a specific MCA version) */
|
|
|
|
|
|
|
|
ORTE_PLS_BASE_VERSION_1_0_0,
|
|
|
|
|
|
|
|
/* Component name and version */
|
|
|
|
|
|
|
|
"poe",
|
|
|
|
MCA_pls_poe_MAJOR_VERSION,
|
|
|
|
MCA_pls_poe_MINOR_VERSION,
|
|
|
|
MCA_pls_poe_RELEASE_VERSION,
|
|
|
|
|
|
|
|
/* Component open and close functions */
|
|
|
|
|
2005-04-19 10:39:27 +04:00
|
|
|
orte_pls_poe_component_open,
|
2005-03-14 23:57:21 +03:00
|
|
|
NULL
|
|
|
|
},
|
|
|
|
|
|
|
|
/* Next the MCA v1.0.0 component meta data */
|
|
|
|
|
|
|
|
{
|
|
|
|
/* Whether the component is checkpointable or not */
|
|
|
|
|
|
|
|
false
|
|
|
|
},
|
|
|
|
|
|
|
|
/* Initialization / querying functions */
|
|
|
|
|
2005-04-19 10:39:27 +04:00
|
|
|
orte_pls_poe_component_init
|
|
|
|
}
|
2005-03-14 23:57:21 +03:00
|
|
|
};
|
|
|
|
|
2005-05-08 02:48:29 +04:00
|
|
|
/**
|
|
|
|
orte_pls_poe_param_reg_int - register and lookup a integer parameter
|
|
|
|
@param param_name parameter name [INPUT]
|
|
|
|
@param default_value default value [INPUT]
|
|
|
|
@return parameter value
|
|
|
|
*/
|
|
|
|
int orte_pls_poe_param_reg_int(char * param_name, int default_value)
|
|
|
|
{
|
|
|
|
int id, param_value;
|
|
|
|
id = mca_base_param_register_int("pls","poe",param_name,NULL,default_value);
|
|
|
|
param_value = default_value;
|
|
|
|
mca_base_param_lookup_int(id,¶m_value);
|
|
|
|
return param_value;
|
|
|
|
}
|
2005-03-14 23:57:21 +03:00
|
|
|
|
2005-05-08 02:48:29 +04:00
|
|
|
/**
|
|
|
|
orte_pls_poe_param_reg_string - register and lookup a string parameter
|
|
|
|
@param param_name parameter name [INPUT]
|
|
|
|
@param default_value default value [INPUT]
|
|
|
|
@return parameter value
|
|
|
|
*/
|
2005-05-08 07:06:36 +04:00
|
|
|
char* orte_pls_poe_param_reg_string(char* param_name, char* default_value)
|
2005-03-14 23:57:21 +03:00
|
|
|
{
|
2005-05-08 02:48:29 +04:00
|
|
|
char *param_value;
|
|
|
|
int id;
|
|
|
|
id = mca_base_param_register_string("pls","poe",param_name,NULL,default_value);
|
|
|
|
mca_base_param_lookup_string(id, ¶m_value);
|
|
|
|
return param_value;
|
|
|
|
}
|
2005-03-14 23:57:21 +03:00
|
|
|
|
2005-05-08 02:48:29 +04:00
|
|
|
/**
|
|
|
|
orte_pls_poe_component_open - open component and register all parameters
|
|
|
|
@return error number
|
|
|
|
*/
|
|
|
|
int orte_pls_poe_component_open(void)
|
|
|
|
{
|
2005-05-08 07:06:36 +04:00
|
|
|
char *param;
|
|
|
|
|
2005-05-21 10:35:45 +04:00
|
|
|
mca_pls_poe_component.mp_retry = orte_pls_poe_param_reg_int("mp_retry", 0);
|
|
|
|
mca_pls_poe_component.mp_retrycount = orte_pls_poe_param_reg_int("mp_retrycount", 0);
|
|
|
|
mca_pls_poe_component.mp_infolevel = orte_pls_poe_param_reg_int("mp_infolevel", 0);
|
|
|
|
mca_pls_poe_component.mp_labelio = orte_pls_poe_param_reg_string("mp_labelio","no");
|
|
|
|
mca_pls_poe_component.mp_stdoutmode = orte_pls_poe_param_reg_string("mp_stdoutmode","unordered");
|
|
|
|
|
2005-05-08 07:06:36 +04:00
|
|
|
mca_pls_poe_component.debug = orte_pls_poe_param_reg_int("debug",0);
|
2005-05-11 13:09:55 +04:00
|
|
|
mca_pls_poe_component.verbose = orte_pls_poe_param_reg_int("verbose",0);
|
2005-05-08 02:48:29 +04:00
|
|
|
mca_pls_poe_component.priority = orte_pls_poe_param_reg_int("priority", 100);
|
2005-05-09 11:14:58 +04:00
|
|
|
mca_pls_poe_component.orted = orte_pls_poe_param_reg_string("orted","orted");
|
2005-05-11 13:09:55 +04:00
|
|
|
mca_pls_poe_component.class = orte_pls_poe_param_reg_string("class","interactive");
|
2005-05-18 19:55:34 +04:00
|
|
|
mca_pls_poe_component.env = orte_pls_poe_param_reg_string("progenv","env");
|
2005-05-21 10:35:45 +04:00
|
|
|
|
2005-05-18 19:55:34 +04:00
|
|
|
param = orte_pls_poe_param_reg_string("progpoe","poe");
|
2005-07-04 04:13:44 +04:00
|
|
|
mca_pls_poe_component.argv = opal_argv_split(param, ' ');
|
|
|
|
mca_pls_poe_component.argc = opal_argv_count(mca_pls_poe_component.argv);
|
2005-05-08 07:06:36 +04:00
|
|
|
if (mca_pls_poe_component.argc > 0) {
|
|
|
|
mca_pls_poe_component.path = strdup(mca_pls_poe_component.argv[0]);
|
|
|
|
return ORTE_SUCCESS;
|
|
|
|
} else {
|
|
|
|
mca_pls_poe_component.path = NULL;
|
|
|
|
return ORTE_ERR_BAD_PARAM;
|
|
|
|
}
|
2005-03-14 23:57:21 +03:00
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2005-05-08 02:48:29 +04:00
|
|
|
/**
|
|
|
|
orte_pls_poe_component_init - initialize component, check if we can run on this machine.
|
|
|
|
@return error number
|
|
|
|
*/
|
2005-04-19 10:39:27 +04:00
|
|
|
orte_pls_base_module_t *orte_pls_poe_component_init(int *priority)
|
2005-03-14 23:57:21 +03:00
|
|
|
{
|
2005-04-19 10:39:27 +04:00
|
|
|
extern char **environ;
|
2005-05-08 07:06:36 +04:00
|
|
|
mca_pls_poe_component.path = ompi_path_findv(mca_pls_poe_component.argv[0], 0, environ, NULL);
|
2005-04-19 10:39:27 +04:00
|
|
|
if (NULL == mca_pls_poe_component.path) {
|
|
|
|
return NULL;
|
|
|
|
}
|
2005-05-18 19:55:34 +04:00
|
|
|
mca_pls_poe_component.env = ompi_path_findv(mca_pls_poe_component.env, 0, environ, NULL);
|
|
|
|
if (NULL == mca_pls_poe_component.env) {
|
|
|
|
return NULL;
|
|
|
|
}
|
2005-04-19 10:39:27 +04:00
|
|
|
*priority = mca_pls_poe_component.priority;
|
|
|
|
return &orte_pls_poe_module;
|
2005-03-14 23:57:21 +03:00
|
|
|
}
|