diff --git a/orte/mca/plm/rsh/plm_rsh.h b/orte/mca/plm/rsh/plm_rsh.h index 52fac1ba852..61d3ee1fcb6 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,8 @@ struct orte_plm_rsh_component_t { char *agent; bool assume_same_shell; bool pass_environ_mca_params; + char *ssh_args; + char *pass_libpath; }; 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 83d2006d115..09d711bfcd9 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,21 @@ 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); + + mca_plm_rsh_component.pass_libpath = NULL; + (void) mca_base_component_var_register (c, "pass_libpath", + "Prepend the specified library path to the remote shell's LD_LIBRARY_PATH", + MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0, + OPAL_INFO_LVL_9, + MCA_BASE_VAR_SCOPE_READONLY, + &mca_plm_rsh_component.pass_libpath); return ORTE_SUCCESS; } diff --git a/orte/mca/plm/rsh/plm_rsh_module.c b/orte/mca/plm/rsh/plm_rsh_module.c index b508a25ce14..919c937f6e8 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$ @@ -339,7 +339,10 @@ static int setup_launch(int *argcptr, char ***argvptr, int rc; int i, j; bool found; - + char *lib_base=NULL, *bin_base=NULL; + char *opal_prefix = getenv("OPAL_PREFIX"); + char* full_orted_cmd = NULL; + /* Figure out the basenames for the libdir and bindir. This requires some explanation: @@ -372,6 +375,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, "