From 6e15aae3160eaa16ae1f2da844051223f0611dd0 Mon Sep 17 00:00:00 2001
From: Danny Auble <da@schedmd.com>
Date: Wed, 7 Nov 2012 17:32:44 -0800
Subject: [PATCH] CRAY - things to make slurm work on new cray stuff

---
 src/plugins/launch/aprun/launch_aprun.c    | 4 +++-
 src/plugins/select/cray/libalps/do_query.c | 2 ++
 src/srun/libsrun/srun_job.c                | 2 +-
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/plugins/launch/aprun/launch_aprun.c b/src/plugins/launch/aprun/launch_aprun.c
index db3e1433216..d19da2c0560 100644
--- a/src/plugins/launch/aprun/launch_aprun.c
+++ b/src/plugins/launch/aprun/launch_aprun.c
@@ -501,7 +501,9 @@ extern int launch_p_setup_srun_opt(char **rest)
 
 extern int launch_p_handle_multi_prog_verify(int command_pos)
 {
-	return 1;
+	if (opt.multi_prog)
+		return 1;
+	return 0;
 }
 
 extern int launch_p_create_job_step(srun_job_t *job, bool use_all_cpus,
diff --git a/src/plugins/select/cray/libalps/do_query.c b/src/plugins/select/cray/libalps/do_query.c
index ff418e333bc..792bc3bbb52 100644
--- a/src/plugins/select/cray/libalps/do_query.c
+++ b/src/plugins/select/cray/libalps/do_query.c
@@ -77,6 +77,8 @@ extern enum basil_version get_basil_version(void)
 		fatal("can not determine ALPS Engine version");
 	else if (strncmp(engine_version, "5.1.0", 5) == 0)
 		bv = BV_5_1;
+	else if (strncmp(engine_version, "5.0.1", 5) == 0)
+		bv = BV_5_0;
 	else if (strncmp(engine_version, "5.0.0", 5) == 0)
 		bv = BV_5_0;
 	else if (strncmp(engine_version, "4.1.0", 5) == 0)
diff --git a/src/srun/libsrun/srun_job.c b/src/srun/libsrun/srun_job.c
index e7af5f1bc02..09a8edebb65 100644
--- a/src/srun/libsrun/srun_job.c
+++ b/src/srun/libsrun/srun_job.c
@@ -530,7 +530,7 @@ extern void create_srun_job(srun_job_t **p_job, bool *got_alloc,
 			exit(error_exit);
 	} else {
 		/* Combined job allocation and job step launch */
-#if defined HAVE_FRONT_END && (!defined HAVE_BG || defined HAVE_BG_L_P || !defined HAVE_BG_FILES)
+#if defined HAVE_FRONT_END && (!defined HAVE_BG || defined HAVE_BG_L_P || !defined HAVE_BG_FILES) && (!defined HAVE_REAL_CRAY)
 		uid_t my_uid = getuid();
 		if ((my_uid != 0) &&
 		    (my_uid != slurm_get_slurm_user_id())) {
-- 
GitLab