From 25359b19fdae981dd9a4c2751e809df2492fce0c Mon Sep 17 00:00:00 2001
From: Danny Auble <da@schedmd.com>
Date: Fri, 30 Nov 2012 12:08:09 -0800
Subject: [PATCH] Minor changes to the way launch settings are looked at.

---
 src/sattach/sattach.c    | 4 ++--
 src/sbcast/sbcast.c      | 8 ++++++++
 src/scancel/opt.c        | 4 ++--
 src/slurmctld/job_mgr.c  | 4 ++--
 src/slurmctld/step_mgr.c | 8 ++++----
 5 files changed, 18 insertions(+), 10 deletions(-)

diff --git a/src/sattach/sattach.c b/src/sattach/sattach.c
index a56e28a81a5..3e2904d9404 100644
--- a/src/sattach/sattach.c
+++ b/src/sattach/sattach.c
@@ -140,8 +140,8 @@ int sattach(int argc, char *argv[])
 		log_alter(logopt, 0, NULL);
 	}
 	launch_type = slurm_get_launch_type();
-	if (launch_type && !strcmp(launch_type, "launch/poe")) {
-		error("sattach does not support LaunchType=launch/poe");
+	if (launch_type && strcmp(launch_type, "launch/slurm")) {
+		error("sattach does not support LaunchType=%s", launch_type);
 		exit(error_exit);
 	}
 	xfree(launch_type);
diff --git a/src/sbcast/sbcast.c b/src/sbcast/sbcast.c
index b53d45564b6..b1290422693 100644
--- a/src/sbcast/sbcast.c
+++ b/src/sbcast/sbcast.c
@@ -76,6 +76,14 @@ int main(int argc, char *argv[])
 	log_options_t opts = LOG_OPTS_STDERR_ONLY;
 	log_init("sbcast", opts, SYSLOG_FACILITY_DAEMON, NULL);
 
+#ifdef HAVE_CRAY
+	error("The sbcast command is not supported on Cray systems");
+	return 1;
+#endif
+#ifdef HAVE_BG
+	error("The sbcast command is not supported on IBM BlueGene systems");
+	return 1;
+#endif
 	parse_command_line(argc, argv);
 	if (params.verbose) {
 		opts.stderr_level += params.verbose;
diff --git a/src/scancel/opt.c b/src/scancel/opt.c
index d1c94a4222c..9531f3044ae 100644
--- a/src/scancel/opt.c
+++ b/src/scancel/opt.c
@@ -213,8 +213,8 @@ static void _opt_default(void)
 #else
 {
 	char *launch_type = slurm_get_launch_type();
-	if (!strcmp(launch_type, "launch/poe") ||
-	    !strcmp(launch_type, "launch/aprun"))
+	/* do this for all but slurm (poe, aprun, etc...) */
+	if (strcmp(launch_type, "launch/slurm"))
 		opt.ctld	= true;
 	else
 		opt.ctld	= false;
diff --git a/src/slurmctld/job_mgr.c b/src/slurmctld/job_mgr.c
index 89239068d1a..e516592bb35 100644
--- a/src/slurmctld/job_mgr.c
+++ b/src/slurmctld/job_mgr.c
@@ -8694,8 +8694,8 @@ static void _signal_job(struct job_record *job_ptr, int signal)
 
 	if (notify_srun_static == -1) {
 		char *launch_type = slurm_get_launch_type();
-		if (!strcmp(launch_type, "launch/aprun") ||
-		    !strcmp(launch_type, "launch/poe"))
+		/* do this for all but slurm (poe, aprun, etc...) */
+		if (strcmp(launch_type, "launch/slurm"))
 			notify_srun_static = 1;
 		else
 			notify_srun_static = 0;
diff --git a/src/slurmctld/step_mgr.c b/src/slurmctld/step_mgr.c
index 0c3c275a788..939c4eff05d 100644
--- a/src/slurmctld/step_mgr.c
+++ b/src/slurmctld/step_mgr.c
@@ -350,8 +350,8 @@ int job_step_signal(uint32_t job_id, uint32_t step_id,
 	static int notify_srun = -1;
 	if (notify_srun == -1) {
 		char *launch_type = slurm_get_launch_type();
-		if (!strcmp(launch_type, "launch/aprun") ||
-		    !strcmp(launch_type, "launch/poe")) {
+		/* do this for all but slurm (poe, aprun, etc...) */
+		if (strcmp(launch_type, "launch/slurm")) {
 			notify_srun = 1;
 			notify_slurmd = false;
 		} else
@@ -3303,8 +3303,8 @@ static void _signal_step_timelimit(struct job_record *job_ptr,
 		notify_srun = 1;
 #else
 		char *launch_type = slurm_get_launch_type();
-		if (!strcmp(launch_type, "launch/aprun") ||
-		    !strcmp(launch_type, "launch/poe"))
+		/* do this for all but slurm (poe, aprun, etc...) */
+		if (strcmp(launch_type, "launch/slurm"))
 			notify_srun = 1;
 		else
 			notify_srun = 0;
-- 
GitLab