1
1

Make sure we create a valid parth argument for execve.

This gets SGE working in the trunk again.

This commit was SVN r20531.
Этот коммит содержится в:
Rolf vandeVaart 2009-02-12 18:27:40 +00:00
родитель a0248f736c
Коммит ce97c27a53

Просмотреть файл

@ -11,7 +11,7 @@
* All rights reserved. * All rights reserved.
* Copyright (c) 2007 Los Alamos National Security, LLC. All rights * Copyright (c) 2007 Los Alamos National Security, LLC. All rights
* reserved. * reserved.
* Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved. * Copyright (c) 2008-2009 Sun Microsystems, Inc. All rights reserved.
* Copyright (c) 2009 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2009 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$ * $COPYRIGHT$
* *
@ -147,24 +147,25 @@ int orte_plm_rsh_component_query(mca_base_module_t **module, int *priority)
{ {
char *tmp; char *tmp;
/* To be absolutely sure that we are under an SGE parallel env */ /* Check if we are under SGE parallel environment by looking at several
* environment variables. If so, setup the path and argv[0]. */
if (!mca_plm_rsh_component.disable_qrsh && if (!mca_plm_rsh_component.disable_qrsh &&
NULL != getenv("SGE_ROOT") && NULL != getenv("ARC") && NULL != getenv("SGE_ROOT") && NULL != getenv("ARC") &&
NULL != getenv("PE_HOSTFILE") && NULL != getenv("JOB_ID")) { NULL != getenv("PE_HOSTFILE") && NULL != getenv("JOB_ID")) {
/* setting exec_argv and exec_path for qrsh */ /* setting rsh_agent_path and rsh_agent_argv[0] for qrsh */
asprintf(&orte_plm_globals.rsh_agent_path, "%s/bin/%s", getenv("SGE_ROOT"), getenv("ARC")); asprintf(&orte_plm_globals.rsh_agent_path, "%s/bin/%s/qrsh",
asprintf(&tmp, "%s/bin/%s/qrsh", getenv("SGE_ROOT"), getenv("ARC")); getenv("SGE_ROOT"), getenv("ARC"));
orte_plm_globals.rsh_agent_argv = NULL; orte_plm_globals.rsh_agent_argv = NULL;
opal_argv_append_nosize(&orte_plm_globals.rsh_agent_argv, tmp); opal_argv_append_nosize(&orte_plm_globals.rsh_agent_argv,
free(tmp); orte_plm_globals.rsh_agent_path);
/* double check that we have access and permissions for the qrsh agent */ /* double check that we have access and permissions for the qrsh agent */
if (NULL == opal_path_findv(orte_plm_globals.rsh_agent_argv[0], X_OK, if (NULL == opal_path_findv(orte_plm_globals.rsh_agent_argv[0], X_OK,
environ, NULL)) { environ, NULL)) {
OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, opal_output_verbose(1, orte_plm_globals.output,
"%s plm:rsh: unable to be used: cannot find path " "%s plm:rsh: unable to be used: cannot find path "
"or execution permissions not set for launching agent \"%s\"\n", "or execution permissions not set for launching agent \"%s\"\n",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
orte_plm_globals.rsh_agent_argv[0])); orte_plm_globals.rsh_agent_argv[0]);
*module = NULL; *module = NULL;
return ORTE_ERROR; return ORTE_ERROR;
} }