|  | 
| 15 | 15 |  * Copyright (c) 2008-2009 Sun Microsystems, Inc.  All rights reserved. | 
| 16 | 16 |  * Copyright (c) 2010      Oracle and/or its affiliates.  All rights | 
| 17 | 17 |  *                         reserved. | 
| 18 |  | - * Copyright (c) 2009-2015 Cisco Systems, Inc.  All rights reserved. | 
|  | 18 | + * Copyright (c) 2009-2016 Cisco Systems, Inc.  All rights reserved. | 
| 19 | 19 |  * Copyright (c) 2011      IBM Corporation.  All rights reserved. | 
| 20 | 20 |  * Copyright (c) 2015      Intel, Inc. All rights reserved. | 
| 21 | 21 |  * $COPYRIGHT$ | 
| @@ -70,6 +70,7 @@ static int rsh_launch_agent_lookup(const char *agent_list, char *path); | 
| 70 | 70 | 
 | 
| 71 | 71 | /* Local variables */ | 
| 72 | 72 | static char *mca_plm_rsh_delay_string = NULL; | 
|  | 73 | +static int agent_var_id = -1; | 
| 73 | 74 | 
 | 
| 74 | 75 | /* | 
| 75 | 76 |  * Instantiate the public struct with all of our public information | 
| @@ -186,6 +187,7 @@ static int rsh_component_register(void) | 
| 186 | 187 |                                               &mca_plm_rsh_component.agent); | 
| 187 | 188 |     (void) mca_base_var_register_synonym (var_id, "orte", "pls", NULL, "rsh_agent", MCA_BASE_VAR_SYN_FLAG_DEPRECATED); | 
| 188 | 189 |     (void) mca_base_var_register_synonym (var_id, "orte", "orte", NULL, "rsh_agent", MCA_BASE_VAR_SYN_FLAG_DEPRECATED); | 
|  | 190 | +    agent_var_id = var_id; | 
| 189 | 191 | 
 | 
| 190 | 192 |     mca_plm_rsh_component.assume_same_shell = true; | 
| 191 | 193 |     var_id = mca_base_component_var_register (c, "assume_same_shell", | 
| @@ -261,7 +263,13 @@ static int rsh_component_query(mca_base_module_t **module, int *priority) | 
| 261 | 263 |      * environment variables.  If so, setup the path and argv[0]. | 
| 262 | 264 |      * Note that we allow the user to specify the launch agent | 
| 263 | 265 |      * even if they are in a Grid Engine environment */ | 
| 264 |  | -    if (0 == strcmp(mca_plm_rsh_component.agent, "ssh : rsh")) { | 
|  | 266 | +    int ret; | 
|  | 267 | +    mca_base_var_source_t source; | 
|  | 268 | +    ret = mca_base_var_get_value(agent_var_id, NULL, &source, NULL); | 
|  | 269 | +    if (OPAL_SUCCESS != ret) { | 
|  | 270 | +        return ret; | 
|  | 271 | +    } | 
|  | 272 | +    if (MCA_BASE_VAR_SOURCE_DEFAULT != source) { | 
| 265 | 273 |         if (!mca_plm_rsh_component.disable_qrsh && | 
| 266 | 274 |             NULL != getenv("SGE_ROOT") && NULL != getenv("ARC") && | 
| 267 | 275 |             NULL != getenv("PE_HOSTFILE") && NULL != getenv("JOB_ID")) { | 
|  | 
0 commit comments