From 29d307ff811f5b3dcb04853bf08a48fb5391b5d6 Mon Sep 17 00:00:00 2001
From: Don Lipari <lipari1@llnl.gov>
Date: Thu, 17 Feb 2011 17:16:55 +0000
Subject: [PATCH] More improvements to test1.84

---
 testsuite/expect/test1.84 | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/testsuite/expect/test1.84 b/testsuite/expect/test1.84
index 8adeff42992..614cbce91ba 100755
--- a/testsuite/expect/test1.84
+++ b/testsuite/expect/test1.84
@@ -99,6 +99,7 @@ if {[string compare $host ""] == 0} {
 }
 # Convert CPU count to core count if necessary
 if {$cpu_cnt != $task_cnt} {
+	set core_cnt  $cpu_cnt
 	set threads_per_core 1
 	spawn $scontrol show node $host
 	expect {
@@ -115,10 +116,10 @@ if {$cpu_cnt != $task_cnt} {
 		}
 	}
 	if {$threads_per_core != 0} {
-		set cpu_cnt [expr $cpu_cnt / $threads_per_core]
+		set cpu_cnt [expr $cpu_cnt * $threads_per_core]
 	}
 	if {$cpu_cnt == $task_cnt} {
-		send_user "NOTE: Allocated cores and $threads_per_core CPUs per core\n"
+		send_user "NOTE: Allocated $core_cnt cores and $threads_per_core CPUs per core\n"
 	}
 }
 if {$cpu_cnt != $task_cnt} {
@@ -133,10 +134,10 @@ if {$cpu_cnt < 2} {
 }
 
 #
-# Submit a 1 node job to determine the node's CPU count
+# Now verify the --cpus-per-task option
 #
 set task_cnt  0
-set srun_pid [spawn $srun -N1 -t1 --nodelist=$host --cpus-per-task=2 --exclusive -l $bin_printenv SLURMD_NODENAME]
+set srun_pid [spawn $srun -N1 --cpus-per-task=2 --exclusive -l -t1 --nodelist=$host $bin_printenv SLURMD_NODENAME]
 expect {
 	-re "Invalid node name specified" {
 		send_user "\nWARNING: Appears you are using "
@@ -159,7 +160,7 @@ expect {
 }
 
 #
-# Check CPU count
+# Verify that half the number of tasks were spawned
 #
 if {$task_cnt != [expr $cpu_cnt / 2]} {
 	send_user "\nFAILURE: Improper task count for given cpus-per-task\n"
-- 
GitLab