diff --git a/orte/mca/ess/alps/ess_alps_module.c b/orte/mca/ess/alps/ess_alps_module.c index 47b43dd92c..c7ae75d42c 100644 --- a/orte/mca/ess/alps/ess_alps_module.c +++ b/orte/mca/ess/alps/ess_alps_module.c @@ -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); diff --git a/orte/mca/ess/env/ess_env_module.c b/orte/mca/ess/env/ess_env_module.c index 764c8bc114..0d5c801790 100644 --- a/orte/mca/ess/env/ess_env_module.c +++ b/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); diff --git a/orte/mca/ess/lsf/ess_lsf_module.c b/orte/mca/ess/lsf/ess_lsf_module.c index b8d942f5ad..2c21a3d409 100644 --- a/orte/mca/ess/lsf/ess_lsf_module.c +++ b/orte/mca/ess/lsf/ess_lsf_module.c @@ -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); diff --git a/orte/mca/plm/rshbase/plm_rshbase_module.c b/orte/mca/plm/rshbase/plm_rshbase_module.c index ec7d04e918..b74788d027 100644 --- a/orte/mca/plm/rshbase/plm_rshbase_module.c +++ b/orte/mca/plm/rshbase/plm_rshbase_module.c @@ -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))) {