Skip to content

Commit b1a01d7

Browse files
author
Ralph Castain
committed
Update the TM module to support regex passing
Signed-off-by: Ralph Castain <[email protected]>
1 parent 9410574 commit b1a01d7

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

orte/mca/ess/tm/ess_tm_module.c

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
* Copyright (c) 2004-2005 The Regents of the University of California.
1111
* All rights reserved.
1212
* Copyright (c) 2008-2011 Cisco Systems, Inc. All rights reserved.
13+
* Copyright (c) 2017 Intel, Inc. All rights reserved.
1314
* $COPYRIGHT$
1415
*
1516
* Additional copyrights may follow
@@ -35,6 +36,7 @@
3536
#include "opal/dss/dss.h"
3637

3738
#include "orte/util/proc_info.h"
39+
#include "orte/util/regex.h"
3840
#include "orte/util/show_help.h"
3941
#include "orte/mca/errmgr/errmgr.h"
4042
#include "orte/util/name_fns.h"
@@ -66,7 +68,6 @@ static int rte_init(void)
6668
int ret;
6769
char *error = NULL;
6870
char **hosts = NULL;
69-
char *nodelist;
7071

7172
/* run the prolog */
7273
if (ORTE_SUCCESS != (ret = orte_ess_base_std_prolog())) {
@@ -81,12 +82,14 @@ static int rte_init(void)
8182
* default procedure
8283
*/
8384
if (ORTE_PROC_IS_DAEMON) {
84-
/* get the list of nodes used for this job */
85-
nodelist = getenv(OPAL_MCA_PREFIX"orte_nodelist");
86-
87-
if (NULL != nodelist) {
88-
/* split the node list into an argv array */
89-
hosts = opal_argv_split(nodelist, ',');
85+
if (NULL != orte_node_regex) {
86+
/* extract the nodes */
87+
if (ORTE_SUCCESS != (ret =
88+
orte_regex_extract_node_names(orte_node_regex, &hosts)) ||
89+
NULL == hosts) {
90+
error = "orte_regex_extract_node_names";
91+
goto error;
92+
}
9093
}
9194
if (ORTE_SUCCESS != (ret = orte_ess_base_orted_setup(hosts))) {
9295
ORTE_ERROR_LOG(ret);
@@ -112,7 +115,7 @@ static int rte_init(void)
112115
error = "ess_error";
113116
ret = ORTE_ERROR;
114117

115-
error:
118+
error:
116119
if (ORTE_ERR_SILENT != ret && !orte_report_silent_errors) {
117120
orte_show_help("help-orte-runtime.txt",
118121
"orte_init:startup:internal-failure",

0 commit comments

Comments
 (0)