Skip to content

Commit bed2dc7

Browse files
authored
Merge pull request #5096 from ggouaillardet/topic/v3.1.x/ORTE_NODE_ALIAS
orte: only set the ORTE_NODE_ALIAS attribute when required
2 parents da132d8 + 29899e6 commit bed2dc7

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
@@ -1104,10 +1104,12 @@ void orte_plm_base_daemon_callback(int status, orte_process_name_t* sender,
11041104
opal_argv_append_nosize(&atmp, alias);
11051105
free(alias);
11061106
}
1107-
alias = opal_argv_join(atmp, ',');
1107+
if (0 < naliases) {
1108+
alias = opal_argv_join(atmp, ',');
1109+
orte_set_attribute(&daemon->node->attributes, ORTE_NODE_ALIAS, ORTE_ATTR_LOCAL, alias, OPAL_STRING);
1110+
free(alias);
1111+
}
11081112
opal_argv_free(atmp);
1109-
orte_set_attribute(&daemon->node->attributes, ORTE_NODE_ALIAS, ORTE_ATTR_LOCAL, alias, OPAL_STRING);
1110-
free(alias);
11111113
}
11121114

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