Skip to content

Commit 29899e6

Browse files
committed
orte: only set the ORTE_NODE_ALIAS attribute when required
When there is no alias for a given node, do not set the ORTE_NODE_ALIAS attribute to an empty string any more. Thanks Erico for reporting this issue. Thanks Ralph for the guidance. Signed-off-by: Gilles Gouaillardet <[email protected]> (back-ported from commit a05456a)
1 parent 5e894c4 commit 29899e6

File tree

3 files changed

+19
-13
lines changed

3 files changed

+19
-13
lines changed

orte/mca/ess/hnp/ess_hnp_module.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* Copyright (c) 2011-2017 Los Alamos National Security, LLC. All rights
1616
* reserved.
1717
* Copyright (c) 2013-2018 Intel, Inc. All rights reserved.
18-
* Copyright (c) 2017 Research Organization for Information Science
18+
* Copyright (c) 2017-2018 Research Organization for Information Science
1919
* and Technology (RIST). All rights reserved.
2020
* $COPYRIGHT$
2121
*
@@ -493,12 +493,14 @@ static int rte_init(void)
493493
if (orte_retain_aliases) {
494494
aliases = NULL;
495495
opal_ifgetaliases(&aliases);
496-
/* add our own local name to it */
497-
opal_argv_append_nosize(&aliases, orte_process_info.nodename);
498-
aptr = opal_argv_join(aliases, ',');
496+
if (0 < opal_argv_count(aliases)) {
497+
/* add our own local name to it */
498+
opal_argv_append_nosize(&aliases, orte_process_info.nodename);
499+
aptr = opal_argv_join(aliases, ',');
500+
orte_set_attribute(&node->attributes, ORTE_NODE_ALIAS, ORTE_ATTR_LOCAL, aptr, OPAL_STRING);
501+
free(aptr);
502+
}
499503
opal_argv_free(aliases);
500-
orte_set_attribute(&node->attributes, ORTE_NODE_ALIAS, ORTE_ATTR_LOCAL, aptr, OPAL_STRING);
501-
free(aptr);
502504
}
503505
/* record that the daemon job is running */
504506
jdata->num_procs = 1;

orte/mca/plm/base/plm_base_launch_support.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1170,10 +1170,12 @@ void orte_plm_base_daemon_callback(int status, orte_process_name_t* sender,
11701170
opal_argv_append_nosize(&atmp, alias);
11711171
free(alias);
11721172
}
1173-
alias = opal_argv_join(atmp, ',');
1173+
if (0 < naliases) {
1174+
alias = opal_argv_join(atmp, ',');
1175+
orte_set_attribute(&daemon->node->attributes, ORTE_NODE_ALIAS, ORTE_ATTR_LOCAL, alias, OPAL_STRING);
1176+
free(alias);
1177+
}
11741178
opal_argv_free(atmp);
1175-
orte_set_attribute(&daemon->node->attributes, ORTE_NODE_ALIAS, ORTE_ATTR_LOCAL, alias, OPAL_STRING);
1176-
free(alias);
11771179
}
11781180

11791181
/* unpack the topology signature for that node */

orte/mca/ras/base/ras_base_node.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* Copyright (c) 2011-2017 Los Alamos National Security, LLC. All rights
1313
* reserved.
1414
* Copyright (c) 2014-2017 Intel, Inc. All rights reserved.
15-
* Copyright (c) 2015 Research Organization for Information Science
15+
* Copyright (c) 2015-2018 Research Organization for Information Science
1616
* and Technology (RIST). All rights reserved.
1717
* $COPYRIGHT$
1818
*
@@ -157,10 +157,12 @@ int orte_ras_base_node_insert(opal_list_t* nodes, orte_job_t *jdata)
157157
opal_argv_free(nalias);
158158
}
159159
/* and store the result */
160-
ptr = opal_argv_join(alias, ',');
160+
if (0 < opal_argv_count(alias)) {
161+
ptr = opal_argv_join(alias, ',');
162+
orte_set_attribute(&hnp_node->attributes, ORTE_NODE_ALIAS, ORTE_ATTR_LOCAL, ptr, OPAL_STRING);
163+
free(ptr);
164+
}
161165
opal_argv_free(alias);
162-
orte_set_attribute(&hnp_node->attributes, ORTE_NODE_ALIAS, ORTE_ATTR_LOCAL, ptr, OPAL_STRING);
163-
free(ptr);
164166
}
165167
/* don't keep duplicate copy */
166168
OBJ_RELEASE(node);

0 commit comments

Comments
 (0)