diff --git a/orte/mca/plm/rsh/plm_rsh_module.c b/orte/mca/plm/rsh/plm_rsh_module.c index 65651fa32b..838ffbca73 100644 --- a/orte/mca/plm/rsh/plm_rsh_module.c +++ b/orte/mca/plm/rsh/plm_rsh_module.c @@ -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" 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); diff --git a/orte/util/attr.c b/orte/util/attr.c index f29cfba83e..39bd7963ad 100644 --- a/orte/util/attr.c +++ b/orte/util/attr.c @@ -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: diff --git a/orte/util/attr.h b/orte/util/attr.h index ca97c1457f..104961ce69 100644 --- a/orte/util/attr.h +++ b/orte/util/attr.h @@ -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 diff --git a/orte/util/hostfile/help-hostfile.txt b/orte/util/hostfile/help-hostfile.txt index 95f819643f..a5b9907478 100644 --- a/orte/util/hostfile/help-hostfile.txt +++ b/orte/util/hostfile/help-hostfile.txt @@ -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 diff --git a/orte/util/hostfile/hostfile.c b/orte/util/hostfile/hostfile.c index 92e5af271d..59bc58280d 100644 --- a/orte/util/hostfile/hostfile.c +++ b/orte/util/hostfile/hostfile.c @@ -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: diff --git a/orte/util/hostfile/hostfile_lex.h b/orte/util/hostfile/hostfile_lex.h index 55831fae0f..39ede75d6a 100644 --- a/orte/util/hostfile/hostfile_lex.h +++ b/orte/util/hostfile/hostfile_lex.h @@ -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 diff --git a/orte/util/hostfile/hostfile_lex.l b/orte/util/hostfile/hostfile_lex.l index cd6d7cccc2..fa14e9d505 100644 --- a/orte/util/hostfile/hostfile_lex.l +++ b/orte/util/hostfile/hostfile_lex.l @@ -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; }