Skip to content

Commit 2b1abad

Browse files
committed
ras/slurm: Fix !orte_keep_fqdn_hostnames for Slurm
Signed-off-by: Joshua Hursey <jhursey@us.ibm.com> (cherry picked from commit ed5268a) Signed-off-by: Joshua Hursey <jhursey@us.ibm.com>
1 parent ad18ba5 commit 2b1abad

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

orte/mca/ras/slurm/ras_slurm_module.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
* Copyright (c) 2013-2014 Intel, Inc. All rights reserved.
1616
* Copyright (c) 2015 Research Organization for Information Science
1717
* and Technology (RIST). All rights reserved.
18+
* Copyright (c) 2016 IBM Corporation. All rights reserved.
1819
* $COPYRIGHT$
1920
*
2021
* Additional copyrights may follow
@@ -405,6 +406,7 @@ static int orte_ras_slurm_discover(char *regexp, char *tasks_per_node,
405406
int *slots;
406407
bool found_range = false;
407408
bool more_to_come = false;
409+
char *ptr;
408410

409411
orig = base = strdup(regexp);
410412
if (NULL == base) {
@@ -568,6 +570,12 @@ static int orte_ras_slurm_discover(char *regexp, char *tasks_per_node,
568570
for (i = 0; NULL != names && NULL != names[i]; ++i) {
569571
orte_node_t *node;
570572

573+
if( !orte_keep_fqdn_hostnames && !opal_net_isaddr(names[i]) ) {
574+
if (NULL != (ptr = strchr(names[i], '.'))) {
575+
*ptr = '\0';
576+
}
577+
}
578+
571579
OPAL_OUTPUT_VERBOSE((1, orte_ras_base_framework.framework_output,
572580
"%s ras:slurm:allocate:discover: adding node %s (%d slot%s)",
573581
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),

0 commit comments

Comments
 (0)