Skip to content

Commit 9643175

Browse files
committed
ras/tm: Fix !orte_keep_fqdn_hostnames for TORQUE
Signed-off-by: Joshua Hursey <[email protected]>
1 parent 8d02a33 commit 9643175

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

orte/mca/ras/tm/ras_tm_module.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
* All rights reserved.
1212
* Copyright (c) 2006 Cisco Systems, Inc. All rights reserved.
1313
* Copyright (c) 2014 Intel, Inc. All rights reserved.
14+
* Copyright (c) 2016 IBM Corporation. All rights reserved.
1415
* $COPYRIGHT$
1516
*
1617
* Additional copyrights may follow
@@ -27,6 +28,7 @@
2728

2829
#include "orte/util/show_help.h"
2930
#include "opal/util/os_path.h"
31+
#include "opal/util/net.h"
3032

3133
#include "orte/mca/errmgr/errmgr.h"
3234
#include "orte/runtime/orte_globals.h"
@@ -127,6 +129,7 @@ static int discover(opal_list_t* nodelist, char *pbs_jobid)
127129
FILE *fp;
128130
char *hostname, *cppn;
129131
int ppn;
132+
char *ptr;
130133

131134
/* Ignore anything that the user already specified -- we're
132135
getting nodes only from TM. */
@@ -168,6 +171,11 @@ static int discover(opal_list_t* nodelist, char *pbs_jobid)
168171

169172
nodeid=0;
170173
while (NULL != (hostname = tm_getline(fp))) {
174+
if( !orte_keep_fqdn_hostnames && !opal_net_isaddr(hostname) ) {
175+
if (NULL != (ptr = strchr(hostname, '.'))) {
176+
*ptr = '\0';
177+
}
178+
}
171179

172180
OPAL_OUTPUT_VERBOSE((1, orte_ras_base_framework.framework_output,
173181
"%s ras:tm:allocate:discover: got hostname %s",

0 commit comments

Comments
 (0)