10
10
* Copyright (c) 2004-2005 The Regents of the University of California.
11
11
* All rights reserved.
12
12
* Copyright (c) 2008-2011 Cisco Systems, Inc. All rights reserved.
13
+ * Copyright (c) 2017 Intel, Inc. All rights reserved.
13
14
* $COPYRIGHT$
14
15
*
15
16
* Additional copyrights may follow
35
36
#include "opal/dss/dss.h"
36
37
37
38
#include "orte/util/proc_info.h"
39
+ #include "orte/util/regex.h"
38
40
#include "orte/util/show_help.h"
39
41
#include "orte/mca/errmgr/errmgr.h"
40
42
#include "orte/util/name_fns.h"
@@ -66,7 +68,6 @@ static int rte_init(void)
66
68
int ret ;
67
69
char * error = NULL ;
68
70
char * * hosts = NULL ;
69
- char * nodelist ;
70
71
71
72
/* run the prolog */
72
73
if (ORTE_SUCCESS != (ret = orte_ess_base_std_prolog ())) {
@@ -81,12 +82,14 @@ static int rte_init(void)
81
82
* default procedure
82
83
*/
83
84
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
+ }
90
93
}
91
94
if (ORTE_SUCCESS != (ret = orte_ess_base_orted_setup (hosts ))) {
92
95
ORTE_ERROR_LOG (ret );
@@ -112,7 +115,7 @@ static int rte_init(void)
112
115
error = "ess_error" ;
113
116
ret = ORTE_ERROR ;
114
117
115
- error :
118
+ error :
116
119
if (ORTE_ERR_SILENT != ret && !orte_report_silent_errors ) {
117
120
orte_show_help ("help-orte-runtime.txt" ,
118
121
"orte_init:startup:internal-failure" ,
0 commit comments