1
1

Extend regex support to a bigger audience

This commit was SVN r25046.
Этот коммит содержится в:
Ralph Castain 2011-08-12 21:02:48 +00:00
родитель ea4e2c2db4
Коммит ca3d29a1e6
4 изменённых файлов: 36 добавлений и 35 удалений

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

@ -34,6 +34,7 @@
#include "orte/mca/errmgr/base/base.h"
#include "orte/util/name_fns.h"
#include "orte/util/nidmap.h"
#include "orte/util/regex.h"
#include "orte/runtime/orte_globals.h"
#include "orte/mca/ess/ess.h"
@ -79,7 +80,6 @@ static int rte_init(void)
int ret;
char *error = NULL;
char **hosts = NULL;
char *nodelist;
/* run the prolog */
if (ORTE_SUCCESS != (ret = orte_ess_base_std_prolog())) {
@ -94,12 +94,12 @@ static int rte_init(void)
* default procedure
*/
if (ORTE_PROC_IS_DAEMON) {
/* get the list of nodes used for this job */
nodelist = getenv("OMPI_MCA_orte_nodelist");
if (NULL != nodelist) {
/* split the node list into an argv array */
hosts = opal_argv_split(nodelist, ',');
if (NULL != orte_node_regex) {
/* extract the nodes */
if (ORTE_SUCCESS != (ret = orte_regex_extract_node_names(orte_node_regex, &hosts))) {
error = "orte_regex_extract_node_names";
goto error;
}
}
if (ORTE_SUCCESS != (ret = orte_ess_base_orted_setup(hosts))) {
ORTE_ERROR_LOG(ret);

14
orte/mca/ess/env/ess_env_module.c поставляемый
Просмотреть файл

@ -64,6 +64,7 @@
#include "orte/util/session_dir.h"
#include "orte/util/name_fns.h"
#include "orte/util/nidmap.h"
#include "orte/util/regex.h"
#include "orte/runtime/runtime.h"
#include "orte/runtime/orte_wait.h"
@ -120,7 +121,6 @@ static int rte_init(void)
int ret;
char *error = NULL;
char **hosts = NULL;
char *nodelist;
/* run the prolog */
if (ORTE_SUCCESS != (ret = orte_ess_base_std_prolog())) {
@ -135,12 +135,12 @@ static int rte_init(void)
* default procedure
*/
if (ORTE_PROC_IS_DAEMON) {
/* get the list of nodes used for this job */
nodelist = getenv("OMPI_MCA_orte_nodelist");
if (NULL != nodelist) {
/* split the node list into an argv array */
hosts = opal_argv_split(nodelist, ',');
if (NULL != orte_node_regex) {
/* extract the nodes */
if (ORTE_SUCCESS != (ret = orte_regex_extract_node_names(orte_node_regex, &hosts))) {
error = "orte_regex_extract_node_names";
goto error;
}
}
if (ORTE_SUCCESS != (ret = orte_ess_base_orted_setup(hosts))) {
ORTE_ERROR_LOG(ret);

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

@ -41,6 +41,7 @@
#include "opal/mca/base/mca_base_param.h"
#include "orte/mca/errmgr/errmgr.h"
#include "orte/util/nidmap.h"
#include "orte/util/regex.h"
#include "orte/mca/ess/ess.h"
#include "orte/mca/ess/base/base.h"
@ -85,7 +86,6 @@ static int rte_init(void)
int ret;
char *error = NULL;
char **hosts = NULL;
char *nodelist;
/* run the prolog */
if (ORTE_SUCCESS != (ret = orte_ess_base_std_prolog())) {
@ -100,12 +100,12 @@ static int rte_init(void)
* default procedure
*/
if (ORTE_PROC_IS_DAEMON) {
/* get the list of nodes used for this job */
nodelist = getenv("OMPI_MCA_orte_nodelist");
if (NULL != nodelist) {
/* split the node list into an argv array */
hosts = opal_argv_split(nodelist, ',');
if (NULL != orte_node_regex) {
/* extract the nodes */
if (ORTE_SUCCESS != (ret = orte_regex_extract_node_names(orte_node_regex, &hosts))) {
error = "orte_regex_extract_node_names";
goto error;
}
}
if (ORTE_SUCCESS != (ret = orte_ess_base_orted_setup(hosts))) {
ORTE_ERROR_LOG(ret);

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

@ -323,6 +323,21 @@ static int spawn(orte_job_t *jdata)
* doing this.
*/
app = (orte_app_context_t*)opal_pointer_array_get_item(jdata->apps, 0);
/* if we are using static ports, then setup a string showing the
* nodes so we can use a regex to pass connection info
*/
if (orte_static_ports) {
for (nnode=0; nnode < map->nodes->size; nnode++) {
if (NULL == (node = (orte_node_t*)opal_pointer_array_get_item(map->nodes, nnode))) {
continue;
}
opal_argv_append_nosize(&nodes, node->name);
}
nodelist = opal_argv_join(nodes, ',');
opal_argv_free(nodes);
}
/* we also need at least one node name so we can check what shell is
* being used, if we have to
*/
@ -339,20 +354,6 @@ static int spawn(orte_job_t *jdata)
}
prefix_dir = app->prefix_dir;
/* if we are using static ports, then setup a string showing the
* nodes so we can use a regex to pass connection info
*/
if (orte_static_ports) {
for (nnode=0; nnode < map->nodes->size; nnode++) {
if (NULL == (node = (orte_node_t*)opal_pointer_array_get_item(map->nodes, nnode))) {
continue;
}
opal_argv_append_nosize(&nodes, node->name);
}
nodelist = opal_argv_join(nodes, ',');
opal_argv_free(nodes);
}
/* setup the launch */
if (ORTE_SUCCESS != (rc = orte_plm_base_rsh_setup_launch(&argc, &argv, node->name, &node_name_index1,
&proc_vpid_index, prefix_dir, nodelist))) {