From 765fc566ba04a97f1c44f77521f534bffefa8873 Mon Sep 17 00:00:00 2001
From: Danny Auble <da@schedmd.com>
Date: Thu, 8 Nov 2012 10:46:49 -0800
Subject: [PATCH] CRAY - fixes to do the right thing with multi-prog

---
 src/plugins/launch/aprun/launch_aprun.c | 17 +++++------------
 1 file changed, 5 insertions(+), 12 deletions(-)

diff --git a/src/plugins/launch/aprun/launch_aprun.c b/src/plugins/launch/aprun/launch_aprun.c
index d19da2c0560..b2d0e6896a8 100644
--- a/src/plugins/launch/aprun/launch_aprun.c
+++ b/src/plugins/launch/aprun/launch_aprun.c
@@ -333,7 +333,7 @@ extern int launch_p_setup_srun_opt(char **rest)
 		opt.argv[command_pos++] = xstrdup_printf("%u", tasks_per_node);
 	}
 
-	if (opt.ntasks) {
+	if (opt.ntasks && !opt.multi_prog) {
 		opt.argc += 2;
 		xrealloc(opt.argv, opt.argc * sizeof(char *));
 		opt.argv[command_pos++] = xstrdup("-n");
@@ -483,19 +483,12 @@ extern int launch_p_setup_srun_opt(char **rest)
 
 	*/
 
-	if (opt.multi_prog)
+	if (opt.multi_prog) {
 		_handle_multi_prog(rest[0], &command_pos);
-
-	if (opt.launch_cmd) {
-		int i = 0;
-		char *cmd_line = NULL;
-
-		while (opt.argv[i])
-			xstrfmtcat(cmd_line, "%s ", opt.argv[i++]);
-		printf("%s\n", cmd_line);
-		xfree(cmd_line);
-		exit(0);
+		/* just so we don't tack on the script to the aprun line */
+		command_pos = opt.argc;
 	}
+
 	return command_pos;
 }
 
-- 
GitLab