Skip to content

Commit 8230201

Browse files
committed
ras/gridengine: Fix !orte_keep_fqdn_hostnames for GridEngine
Signed-off-by: Joshua Hursey <[email protected]>
1 parent 9643175 commit 8230201

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

orte/mca/ras/gridengine/ras_gridengine_module.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
* Copyright (c) 2004-2005 The Regents of the University of California.
1111
* All rights reserved.
1212
* Copyright (c) 2006-2010 Oracle and/or its affiliates. All rights reserved
13+
* Copyright (c) 2016 IBM Corporation. All rights reserved.
1314
* $COPYRIGHT$
1415
*
1516
* Additional copyrights may follow
@@ -28,6 +29,7 @@
2829
#include <string.h>
2930

3031
#include "opal/util/output.h"
32+
#include "opal/util/net.h"
3133
#include "orte/util/show_help.h"
3234
#include "orte/mca/errmgr/errmgr.h"
3335
#include "orte/runtime/orte_globals.h"
@@ -62,7 +64,7 @@ static int orte_ras_gridengine_allocate(orte_job_t *jdata, opal_list_t *nodelist
6264
{
6365
char *pe_hostfile = getenv("PE_HOSTFILE");
6466
char *job_id = getenv("JOB_ID");
65-
char buf[1024], *tok, *num, *queue, *arch, *ptr;
67+
char buf[1024], *tok, *num, *queue, *arch, *ptr, *tmp;
6668
int rc;
6769
FILE *fp;
6870
orte_node_t *node;
@@ -96,6 +98,12 @@ static int orte_ras_gridengine_allocate(orte_job_t *jdata, opal_list_t *nodelist
9698
queue = strtok_r(NULL, " \n", &tok);
9799
arch = strtok_r(NULL, " \n", &tok);
98100

101+
if( !orte_keep_fqdn_hostnames && !opal_net_isaddr(ptr) ) {
102+
if (NULL != (tmp = strchr(ptr, '.'))) {
103+
*tmp = '\0';
104+
}
105+
}
106+
99107
/* see if we already have this node */
100108
found = false;
101109
for (item = opal_list_get_first(nodelist);

0 commit comments

Comments
 (0)