Merge pull request #7125 from sam6258/smiller_rsh_chdir_v4.0.x
plm/rsh: Add chdir option to change directory before orted exec
Этот коммит содержится в:
Коммит
55527abbc7
@ -12,7 +12,7 @@
|
|||||||
* Copyright (c) 2011 Los Alamos National Security, LLC. All rights
|
* Copyright (c) 2011 Los Alamos National Security, LLC. All rights
|
||||||
* reserved.
|
* reserved.
|
||||||
* Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved.
|
* Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved.
|
||||||
* Copyright (c) 2011 IBM Corporation. All rights reserved.
|
* Copyright (c) 2011-2019 IBM Corporation. All rights reserved.
|
||||||
* Copyright (c) 2015 Intel, Inc. All rights reserved.
|
* Copyright (c) 2015 Intel, Inc. All rights reserved.
|
||||||
* $COPYRIGHT$
|
* $COPYRIGHT$
|
||||||
*
|
*
|
||||||
@ -65,6 +65,7 @@ struct orte_plm_rsh_component_t {
|
|||||||
bool pass_environ_mca_params;
|
bool pass_environ_mca_params;
|
||||||
char *ssh_args;
|
char *ssh_args;
|
||||||
char *pass_libpath;
|
char *pass_libpath;
|
||||||
|
char *chdir;
|
||||||
};
|
};
|
||||||
typedef struct orte_plm_rsh_component_t orte_plm_rsh_component_t;
|
typedef struct orte_plm_rsh_component_t orte_plm_rsh_component_t;
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
* Copyright (c) 2010 Oracle and/or its affiliates. All rights
|
* Copyright (c) 2010 Oracle and/or its affiliates. All rights
|
||||||
* reserved.
|
* reserved.
|
||||||
* Copyright (c) 2009-2016 Cisco Systems, Inc. All rights reserved.
|
* Copyright (c) 2009-2016 Cisco Systems, Inc. All rights reserved.
|
||||||
* Copyright (c) 2011 IBM Corporation. All rights reserved.
|
* Copyright (c) 2011-2019 IBM Corporation. All rights reserved.
|
||||||
* Copyright (c) 2015-2017 Intel, Inc. All rights reserved.
|
* Copyright (c) 2015-2017 Intel, Inc. All rights reserved.
|
||||||
* $COPYRIGHT$
|
* $COPYRIGHT$
|
||||||
*
|
*
|
||||||
@ -222,6 +222,14 @@ static int rsh_component_register(void)
|
|||||||
MCA_BASE_VAR_SCOPE_READONLY,
|
MCA_BASE_VAR_SCOPE_READONLY,
|
||||||
&mca_plm_rsh_component.pass_libpath);
|
&mca_plm_rsh_component.pass_libpath);
|
||||||
|
|
||||||
|
mca_plm_rsh_component.chdir = NULL;
|
||||||
|
(void) mca_base_component_var_register (c, "chdir",
|
||||||
|
"Change working directory after rsh/ssh, but before exec of orted",
|
||||||
|
MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0,
|
||||||
|
OPAL_INFO_LVL_2,
|
||||||
|
MCA_BASE_VAR_SCOPE_READONLY,
|
||||||
|
&mca_plm_rsh_component.chdir);
|
||||||
|
|
||||||
return ORTE_SUCCESS;
|
return ORTE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
* Copyright (c) 2007-2012 Los Alamos National Security, LLC. All rights
|
* Copyright (c) 2007-2012 Los Alamos National Security, LLC. All rights
|
||||||
* reserved.
|
* reserved.
|
||||||
* Copyright (c) 2008-2009 Sun Microsystems, Inc. All rights reserved.
|
* Copyright (c) 2008-2009 Sun Microsystems, Inc. All rights reserved.
|
||||||
* Copyright (c) 2011-2017 IBM Corporation. All rights reserved.
|
* Copyright (c) 2011-2019 IBM Corporation. All rights reserved.
|
||||||
* Copyright (c) 2014-2018 Intel, Inc. All rights reserved.
|
* Copyright (c) 2014-2018 Intel, Inc. All rights reserved.
|
||||||
* Copyright (c) 2015-2018 Research Organization for Information Science
|
* Copyright (c) 2015-2018 Research Organization for Information Science
|
||||||
* and Technology (RIST). All rights reserved.
|
* and Technology (RIST). All rights reserved.
|
||||||
@ -501,10 +501,13 @@ static int setup_launch(int *argcptr, char ***argvptr,
|
|||||||
* we have to insert the orted_prefix in the right place
|
* we have to insert the orted_prefix in the right place
|
||||||
*/
|
*/
|
||||||
(void)asprintf (&final_cmd,
|
(void)asprintf (&final_cmd,
|
||||||
"%s%s%s PATH=%s%s$PATH ; export PATH ; "
|
"%s%s%s%s%s%s PATH=%s%s$PATH ; export PATH ; "
|
||||||
"LD_LIBRARY_PATH=%s%s$LD_LIBRARY_PATH ; export LD_LIBRARY_PATH ; "
|
"LD_LIBRARY_PATH=%s%s$LD_LIBRARY_PATH ; export LD_LIBRARY_PATH ; "
|
||||||
"DYLD_LIBRARY_PATH=%s%s$DYLD_LIBRARY_PATH ; export DYLD_LIBRARY_PATH ; "
|
"DYLD_LIBRARY_PATH=%s%s$DYLD_LIBRARY_PATH ; export DYLD_LIBRARY_PATH ; "
|
||||||
"%s %s",
|
"%s %s",
|
||||||
|
(NULL != mca_plm_rsh_component.chdir ? "cd " : " "),
|
||||||
|
(NULL != mca_plm_rsh_component.chdir ? mca_plm_rsh_component.chdir : " "),
|
||||||
|
(NULL != mca_plm_rsh_component.chdir ? " ; " : " "),
|
||||||
(opal_prefix != NULL ? "OPAL_PREFIX=" : " "),
|
(opal_prefix != NULL ? "OPAL_PREFIX=" : " "),
|
||||||
(opal_prefix != NULL ? opal_prefix : " "),
|
(opal_prefix != NULL ? opal_prefix : " "),
|
||||||
(opal_prefix != NULL ? " ; export OPAL_PREFIX;" : " "),
|
(opal_prefix != NULL ? " ; export OPAL_PREFIX;" : " "),
|
||||||
@ -531,7 +534,7 @@ static int setup_launch(int *argcptr, char ***argvptr,
|
|||||||
* we have to insert the orted_prefix in the right place
|
* we have to insert the orted_prefix in the right place
|
||||||
*/
|
*/
|
||||||
(void)asprintf (&final_cmd,
|
(void)asprintf (&final_cmd,
|
||||||
"%s%s%s set path = ( %s $path ) ; "
|
"%s%s%s%s%s%s set path = ( %s $path ) ; "
|
||||||
"if ( $?LD_LIBRARY_PATH == 1 ) "
|
"if ( $?LD_LIBRARY_PATH == 1 ) "
|
||||||
"set OMPI_have_llp ; "
|
"set OMPI_have_llp ; "
|
||||||
"if ( $?LD_LIBRARY_PATH == 0 ) "
|
"if ( $?LD_LIBRARY_PATH == 0 ) "
|
||||||
@ -545,6 +548,9 @@ static int setup_launch(int *argcptr, char ***argvptr,
|
|||||||
"if ( $?OMPI_have_dllp == 1 ) "
|
"if ( $?OMPI_have_dllp == 1 ) "
|
||||||
"setenv DYLD_LIBRARY_PATH %s%s$DYLD_LIBRARY_PATH ; "
|
"setenv DYLD_LIBRARY_PATH %s%s$DYLD_LIBRARY_PATH ; "
|
||||||
"%s %s",
|
"%s %s",
|
||||||
|
(NULL != mca_plm_rsh_component.chdir ? "cd " : " "),
|
||||||
|
(NULL != mca_plm_rsh_component.chdir ? mca_plm_rsh_component.chdir : " "),
|
||||||
|
(NULL != mca_plm_rsh_component.chdir ? " ; " : " "),
|
||||||
(opal_prefix != NULL ? "setenv OPAL_PREFIX " : " "),
|
(opal_prefix != NULL ? "setenv OPAL_PREFIX " : " "),
|
||||||
(opal_prefix != NULL ? opal_prefix : " "),
|
(opal_prefix != NULL ? opal_prefix : " "),
|
||||||
(opal_prefix != NULL ? " ;" : " "),
|
(opal_prefix != NULL ? " ;" : " "),
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user