From 6f227f8564d68e40437cadafe814f59f22ae6d1f Mon Sep 17 00:00:00 2001 From: Ralph Castain Date: Wed, 15 Apr 2015 20:07:13 -0600 Subject: [PATCH 1/2] Add the ability to pass args to the rsh/ssh command line --- orte/mca/plm/rsh/plm_rsh.h | 2 ++ orte/mca/plm/rsh/plm_rsh_component.c | 8 ++++++++ orte/mca/plm/rsh/plm_rsh_module.c | 11 ++++++++++- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/orte/mca/plm/rsh/plm_rsh.h b/orte/mca/plm/rsh/plm_rsh.h index 97adc92fb0..fba2bad650 100644 --- a/orte/mca/plm/rsh/plm_rsh.h +++ b/orte/mca/plm/rsh/plm_rsh.h @@ -13,6 +13,7 @@ * reserved. * Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved. * Copyright (c) 2011 IBM Corporation. All rights reserved. + * Copyright (c) 2015 Intel, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -62,6 +63,7 @@ struct orte_plm_rsh_component_t { char *agent; bool assume_same_shell; bool pass_environ_mca_params; + char *ssh_args; }; typedef struct orte_plm_rsh_component_t orte_plm_rsh_component_t; diff --git a/orte/mca/plm/rsh/plm_rsh_component.c b/orte/mca/plm/rsh/plm_rsh_component.c index 83d2006d11..144b9cb42a 100644 --- a/orte/mca/plm/rsh/plm_rsh_component.c +++ b/orte/mca/plm/rsh/plm_rsh_component.c @@ -16,6 +16,7 @@ * reserved. * Copyright (c) 2009-2015 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2011 IBM Corporation. All rights reserved. + * Copyright (c) 2015 Intel, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -201,6 +202,13 @@ static int rsh_component_register(void) OPAL_INFO_LVL_9, MCA_BASE_VAR_SCOPE_READONLY, &mca_plm_rsh_component.pass_environ_mca_params); + mca_plm_rsh_component.ssh_args = NULL; + (void) mca_base_component_var_register (c, "args", + "Arguments to add to rsh/ssh", + MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0, + OPAL_INFO_LVL_9, + MCA_BASE_VAR_SCOPE_READONLY, + & mca_plm_rsh_component.ssh_args); return ORTE_SUCCESS; } diff --git a/orte/mca/plm/rsh/plm_rsh_module.c b/orte/mca/plm/rsh/plm_rsh_module.c index b508a25ce1..dd483771f7 100644 --- a/orte/mca/plm/rsh/plm_rsh_module.c +++ b/orte/mca/plm/rsh/plm_rsh_module.c @@ -14,7 +14,7 @@ * reserved. * Copyright (c) 2008-2009 Sun Microsystems, Inc. All rights reserved. * Copyright (c) 2011 IBM Corporation. All rights reserved. - * Copyright (c) 2014 Intel Corporation. All rights reserved. + * Copyright (c) 2014-2015 Intel Corporation. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ @@ -372,6 +372,15 @@ static int setup_launch(int *argcptr, char ***argvptr, */ argv = opal_argv_copy(rsh_agent_argv); argc = opal_argv_count(rsh_agent_argv); + /* if any ssh args were provided, now is the time to add them */ + if (NULL != mca_plm_rsh_component.ssh_args) { + char **ssh_argv; + ssh_argv = opal_argv_split(mca_plm_rsh_component.ssh_args, ' '); + for (i=0; NULL != ssh_argv[i]; i++) { + opal_argv_append(&argc, &argv, ssh_argv[i]); + } + opal_argv_free(ssh_argv); + } *node_name_index1 = argc; opal_argv_append(&argc, &argv, "