Skip to content

Commit a05456a

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 <gilles@rist.or.jp>
1 parent 49d6658 commit a05456a

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
*
@@ -505,12 +505,14 @@ static int rte_init(void)
505505
if (orte_retain_aliases) {
506506
aliases = NULL;
507507
opal_ifgetaliases(&aliases);
508-
/* add our own local name to it */
509-
opal_argv_append_nosize(&aliases, orte_process_info.nodename);
510-
aptr = opal_argv_join(aliases, ',');
508+
if (0 < opal_argv_count(aliases)) {
509+
/* add our own local name to it */
510+
opal_argv_append_nosize(&aliases, orte_process_info.nodename);
511+
aptr = opal_argv_join(aliases, ',');
512+
orte_set_attribute(&node->attributes, ORTE_NODE_ALIAS, ORTE_ATTR_LOCAL, aptr, OPAL_STRING);
513+
free(aptr);
514+
}
511515
opal_argv_free(aliases);
512-
orte_set_attribute(&node->attributes, ORTE_NODE_ALIAS, ORTE_ATTR_LOCAL, aptr, OPAL_STRING);
513-
free(aptr);
514516
}
515517
/* record that the daemon job is running */
516518
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
@@ -1124,10 +1124,12 @@ void orte_plm_base_daemon_callback(int status, orte_process_name_t* sender,
11241124
opal_argv_append_nosize(&atmp, alias);
11251125
free(alias);
11261126
}
1127-
alias = opal_argv_join(atmp, ',');
1127+
if (0 < naliases) {
1128+
alias = opal_argv_join(atmp, ',');
1129+
orte_set_attribute(&daemon->node->attributes, ORTE_NODE_ALIAS, ORTE_ATTR_LOCAL, alias, OPAL_STRING);
1130+
free(alias);
1131+
}
11281132
opal_argv_free(atmp);
1129-
orte_set_attribute(&daemon->node->attributes, ORTE_NODE_ALIAS, ORTE_ATTR_LOCAL, alias, OPAL_STRING);
1130-
free(alias);
11311133
}
11321134

11331135
/* 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-2018 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
*
@@ -162,10 +162,12 @@ int orte_ras_base_node_insert(opal_list_t* nodes, orte_job_t *jdata)
162162
opal_argv_free(nalias);
163163
}
164164
/* and store the result */
165-
ptr = opal_argv_join(alias, ',');
165+
if (0 < opal_argv_count(alias)) {
166+
ptr = opal_argv_join(alias, ',');
167+
orte_set_attribute(&hnp_node->attributes, ORTE_NODE_ALIAS, ORTE_ATTR_LOCAL, ptr, OPAL_STRING);
168+
free(ptr);
169+
}
166170
opal_argv_free(alias);
167-
orte_set_attribute(&hnp_node->attributes, ORTE_NODE_ALIAS, ORTE_ATTR_LOCAL, ptr, OPAL_STRING);
168-
free(ptr);
169171
}
170172
/* don't keep duplicate copy */
171173
OBJ_RELEASE(node);

0 commit comments

Comments
 (0)