Skip to content
Snippets Groups Projects
Commit 26bcfedf authored by Moe Jette's avatar Moe Jette
Browse files

capture launch pid so we can kill spawned tasks as needed

determine actual minimum mem size and proc count before 
trying to use them. 
reorder tests in sbatch output to match actual output order
 (regular expression tests are done strictly in order (at least 
 for some versions of expect).
parent c1a821fc
No related branches found
No related tags found
No related merge requests found
......@@ -42,8 +42,6 @@ set node_cnt 3
set ppn_cnt 2
set min_mem 1024
append min_mem_mb $min_mem "mb"
print_header $test_id
set available [available_nodes [default_partition]]
......@@ -53,6 +51,35 @@ if {$available < $node_cnt} {
exit $exit_code
}
log_user 0
set scontrol_pid [spawn $scontrol show nodes]
expect {
-re "CPUS=($number)" {
if {$expect_out(1,string) < $ppn_cnt} {
set ppn_cnt $expect_out(1,string)
}
exp_continue
}
-re "RealMemory=($number)" {
if {$expect_out(1,string) < $min_mem} {
set min_mem $expect_out(1,string)
}
exp_continue
}
timeout {
send_user "\nFAILURE: scontrol not responding\n"
set exit_code 1
slow_kill $scontrol_pid
exp_continue
}
eof {
wait
}
}
log_user 1
send_user "Actual configuration: min_cpus=$ppn_cnt min_mem=$min_mem\n\n"
append min_mem_mb $min_mem "mb"
#
# Build input script file
# NOTE: The initial sleep is so that all of the submissions have time
......@@ -65,7 +92,7 @@ $bin_sleep $delay
"
set matches 0
spawn $sbatch -vv -o $file_out $file_in
set sbatch_pid [spawn $sbatch -vv -o $file_out $file_in]
#exp_internal 1
expect {
-re "nprocs$whitespace: ($number) \\(set\\)" {
......@@ -79,27 +106,26 @@ expect {
}
exp_continue
}
-re "mem=($number)" {
set mem $expect_out(1,string)
if { $mem != $min_mem } {
send_user "\nFAILURE: Min memory is different ($mem) than requested ($min_mem)\n"
-re "nodes$whitespace: ($number)" {
set nodes $expect_out(1,string)
if { $nodes != $node_cnt } {
send_user "\nFAILURE: Bad node count allocated\n"
set exit_code 1
} else {
incr matches
}
exp_continue
}
-re "nodes$whitespace: ($number)" {
set nodes $expect_out(1,string)
if { $nodes != $node_cnt } {
send_user "\nFAILURE: Bad node count allocated\n"
-re "mem=($number)" {
set mem $expect_out(1,string)
if { $mem != $min_mem } {
send_user "\nFAILURE: Min memory is different ($mem) than requested ($min_mem)\n"
set exit_code 1
} else {
incr matches
}
exp_continue
}
-re "batch job ($number)" {
set job_id $expect_out(1,string)
exp_continue
......@@ -113,6 +139,7 @@ expect {
timeout {
send_user "\nFAILURE: sbatch not responding\n"
set exit_code 1
slow_kill $sbatch_pid
exp_continue
}
eof {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment