1
1

Merge pull request #2225 from ggouaillardet/topic/port_in_hostfile

add support for port=<port> in a hostfile for plm/rsh
Этот коммит содержится в:
rhc54 2016-10-19 10:26:01 -05:00 коммит произвёл GitHub
родитель e78fcc4db9 1846c2d8ad
Коммит 4237f1192e
7 изменённых файлов: 42 добавлений и 3 удалений

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

@ -990,6 +990,7 @@ static void launch_daemons(int fd, short args, void *cbdata)
orte_plm_rsh_caddy_t *caddy;
opal_list_t coll;
char *username;
int port, *portptr;
orte_namelist_t *child;
/* if we are launching debugger daemons, then just go
@ -1242,6 +1243,15 @@ static void launch_daemons(int fd, short args, void *cbdata)
caddy = OBJ_NEW(orte_plm_rsh_caddy_t);
caddy->argc = argc;
caddy->argv = opal_argv_copy(argv);
/* insert the alternate port if any */
portptr = &port;
if (orte_get_attribute(&node->attributes, ORTE_NODE_PORT, (void**)&portptr, OPAL_INT)) {
char portname[16];
/* for the sake of simplicity, insert "-p" <port> in the duplicated argv */
opal_argv_insert_element(&caddy->argv, node_name_index1+1, "-p");
snprintf (portname, 15, "%d", port);
opal_argv_insert_element(&caddy->argv, node_name_index1+2, portname);
}
caddy->daemon = node->daemon;
OBJ_RETAIN(caddy->daemon);
opal_list_append(&launch_list, &caddy->super);

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

@ -1,6 +1,6 @@
/*
* Copyright (c) 2014-2016 Intel, Inc. All rights reserved
* Copyright (c) 2014 Research Organization for Information Science
* Copyright (c) 2014-2016 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
@ -173,6 +173,8 @@ const char *orte_attr_key_to_str(orte_attribute_key_t key)
case ORTE_NODE_USERNAME:
return "NODE-USERNAME";
case ORTE_NODE_PORT:
return "NODE-PORT";
case ORTE_NODE_LAUNCH_ID:
return "NODE-LAUNCHID";
case ORTE_NODE_HOSTID:

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

@ -1,5 +1,7 @@
/*
* Copyright (c) 2014-2016 Intel, Inc. All rights reserved
* Copyright (c) 2016 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -68,6 +70,7 @@ typedef uint8_t orte_node_flags_t;
// we need to know the id of our "host" to help any procs on us to determine locality
#define ORTE_NODE_ALIAS (ORTE_NODE_START_KEY + 4) // comma-separate list of alternate names for the node
#define ORTE_NODE_SERIAL_NUMBER (ORTE_NODE_START_KEY + 5) // string - serial number: used if node is a coprocessor
#define ORTE_NODE_PORT (ORTE_NODE_START_KEY + 6) // int32 - Alternate port to be passed to plm
#define ORTE_NODE_MAX_KEY 200

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

@ -12,6 +12,8 @@
# All rights reserved.
# Copyright (c) 2012 Los Alamos National Security, LLC
# All rights reserved.
# Copyright (c) 2016 Research Organization for Information Science
# and Technology (RIST). All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
@ -24,6 +26,11 @@
Open RTE was unable to open the hostfile:
%s
Check to make sure the path and filename are correct.
[port]
Open RTE detected a bad parameter in the hostfile:
%s
The port parameter is less than 0:
port=%d
[slots]
Open RTE detected a bad parameter in the hostfile:
%s

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

@ -13,7 +13,7 @@
* reserved.
* Copyright (c) 2011 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2013-2014 Intel, Inc. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* Copyright (c) 2015-2016 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2016 IBM Corporation. All rights reserved.
* $COPYRIGHT$
@ -341,6 +341,17 @@ static int hostfile_parse_line(int token, opal_list_t* updates,
}
break;
case ORTE_HOSTFILE_PORT:
rc = hostfile_parse_int();
if (rc < 0) {
orte_show_help("help-hostfile.txt", "port",
true,
cur_hostfile_name, rc);
return ORTE_ERROR;
}
orte_set_attribute(&node->attributes, ORTE_NODE_PORT, ORTE_ATTR_LOCAL, &rc, OPAL_INT);
break;
case ORTE_HOSTFILE_COUNT:
case ORTE_HOSTFILE_CPU:
case ORTE_HOSTFILE_SLOTS:

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

@ -10,6 +10,8 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2016 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2011 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
@ -78,5 +80,6 @@ extern orte_hostfile_value_t orte_util_hostfile_value;
#define ORTE_HOSTFILE_CORES_PER_SOCKET 19
/* ensure we can handle a rank_file input */
#define ORTE_HOSTFILE_RANK 20
#define ORTE_HOSTFILE_PORT 21
#endif

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

@ -14,7 +14,7 @@
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2011 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* Copyright (c) 2015-2016 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
@ -127,6 +127,9 @@ username { orte_util_hostfile_value.sval = yytext;
"user_name" { orte_util_hostfile_value.sval = yytext;
return ORTE_HOSTFILE_USERNAME; }
port { orte_util_hostfile_value.sval = yytext;
return ORTE_HOSTFILE_PORT; }
boards { orte_util_hostfile_value.sval = yytext;
return ORTE_HOSTFILE_BOARDS; }