Skip to content

Commit 6f227f8

Browse files
author
Ralph Castain
committed
Add the ability to pass args to the rsh/ssh command line
1 parent c869490 commit 6f227f8

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

orte/mca/plm/rsh/plm_rsh.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* reserved.
1414
* Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved.
1515
* Copyright (c) 2011 IBM Corporation. All rights reserved.
16+
* Copyright (c) 2015 Intel, Inc. All rights reserved.
1617
* $COPYRIGHT$
1718
*
1819
* Additional copyrights may follow
@@ -62,6 +63,7 @@ struct orte_plm_rsh_component_t {
6263
char *agent;
6364
bool assume_same_shell;
6465
bool pass_environ_mca_params;
66+
char *ssh_args;
6567
};
6668
typedef struct orte_plm_rsh_component_t orte_plm_rsh_component_t;
6769

orte/mca/plm/rsh/plm_rsh_component.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* reserved.
1717
* Copyright (c) 2009-2015 Cisco Systems, Inc. All rights reserved.
1818
* Copyright (c) 2011 IBM Corporation. All rights reserved.
19+
* Copyright (c) 2015 Intel, Inc. All rights reserved.
1920
* $COPYRIGHT$
2021
*
2122
* Additional copyrights may follow
@@ -201,6 +202,13 @@ static int rsh_component_register(void)
201202
OPAL_INFO_LVL_9,
202203
MCA_BASE_VAR_SCOPE_READONLY,
203204
&mca_plm_rsh_component.pass_environ_mca_params);
205+
mca_plm_rsh_component.ssh_args = NULL;
206+
(void) mca_base_component_var_register (c, "args",
207+
"Arguments to add to rsh/ssh",
208+
MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0,
209+
OPAL_INFO_LVL_9,
210+
MCA_BASE_VAR_SCOPE_READONLY,
211+
& mca_plm_rsh_component.ssh_args);
204212

205213
return ORTE_SUCCESS;
206214
}

orte/mca/plm/rsh/plm_rsh_module.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* reserved.
1515
* Copyright (c) 2008-2009 Sun Microsystems, Inc. All rights reserved.
1616
* Copyright (c) 2011 IBM Corporation. All rights reserved.
17-
* Copyright (c) 2014 Intel Corporation. All rights reserved.
17+
* Copyright (c) 2014-2015 Intel Corporation. All rights reserved.
1818
* Copyright (c) 2015 Research Organization for Information Science
1919
* and Technology (RIST). All rights reserved.
2020
* $COPYRIGHT$
@@ -372,6 +372,15 @@ static int setup_launch(int *argcptr, char ***argvptr,
372372
*/
373373
argv = opal_argv_copy(rsh_agent_argv);
374374
argc = opal_argv_count(rsh_agent_argv);
375+
/* if any ssh args were provided, now is the time to add them */
376+
if (NULL != mca_plm_rsh_component.ssh_args) {
377+
char **ssh_argv;
378+
ssh_argv = opal_argv_split(mca_plm_rsh_component.ssh_args, ' ');
379+
for (i=0; NULL != ssh_argv[i]; i++) {
380+
opal_argv_append(&argc, &argv, ssh_argv[i]);
381+
}
382+
opal_argv_free(ssh_argv);
383+
}
375384
*node_name_index1 = argc;
376385
opal_argv_append(&argc, &argv, "<template>");
377386

0 commit comments

Comments
 (0)