Skip to content
Snippets Groups Projects
Commit 05d74d34 authored by Nathan Yee's avatar Nathan Yee Committed by Danny Auble
Browse files

BGQ - add test to make sure ntasks-per-node is figured out correctly

and is also enforced correctly
parent 1f94db8f
No related branches found
No related tags found
No related merge requests found
...@@ -221,6 +221,7 @@ EXTRA_DIST = \ ...@@ -221,6 +221,7 @@ EXTRA_DIST = \
test8.8 \ test8.8 \
test8.9 \ test8.9 \
test8.10 \ test8.10 \
test8.11 \
test8.20 \ test8.20 \
test8.21 \ test8.21 \
test8.21.bash \ test8.21.bash \
......
...@@ -534,6 +534,7 @@ EXTRA_DIST = \ ...@@ -534,6 +534,7 @@ EXTRA_DIST = \
test8.8 \ test8.8 \
test8.9 \ test8.9 \
test8.10 \ test8.10 \
test8.11 \
test8.20 \ test8.20 \
test8.21 \ test8.21 \
test8.21.bash \ test8.21.bash \
......
...@@ -339,6 +339,8 @@ test8.9 Bluegene/Q only: Test to make sure if a nodeboard goes unavailable ...@@ -339,6 +339,8 @@ test8.9 Bluegene/Q only: Test to make sure if a nodeboard goes unavailable
job using the block with passthrough fails. job using the block with passthrough fails.
test8.10 Bluegene/Q only: Test to make sure that the correct number of test8.10 Bluegene/Q only: Test to make sure that the correct number of
nodes and tasks in a job and a step. nodes and tasks in a job and a step.
test8.11 Bluegene/Q only: Test that certain number of tasks will submit to
srun.
test8.20 Bluegene/Q only: Test that job step allocations are a valid size test8.20 Bluegene/Q only: Test that job step allocations are a valid size
and within the job's allocation and within the job's allocation
test8.21 Bluegene/Q only: Test that multple job step allocations are test8.21 Bluegene/Q only: Test that multple job step allocations are
......
#!/usr/bin/expect
############################################################################
# Purpose: Test of SLURM functionality
# Bluegene/Q only: Test that checks that certain number of tasks
# will submit to srun.
#
# Output: "TEST: #.#" followed by "SUCCESS" if test was successful, OR
# "FAILURE: ..." otherwise with an explanation of the failure, OR
# anything else indicates a failure mode that must be investigated.
############################################################################
# Copyright (C) 2011 SchedMD LLC
# Written by Nathan Yee <nyee32@schedmd.com>
#
# This file is part of SLURM, a resource management program.
# For details, see <http://www.schedmd.com/slurmdocs/>.
# Please also read the included file: DISCLAIMER.
#
# SLURM is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 2 of the License, or (at your option)
# any later version.
#
# SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along
# with SLURM; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
############################################################################
source ./globals
set test_id "8.11"
set exit_code 0
set job_id 0
set ret_code 0
if {([test_bluegene] == 0) || [string compare [get_bluegene_type] "Q"]} {
send_user "\nWARNING: This test is only compatible with bluegene systems\n"
exit 0
}
# test number of jobs without overcommit
proc submit_job { num_task } {
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
expect {
-re "jobid ($number)" {
set job_id $expect_out(1,string)
incr id_match
set ret_code 0
}
-re "You requested" {
incr id_match
incr ret_code
}
timeout {
send_user "\nFAILURE: srun is not responding\n"
set exit_code 1
}
eof {
wait
}
}
}
# test number of tasks with overcommit
proc submit_job_over {num_task} {
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
expect {
-re "jobid ($number)" {
set job_id $expect_out(1,string)
incr id_match
set ret_code 0
}
-re "You requested" {
incr id_match
incr ret_code
}
timeout {
send_user "\nFAILURE: srun is not responding\n"
set exit_code 1
}
eof {
wait
}
}
}
# These number of tasks should pass with flying colors
set goodtest "
{1}
{2}
{4}
{8}
{16}
"
send_user "\nGood Tests:\n"
foreach test $goodtest {
submit_job $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
}
}
# Test these number of tasks with overcommit
set overcommit_test "
{32}
{64}
"
send_user "\nTest with overcommit\n"
foreach test $overcommit_test {
submit_job_over $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
}
}
# These number of tasks should not pass
set badtest "
{3}
{5}
{9}
{11}
{13}
{17}
{32}
{64}
{128}
"
send_user "\nBad Tests:\n"
foreach test $badtest {
submit_job $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
}
}
if {$exit_code == 0} {
send_user "\nSUCCESS\n"
} else {
send_user "\nFAILURE\n"
}
exit $exit_code
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