Skip to content
Snippets Groups Projects
Commit c75ffaeb authored by Christopher J. Morrone's avatar Christopher J. Morrone
Browse files

Fix test3.7 on systems where suspend is not supported

parent d6017a45
No related branches found
No related tags found
No related merge requests found
...@@ -316,7 +316,7 @@ proc wait_for_file { file_name } { ...@@ -316,7 +316,7 @@ proc wait_for_file { file_name } {
################################################################ ################################################################
proc wait_for_job { job_id state } { proc wait_for_job { job_id state } {
global bin_sleep max_job_delay global max_job_delay
global scontrol global scontrol
set is_done 0 set is_done 0
set is_running 0 set is_running 0
...@@ -366,7 +366,7 @@ proc wait_for_job { job_id state } { ...@@ -366,7 +366,7 @@ proc wait_for_job { job_id state } {
log_user 1 log_user 1
if {[string compare $state "DONE"] == 0 && $is_done == 1 } { if {[string compare $state "DONE"] == 0 && $is_done == 1 } {
exec $bin_sleep 2 sleep 2
return 0 return 0
} }
if {[string compare $state "RUNNING"] == 0 && $is_running == 1 } { if {[string compare $state "RUNNING"] == 0 && $is_running == 1 } {
...@@ -376,7 +376,7 @@ proc wait_for_job { job_id state } { ...@@ -376,7 +376,7 @@ proc wait_for_job { job_id state } {
return 1 return 1
} }
exec $bin_sleep $sleep_time sleep $sleep_time
set sleep_time [expr $sleep_time * 2] set sleep_time [expr $sleep_time * 2]
if { $sleep_time > 10 } { if { $sleep_time > 10 } {
set sleep_time 10 set sleep_time 10
......
...@@ -139,13 +139,11 @@ proc check_output { file_name } { ...@@ -139,13 +139,11 @@ proc check_output { file_name } {
# #
# Delete left-over program and rebuild it # Delete left-over program and rebuild it
# #
exec $bin_rm -f $file_prog $file_prog_sh1 $file_prog_sh2 $file_out1 $file_out2 file delete $file_prog $file_out1 $file_out2
exec echo "#!/bin/sh" > $file_prog_sh1 make_bash_script $file_prog_sh1 "$srun ./$file_prog"
exec echo "$srun ./$file_prog" >> $file_prog_sh1 make_bash_script $file_prog_sh2 "./$file_prog"
exec echo "#!/bin/sh" > $file_prog_sh2
exec echo "./$file_prog" >> $file_prog_sh2
exec $bin_make -f /dev/null $file_prog exec $bin_make -f /dev/null $file_prog
exec $bin_chmod 700 $file_prog $file_prog_sh1 $file_prog_sh2 exec $bin_chmod 700 $file_prog
# #
# Submit two jobs to the same node # Submit two jobs to the same node
...@@ -228,15 +226,20 @@ if {$job_id2 == 0} { ...@@ -228,15 +226,20 @@ if {$job_id2 == 0} {
# The sleep commands are added so the program can recognize # The sleep commands are added so the program can recognize
# that it has been suspended. # that it has been suspended.
# #
exec $bin_sleep 5 sleep 5
suspend_job $job_id1 suspend suspend_job $job_id1 suspend
if {$not_supported == 1} {
exec $scancel $job_id1
exec $scancel $job_id2
exit 0
}
if {$not_supported == 0} { if {$not_supported == 0} {
if {[wait_for_job $job_id2 RUNNING] != 0} { if {[wait_for_job $job_id2 RUNNING] != 0} {
send_user "\nFAILURE: waiting for job $job_id2 to run\n" send_user "\nFAILURE: waiting for job $job_id2 to run\n"
kill_srun kill_srun
exit 1 exit 1
} }
exec $bin_sleep 5 sleep 5
suspend_job $job_id2 suspend suspend_job $job_id2 suspend
suspend_job $job_id1 resume suspend_job $job_id1 resume
if {[wait_for_job $job_id1 DONE] != 0} { if {[wait_for_job $job_id1 DONE] != 0} {
......
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