Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions orte/mca/ess/base/ess_base_std_orted.c
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,9 @@ int orte_ess_base_orted_setup(void)
error = "construct nidmap";
goto error;
}
/* be sure to update the routing tree so any tree spawn operation
* properly gets the number of children underneath us */
orte_routed.update_routing_plan(NULL);
}

if (orte_static_ports) {
Expand Down
16 changes: 16 additions & 0 deletions orte/util/help-regex.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# All rights reserved.
# Copyright (c) 2014 Research Organization for Information Science
# and Technology (RIST). All rights reserved.
# Copyright (c) 2017 Intel, Inc. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
Expand Down Expand Up @@ -68,3 +69,18 @@ digits in the names:
regexp: %s

Please contact the Open MPI help list for assistance.
#
[regex:invalid-name]
While trying to create a regular expression of the node names
used in this application, the regex parser has detected the
presence of an illegal character in the following node name:

node: %s

Node names must be composed of a combination of ascii letters,
digits, dots, and the hyphen ('-') character. See the following
for an explanation:

https://en.wikipedia.org/wiki/Hostname

Please correct the error and try again.
28 changes: 13 additions & 15 deletions orte/util/nidmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* Copyright (c) 2013-2017 Intel, Inc. All rights reserved.
* Copyright (c) 2014-2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2018 IBM Corporation. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -203,7 +204,7 @@ int orte_util_nidmap_create(opal_pointer_array_t *pool, char **regex)
char *node;
char prefix[ORTE_MAX_NODE_PREFIX];
int i, j, n, len, startnum, nodenum, numdigits;
bool found, fullname;
bool found;
char *suffix, *sfx, *nodenames;
orte_regex_node_t *ndreg;
orte_regex_range_t *range, *rng;
Expand Down Expand Up @@ -264,37 +265,32 @@ int orte_util_nidmap_create(opal_pointer_array_t *pool, char **regex)
}
}
node = nptr->name;
/* determine this node's prefix by looking for first non-alpha char */
fullname = false;
/* determine this node's prefix by looking for first digit char */
len = strlen(node);
startnum = -1;
memset(prefix, 0, ORTE_MAX_NODE_PREFIX);
numdigits = 0;
for (i=0, j=0; i < len; i++) {
if (!isalpha(node[i])) {
/* found a non-alpha char */
if (!isdigit(node[i])) {
/* if it is anything but a digit, we just use
* the entire name
*/
fullname = true;
break;
}
/* valid hostname characters are ascii letters, digits and the '-' character. */
if (isdigit(node[i])) {
/* count the size of the numeric field - but don't
* add the digits to the prefix
*/
numdigits++;
if (startnum < 0) {
/* okay, this defines end of the prefix */
startnum = i;
}
continue;
}
/* this must be either an alpha, a '.', or '-' */
if (!isalpha(node[i]) && '-' != node[i] && '.' != node[i]) {
orte_show_help("help-regex.txt", "regex:invalid-name", true, node);
return ORTE_ERR_SILENT;
}
if (startnum < 0) {
prefix[j++] = node[i];
}
}
if (fullname || startnum < 0) {
if (startnum < 0) {
/* can't compress this name - just add it to the list */
ndreg = OBJ_NEW(orte_regex_node_t);
ndreg->prefix = strdup(node);
Expand All @@ -305,8 +301,10 @@ int orte_util_nidmap_create(opal_pointer_array_t *pool, char **regex)
nodenum = strtol(&node[startnum], &sfx, 10);
if (NULL != sfx) {
suffix = strdup(sfx);
numdigits = (int)(sfx - &node[startnum]);
} else {
suffix = NULL;
numdigits = (int)strlen(&node[startnum]);
}
/* is this node name already on our list? */
found = false;
Expand Down