From 1b2a6dc39c6df26a853d266a7a7c7e9570a148ac Mon Sep 17 00:00:00 2001
From: Danny Auble <da@schedmd.com>
Date: Thu, 15 Jun 2017 14:26:36 -0600
Subject: [PATCH] Fix --ntasks-per-core option/environment variable parsing to
 set the requested value, instead of always setting one.

This would make --hint=multithread not work at all.

See Bug 3855 (commit 3c852da1aad431536)

Issue originated from commit 82a959a87ad.
---
 NEWS                   | 2 ++
 src/srun/libsrun/opt.c | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/NEWS b/NEWS
index 74dd48ae051..7bc4e19a49c 100644
--- a/NEWS
+++ b/NEWS
@@ -20,6 +20,8 @@ documents those changes that are of interest to users and administrators.
     set correctly.
  -- Only make the extern step at job creation.
  -- Fix for job step task layout with --cpus-per-task option.
+ -- Fix --ntasks-per-core option/environment variable parsing to set
+    the requested value, instead of always setting one (srun).
 
 * Changes in Slurm 17.02.4
 ==========================
diff --git a/src/srun/libsrun/opt.c b/src/srun/libsrun/opt.c
index a65c603ee27..1240e485ec2 100644
--- a/src/srun/libsrun/opt.c
+++ b/src/srun/libsrun/opt.c
@@ -1665,7 +1665,7 @@ static void _set_options(const int argc, char **argv)
 			}
 			opt.hint_set = true;
 			opt.ntasks_per_core_set  = true;
-			opt.threads_per_core  = true;
+			opt.threads_per_core_set = true;
 			break;
 		case LONG_OPT_BLRTS_IMAGE:
 			xfree(opt.blrtsimage);
-- 
GitLab