1010 * Copyright (c) 2004-2005 The Regents of the University of California.
1111 * All rights reserved.
1212 * Copyright (c) 2006 Cisco Systems, Inc. All rights reserved.
13- * Copyright (c) 2010-2011 IBM Corporation. All rights reserved.
13+ * Copyright (c) 2010-2016 IBM Corporation. All rights reserved.
1414 * $COPYRIGHT$
1515 *
1616 * Additional copyrights may follow
2626
2727#include "opal/util/argv.h"
2828#include "opal/util/output.h"
29+ #include "opal/util/net.h"
2930
3031#include "orte/mca/errmgr/errmgr.h"
3132#include "orte/runtime/orte_globals.h"
@@ -106,6 +107,7 @@ static int orte_ras_loadleveler_discover(opal_list_t* nodelist)
106107 char * hostname ;
107108 char * filename ;
108109 char input [LL_FILE_MAX_LINE_LENGTH ];
110+ char * ptr ;
109111
110112 /* Ignore anything that the user already specified -- we're
111113 getting nodes only from LoadLeveler. */
@@ -125,6 +127,12 @@ static int orte_ras_loadleveler_discover(opal_list_t* nodelist)
125127 /* Iterate through all the nodes and make an entry for each */
126128 while (0 != ll_getline (fp , input )) {
127129 hostname = strdup (input );
130+ if ( !orte_keep_fqdn_hostnames && !opal_net_isaddr (hostname ) ) {
131+ if (NULL != (ptr = strchr (hostname , '.' ))) {
132+ * ptr = '\0' ;
133+ }
134+ }
135+
128136 OPAL_OUTPUT_VERBOSE ((1 , orte_ras_base_framework .framework_output ,
129137 "%s ras:loadleveler:allocate:discover: got hostname %s" ,
130138 ORTE_NAME_PRINT (ORTE_PROC_MY_NAME ), hostname ));
0 commit comments