From f36b9332ab4b34de81ab042300cb42bff3f29bc0 Mon Sep 17 00:00:00 2001 From: Ralph Castain Date: Tue, 3 Feb 2009 20:06:05 +0000 Subject: [PATCH] Pass along the new output-filename and xterm cmd line options to the orteds - otherwise, they won't work in ssh environments. Modify the rsh launcher to add -X to ssh if xterm option was selected. This commit was SVN r20407. --- orte/mca/plm/base/plm_base_launch_support.c | 12 +++++++++ orte/mca/plm/rsh/plm_rsh_component.c | 30 +++++++++++++-------- orte/orted/orted_main.c | 8 ++++++ 3 files changed, 39 insertions(+), 11 deletions(-) diff --git a/orte/mca/plm/base/plm_base_launch_support.c b/orte/mca/plm/base/plm_base_launch_support.c index 0a96ff3c51..e225149a45 100644 --- a/orte/mca/plm/base/plm_base_launch_support.c +++ b/orte/mca/plm/base/plm_base_launch_support.c @@ -1048,6 +1048,18 @@ int orte_plm_base_orted_append_basic_args(int *argc, char ***argv, } } + /* if output-filename was specified, pass that along */ + if (NULL != orte_output_filename) { + opal_argv_append(argc, argv, "--output-filename"); + opal_argv_append(argc, argv, orte_output_filename); + } + + /* if --xterm was specified, pass that along */ + if (NULL != orte_xterm) { + opal_argv_append(argc, argv, "--xterm"); + opal_argv_append(argc, argv, orte_xterm); + } + /* * Pass along the Aggregate MCA Parameter Sets */ diff --git a/orte/mca/plm/rsh/plm_rsh_component.c b/orte/mca/plm/rsh/plm_rsh_component.c index cadfb6c620..6a911d76d4 100644 --- a/orte/mca/plm/rsh/plm_rsh_component.c +++ b/orte/mca/plm/rsh/plm_rsh_component.c @@ -193,20 +193,28 @@ int orte_plm_rsh_component_query(mca_base_module_t **module, int *priority) automatically add "-x" */ bname = opal_basename(mca_plm_rsh_component.agent_argv[0]); - if (NULL != bname && 0 == strcmp(bname, "ssh") - && 0 >= opal_output_get_verbosity(orte_plm_globals.output)) { - for (i = 1; NULL != mca_plm_rsh_component.agent_argv[i]; ++i) { - if (0 == strcasecmp("-x", - mca_plm_rsh_component.agent_argv[i])) { - break; + if (NULL != bname && 0 == strcmp(bname, "ssh")) { + /* if xterm option was given, add '-X' */ + if (NULL != orte_xterm) { + opal_argv_append(&mca_plm_rsh_component.agent_argc, + &mca_plm_rsh_component.agent_argv, "-X"); + } else if (0 >= opal_output_get_verbosity(orte_plm_globals.output)) { + /* if debug was not specified, and the user didn't explicitly + * specify X11 forwarding/non-forwarding, add "-x" + */ + for (i = 1; NULL != mca_plm_rsh_component.agent_argv[i]; ++i) { + if (0 == strcasecmp("-x", + mca_plm_rsh_component.agent_argv[i])) { + break; + } + } + if (NULL == mca_plm_rsh_component.agent_argv[i]) { + opal_argv_append(&mca_plm_rsh_component.agent_argc, + &mca_plm_rsh_component.agent_argv, "-x"); } } - if (NULL == mca_plm_rsh_component.agent_argv[i]) { - opal_argv_append(&mca_plm_rsh_component.agent_argc, - &mca_plm_rsh_component.agent_argv, "-x"); - } } - + /* If the agent is qrsh, then automatically add -inherit * and grid engine PE related flags */ if (NULL != bname && 0 == strcmp(bname, "qrsh")) { diff --git a/orte/orted/orted_main.c b/orte/orted/orted_main.c index 4354322bca..2b50ad5610 100644 --- a/orte/orted/orted_main.c +++ b/orte/orted/orted_main.c @@ -182,6 +182,14 @@ opal_cmd_line_init_t orte_cmd_line_opts[] = { &orted_globals.singleton_died_pipe, OPAL_CMD_LINE_TYPE_INT, "Watch on indicated pipe for singleton termination"}, + { "orte", "output", "filename", '\0', "output-filename", "output-filename", 1, + NULL, OPAL_CMD_LINE_TYPE_STRING, + "Redirect output from application processes into filename.rank" }, + + { "orte", "xterm", NULL, '\0', "xterm", "xterm", 1, + NULL, OPAL_CMD_LINE_TYPE_STRING, + "Create a new xterm window and display output from the specified ranks there" }, + /* End of list */ { NULL, NULL, NULL, '\0', NULL, NULL, 0, NULL, OPAL_CMD_LINE_TYPE_NULL, NULL }