1
1

ras/lsf: Fix !orte_keep_fqdn_hostnames for LSF

* By default, make sure that we are using the short hostnames and not
   the fully qualified hostnames when running under LSF.
 * Related to commit open-mpi/ompi@d26dd2c20e

Signed-off-by: Joshua Hursey <jhursey@us.ibm.com>
Этот коммит содержится в:
Joshua Hursey 2016-10-21 17:42:05 -04:00
родитель 6074c2a2a9
Коммит 8d02a33639

Просмотреть файл

@ -31,6 +31,7 @@
#include <lsf/lsbatch.h> #include <lsf/lsbatch.h>
#include "opal/util/argv.h" #include "opal/util/argv.h"
#include "opal/util/net.h"
#include "opal/mca/hwloc/hwloc.h" #include "opal/mca/hwloc/hwloc.h"
#include "orte/mca/rmaps/rmaps_types.h" #include "orte/mca/rmaps/rmaps_types.h"
@ -60,31 +61,15 @@ orte_ras_base_module_t orte_ras_lsf_module = {
finalize finalize
}; };
static char *orte_getline(FILE *fp)
{
char *ret, *buff;
char input[1024];
ret = fgets(input, 1024, fp);
if (NULL != ret) {
input[strlen(input)-1] = '\0'; /* remove newline */
buff = strdup(input);
return buff;
}
return NULL;
}
static int allocate(orte_job_t *jdata, opal_list_t *nodes) static int allocate(orte_job_t *jdata, opal_list_t *nodes)
{ {
char **nodelist; char **nodelist;
orte_node_t *node; orte_node_t *node;
int i, num_nodes; int i, num_nodes;
char *affinity_file, *hstname; char *affinity_file;
bool found;
struct stat buf; struct stat buf;
orte_app_context_t *app; char *ptr;
/* get the list of allocated nodes */ /* get the list of allocated nodes */
if ((num_nodes = lsb_getalloc(&nodelist)) < 0) { if ((num_nodes = lsb_getalloc(&nodelist)) < 0) {
@ -96,6 +81,12 @@ static int allocate(orte_job_t *jdata, opal_list_t *nodes)
/* step through the list */ /* step through the list */
for (i = 0; i < num_nodes; i++) { for (i = 0; i < num_nodes; i++) {
if( !orte_keep_fqdn_hostnames && !opal_net_isaddr(nodelist[i]) ) {
if (NULL != (ptr = strchr(nodelist[i], '.'))) {
*ptr = '\0';
}
}
/* is this a repeat of the current node? */ /* is this a repeat of the current node? */
if (NULL != node && 0 == strcmp(nodelist[i], node->name)) { if (NULL != node && 0 == strcmp(nodelist[i], node->name)) {
/* it is a repeat - just bump the slot count */ /* it is a repeat - just bump the slot count */