Skip to content
Snippets Groups Projects
Commit da2e1dd0 authored by Danny Auble's avatar Danny Auble
Browse files

Merge remote-tracking branch 'origin/slurm-2.5'

parents ac10bf0d 2d8a8e4b
No related branches found
No related tags found
No related merge requests found
...@@ -181,16 +181,16 @@ sleep 1 ...@@ -181,16 +181,16 @@ sleep 1
#Checks job #Checks job
if {[check_job $job_id 32 512 1]} { if {[check_job $job_id 32 512 1]} {
exit exit_code exit $exit_code
} }
#Checks the job step #Checks the job step
if {[check_step $job_id 0 32 512]} { if {[check_step $job_id 0 32 512]} {
exit exit_code exit $exit_code
} }
#submit allocation and runs job #submit allocation and runs job
set matches 0 set matches 0
spawn $salloc -n512 $srun $bin_sleep spawn $salloc -n512 $srun $bin_sleep 50
expect { expect {
-re "Granted job allocation ($number)" { -re "Granted job allocation ($number)" {
set job_id $expect_out(1,string) set job_id $expect_out(1,string)
...@@ -212,11 +212,11 @@ if {$matches !=1} { ...@@ -212,11 +212,11 @@ if {$matches !=1} {
#Checks job #Checks job
if {[check_job $job_id 32 512 1]} { if {[check_job $job_id 32 512 1]} {
exit exit_code exit $exit_code
} }
#Checks the job step #Checks the job step
if {[check_step $job_id 0 32 512]} { if {[check_step $job_id 0 32 512]} {
exit exit_code exit $exit_code
} }
if {$exit_code == 0} { if {$exit_code == 0} {
......
...@@ -41,19 +41,64 @@ if {([test_bluegene] == 0) || [string compare [get_bluegene_type] "Q"]} { ...@@ -41,19 +41,64 @@ if {([test_bluegene] == 0) || [string compare [get_bluegene_type] "Q"]} {
exit 0 exit 0
} }
#########salloc test###########
# test salloc without overcommit
proc salloc_submit {num_task} {
global exit_code salloc srun job_id number bin_sleep ret_code
spawn $salloc -N1 -n$num_task --ntasks-per-node=$num_task $srun -v $bin_sleep 50
expect {
-re "launching" {
set ret_code 0
}
-re "You requested" {
incr ret_code
}
timeout {
send_user "\nFAILURE: salloc is not responding\n"
set exit_code 1
}
eof {
wait
}
}
}
# test salloc with overcommit
proc salloc_overcommit {num_task} {
global exit_code salloc srun job_id number bin_sleep ret_code
spawn $salloc -N1 -n$num_task -O --ntasks-per-node=$num_task $srun -v $bin_sleep 50
expect {
-re "launching" {
set ret_code 0
}
-re "You requested" {
incr ret_code
}
timeout {
send_user "\nFAILURE: salloc is not responding\n"
set exit_code 1
}
eof {
wait
}
}
}
##########srun test###########
# test number of jobs without overcommit # test number of jobs without overcommit
proc submit_job { num_task } { proc srun_submit { num_task } {
global exit_code srun job_id number bin_sleep ret_code global exit_code srun job_id number bin_sleep ret_code
spawn $srun -N1 -n$num_task --ntasks-per-node=$num_task -v $bin_sleep 50 spawn $srun -N1 -n$num_task --ntasks-per-node=$num_task -v $bin_sleep 50
expect { expect {
-re "jobid ($number)" { -re "jobid ($number)" {
set job_id $expect_out(1,string) set job_id $expect_out(1,string)
incr id_match
set ret_code 0 set ret_code 0
} }
-re "You requested" { -re "You requested" {
incr id_match
incr ret_code incr ret_code
} }
timeout { timeout {
...@@ -68,19 +113,16 @@ proc submit_job { num_task } { ...@@ -68,19 +113,16 @@ proc submit_job { num_task } {
} }
# test number of tasks with overcommit # test number of tasks with overcommit
proc submit_job_over {num_task} { proc srun_overcommit {num_task} {
global exit_code srun job_id number bin_sleep ret_code global exit_code srun job_id number bin_sleep ret_code
set id_match 0
spawn $srun -N1 -n$num_task --ntasks-per-node=$num_task -O -v $bin_sleep 50 spawn $srun -N1 -n$num_task --ntasks-per-node=$num_task -O -v $bin_sleep 50
expect { expect {
-re "jobid ($number)" { -re "jobid ($number)" {
set job_id $expect_out(1,string) set job_id $expect_out(1,string)
incr id_match
set ret_code 0 set ret_code 0
} }
-re "You requested" { -re "You requested" {
incr id_match
incr ret_code incr ret_code
} }
timeout { timeout {
...@@ -102,10 +144,19 @@ set goodtest " ...@@ -102,10 +144,19 @@ set goodtest "
{8} {8}
{16} {16}
" "
send_user "\nsrun Good test:\n"
send_user "\nGood Tests:\n"
foreach test $goodtest { foreach test $goodtest {
submit_job $test srun_submit $test
if {$ret_code == 0} {
send_user "\nJob: $job_id was submitted as expected\n"
} else {
send_user "\nFAILURE: job should have been submitted but was not\n"
set exit_code 1
}
}
send_user "\nsalloc Good test:\n"
foreach test $goodtest {
salloc_submit $test
if {$ret_code == 0} { if {$ret_code == 0} {
send_user "\nJob: $job_id was submitted as expected\n" send_user "\nJob: $job_id was submitted as expected\n"
} else { } else {
...@@ -119,9 +170,20 @@ set overcommit_test " ...@@ -119,9 +170,20 @@ set overcommit_test "
{32} {32}
{64} {64}
" "
send_user "\nTest with overcommit\n" send_user "\nsrun Test with overcommit:\n"
foreach test $overcommit_test { foreach test $overcommit_test {
submit_job_over $test srun_overcommit $test
if {$ret_code == 0} {
send_user "\nJob: $job_id was submitted as expected\n"
} else {
send_user "\nFAILURE: job should have been submitted but was not\n"
set exit_code 1
}
}
send_user "\nsalloc test with overcommit:\n"
foreach test $overcommit_test {
salloc_overcommit $test
if {$ret_code == 0} { if {$ret_code == 0} {
send_user "\nJob: $job_id was submitted as expected\n" send_user "\nJob: $job_id was submitted as expected\n"
} else { } else {
...@@ -142,9 +204,19 @@ set badtest " ...@@ -142,9 +204,19 @@ set badtest "
{64} {64}
{128} {128}
" "
send_user "\nBad Tests:\n" send_user "\nsrun Bad Tests:\n"
foreach test $badtest {
srun_submit $test
if {$ret_code != 0} {
send_user "\nThis error is expected do not worry\n"
} else {
send_user "\nFAILURE:Job was submitted when it should not have\n"
set exit_code 1
}
}
send_user "\nsalloc Bad Tests:\n"
foreach test $badtest { foreach test $badtest {
submit_job $test salloc_submit $test
if {$ret_code != 0} { if {$ret_code != 0} {
send_user "\nThis error is expected do not worry\n" send_user "\nThis error is expected do not worry\n"
} else { } else {
......
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