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

Minor code tweak for more robustness.

parent c407b062
No related branches found
No related tags found
No related merge requests found
......@@ -38,6 +38,7 @@ set exit_code 0
set num_nodes 2
set num_tasks 2
set node_count 0
set max_nodes 0
set task_count 0
set job_id 0
set hostfile "test$test_id.hostfile"
......@@ -48,7 +49,8 @@ exec $bin_rm -f $hostfile
if { [test_front_end] } {
send_user "\nWARNING: This test incompatable with front-end Systems\n"
exit $exit_code
}
}
#find out if we have enough nodes to test functionality
spawn $scontrol show partition $partition
expect {
......@@ -58,21 +60,25 @@ expect {
}
-re "TotalNodes=($number)" {
set node_count $expect_out(1,string)
if { $node_count < 2 } {
send_user "WARNING: system must have at least 2 \
nodes to run this test on. This system \
only has $node_count.\n"
exit $exit_code
}
exp_continue
}
}
-re "MaxNodes=($number)" {
set max_nodes $expect_out(1,string)
exp_continue
}
timeout {
send_user "\nFAILURE: scontrol not responding\n"
exit 1
}
eof {
wait
}
}
if { ($node_count < 2) || ($max_nodes < 2) } {
send_user "WARNING: system must have at least 2 nodes to run this test on.\n"
exit $exit_code
}
set node0 0
set node1 0
......@@ -94,6 +100,8 @@ for {set i 0} {$i<2} {incr i} {
#
# execute srun with a specific node count
#
set node0 ""
set node1 ""
spawn $srun -N2 -l $bin_hostname
expect {
-re "($number): ($alpha_numeric)" {
......@@ -115,9 +123,11 @@ for {set i 0} {$i<2} {incr i} {
set exit_code 1
}
eof {
wait
}
}
}
if { [string compare $node0 $1node1] } {
send_user "\nFAILURE: tasks not distributed by hostfile\n"
set exit_code 1
......
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