Skip to content

Commit 1846c2d

Browse files
committed
plm/rsh: use an alternate port if the ORTE_NODE_PORT attribute is set
1 parent 40424c9 commit 1846c2d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

orte/mca/plm/rsh/plm_rsh_module.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -990,6 +990,7 @@ static void launch_daemons(int fd, short args, void *cbdata)
990990
orte_plm_rsh_caddy_t *caddy;
991991
opal_list_t coll;
992992
char *username;
993+
int port, *portptr;
993994
orte_namelist_t *child;
994995

995996
/* if we are launching debugger daemons, then just go
@@ -1242,6 +1243,15 @@ static void launch_daemons(int fd, short args, void *cbdata)
12421243
caddy = OBJ_NEW(orte_plm_rsh_caddy_t);
12431244
caddy->argc = argc;
12441245
caddy->argv = opal_argv_copy(argv);
1246+
/* insert the alternate port if any */
1247+
portptr = &port;
1248+
if (orte_get_attribute(&node->attributes, ORTE_NODE_PORT, (void**)&portptr, OPAL_INT)) {
1249+
char portname[16];
1250+
/* for the sake of simplicity, insert "-p" <port> in the duplicated argv */
1251+
opal_argv_insert_element(&caddy->argv, node_name_index1+1, "-p");
1252+
snprintf (portname, 15, "%d", port);
1253+
opal_argv_insert_element(&caddy->argv, node_name_index1+2, portname);
1254+
}
12451255
caddy->daemon = node->daemon;
12461256
OBJ_RETAIN(caddy->daemon);
12471257
opal_list_append(&launch_list, &caddy->super);

0 commit comments

Comments
 (0)