Skip to content

Commit 617a6e6

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 e327deb commit 617a6e6

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-2017 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
*
@@ -462,12 +462,14 @@ static int rte_init(void)
462462
if (orte_retain_aliases) {
463463
aliases = NULL;
464464
opal_ifgetaliases(&aliases);
465-
/* add our own local name to it */
466-
opal_argv_append_nosize(&aliases, orte_process_info.nodename);
467-
aptr = opal_argv_join(aliases, ',');
465+
if (0 < opal_argv_count(aliases)) {
466+
/* add our own local name to it */
467+
opal_argv_append_nosize(&aliases, orte_process_info.nodename);
468+
aptr = opal_argv_join(aliases, ',');
469+
orte_set_attribute(&node->attributes, ORTE_NODE_ALIAS, ORTE_ATTR_LOCAL, aptr, OPAL_STRING);
470+
free(aptr);
471+
}
468472
opal_argv_free(aliases);
469-
orte_set_attribute(&node->attributes, ORTE_NODE_ALIAS, ORTE_ATTR_LOCAL, aptr, OPAL_STRING);
470-
free(aptr);
471473
}
472474
/* record that the daemon job is running */
473475
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
@@ -1158,10 +1158,12 @@ void orte_plm_base_daemon_callback(int status, orte_process_name_t* sender,
11581158
opal_argv_append_nosize(&atmp, alias);
11591159
free(alias);
11601160
}
1161-
alias = opal_argv_join(atmp, ',');
1161+
if (0 < naliases) {
1162+
alias = opal_argv_join(atmp, ',');
1163+
orte_set_attribute(&daemon->node->attributes, ORTE_NODE_ALIAS, ORTE_ATTR_LOCAL, alias, OPAL_STRING);
1164+
free(alias);
1165+
}
11621166
opal_argv_free(atmp);
1163-
orte_set_attribute(&daemon->node->attributes, ORTE_NODE_ALIAS, ORTE_ATTR_LOCAL, alias, OPAL_STRING);
1164-
free(alias);
11651167
}
11661168

11671169
/* 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)