diff --git a/testsuite/expect/test1.84 b/testsuite/expect/test1.84 index b04bea28bb1bedc122c87b60c5b90d4b350b159e..e49988de18796ef36555cb82b5ccfd885a388a8e 100755 --- a/testsuite/expect/test1.84 +++ b/testsuite/expect/test1.84 @@ -59,30 +59,27 @@ make_bash_script $file_in " # # Submit a 1 node job to determine the node's CPU count # -set cpu_count 0 +set cpu_cnt 0 set cpus_per_node 0 set fat_nodes 0 set host "" set timeout $max_job_delay -set node_cnt 1 -set task_cnt 1 +set task_cnt 0 -spawn $srun -N$node_cnt --cpus-per-task=$task_cnt -l -t1 $file_in +spawn $srun -N1 --cpus-per-task=1 -l -t1 $file_in expect { -re "Granted job allocation ($number)" { set job_id $expect_out(1,string) exp_continue } -re "SLURM_CPUS_ON_NODE=($number)" { - set cpus_per_node $expect_out(1,string) + set cpu_cnt $expect_out(1,string) exp_continue } -re "($number): ($alpha_numeric)" { set task $expect_out(1,string) set host $expect_out(2,string) - if {$task >= $cpu_count} { - set cpu_count [expr $task + 1] - } + incr task_cnt exp_continue } -re "Task count specification invalid" { @@ -112,12 +109,12 @@ if {[string compare $host ""] == 0} { send_user "\nFAILURE: Did not get hostname\n" exit 1 } -if {$cpus_per_node != $cpu_count} { - send_user "FAILURE: should have run $cpus_per_node tasks (one per CPU) " - send_user "instead of $cpu_count tasks\n" - exit 1 +if {$cpu_cnt != $task_cnt} { + send_user "FAILURE: should have run $cpu_cnt tasks (one per CPU) " + send_user "instead of $task_cnt tasks\n" + set exit_code 1 } -if {$cpu_count < 2} { +if {$cpu_cnt < 2} { send_user "\nWARNING: The node only has one CPU\n" exit $exit_code } @@ -125,8 +122,8 @@ if {$cpu_count < 2} { # # Submit a 1 node job to determine the node's CPU count # -set read_cpus 0 -spawn $srun -N1 --cpus-per-task=2 --nodelist=$host -l -t1 $bin_hostname +set task_cnt 0 +spawn $srun -N1 -t1 --nodelist=$host --cpus-per-task=2 -l $bin_hostname expect { -re "Invalid node name specified" { send_user "\nWARNING: Appears you are using " @@ -135,7 +132,7 @@ expect { exit 0 } -re "$number: ($alpha_numeric)" { - incr read_cpus + incr task_cnt exp_continue } timeout { @@ -152,7 +149,7 @@ expect { # # Check CPU count # -if {$read_cpus != [expr $cpu_count / 2]} { +if {$task_cnt != [expr $cpu_cnt / 2]} { send_user "\nFAILURE: Improper task count for given cpus-per-task\n" set exit_code 1 } diff --git a/testsuite/expect/test18.29 b/testsuite/expect/test18.29 index 58f12b9b0f26febd78223cc8ab8480110b496516..7de8986afa298c255a5bbffb35e6adbedd7b5ca0 100755 --- a/testsuite/expect/test18.29 +++ b/testsuite/expect/test18.29 @@ -59,31 +59,27 @@ make_bash_script $file_in " # # Submit a 1 node job to determine the node's CPU count # -set cpu_count 0 -set cpus_per_node 0 +set cpu_cnt 0 set fat_nodes 0 set host "" set job_id 0 set timeout $max_job_delay -set node_cnt 1 -set task_cnt 1 +set task_cnt 0 -spawn $salloc -N$node_cnt -t1 $slaunch --cpus-per-task=$task_cnt -l $file_in +spawn $salloc -N1 -t1 $slaunch --cpus-per-task=1 -l $file_in expect { -re "Granted job allocation ($number)" { set job_id $expect_out(1,string) exp_continue } -re "SLURM_JOB_CPUS_PER_NODE=($number)" { - set cpus_per_node $expect_out(1,string) + set cpu_cnt $expect_out(1,string) exp_continue } -re "($number): ($alpha_numeric)" { set task $expect_out(1,string) set host $expect_out(2,string) - if {$task >= $cpu_count} { - set cpu_count [expr $task + 1] - } + incr task_cnt exp_continue } -re "Task count specification invalid" { @@ -115,24 +111,24 @@ if {$fat_nodes == 1} { # if {[string compare $host ""] == 0} { send_user "\nFAILURE: Did not get hostname\n" - exit 1 + set exit_code 1 } -if {$cpus_per_node != $cpu_count} { - send_user "FAILURE: should have run $cpus_per_node tasks (one per CPU) " - send_user "instead of $cpu_count tasks\n" - exit 1 +if {$cpu_cnt != $task_cnt} { + send_user "FAILURE: should have run $cpu_cnt tasks (one per CPU) " + send_user "instead of $task_cnt tasks\n" + set exit_code 1 } -if {$cpus_per_node < 2} { +if {$cpu_cnt < 2} { send_user "\nWARNING: The node only has one CPU\n" exit $exit_code } # -# Submit a 1 node job to determine the node's CPU count +# Check task count when using 2 cpus per task # set job_id 0 -set read_cpus 0 -spawn $salloc -N1 -t1 $slaunch --cpus-per-task=2 --nodelist=$host -l $bin_hostname +set task_cnt 0 +spawn $salloc -N1 -t1 --nodelist=$host $slaunch --cpus-per-task=2 -l $bin_hostname expect { -re "Granted job allocation ($number)" { set job_id $expect_out(1,string) @@ -145,7 +141,7 @@ expect { exit 0 } -re "$number: ($alpha_numeric)" { - incr read_cpus + incr task_cnt exp_continue } timeout { @@ -166,7 +162,7 @@ expect { # # Check CPU count # -if {$read_cpus != [expr $cpu_count / 2]} { +if {$task_cnt != [expr $cpu_cnt / 2]} { send_user "\nFAILURE: Improper task count for given cpus-per-task\n" set exit_code 1 }