Skip to content
Snippets Groups Projects
Commit 22db8ad2 authored by Morris Jette's avatar Morris Jette
Browse files

Merge branch 'slurm-2.6'

parents 4f6d4477 db73f1f5
No related branches found
No related tags found
No related merge requests found
......@@ -91,7 +91,7 @@ documents those changes that are of interest to users and admins.
-- Add spank/pbs plugin to set a bunch of PBS environment variables.
-- Backported sh5util from master to 2.6 as there are some important
bugfixes and the new item extraction feature.
-- select/cons_res - Corect MacCPUsPerNode partition constraint for CR_Socket.
-- select/cons_res - Correct MacCPUsPerNode partition constraint for CR_Socket.
-- scontrol - for setdebugflags command, avoid parsing "-flagname" as an
scontrol command line option.
-- Fix issue with step accounting if a job is requeued.
......
......@@ -48,11 +48,11 @@ use lib "${FindBin::Bin}/../lib/perl";
use autouse 'Pod::Usage' => qw(pod2usage);
use Slurm ':all';
use Switch;
use English;
my ($start_time,
$account,
# $checkpoint_interval,
$directive_prefix,
$err_path,
$interactive,
$hold,
......@@ -70,7 +70,7 @@ my ($start_time,
# $running_user_list,
$variable_list,
# $all_env,
$additional_attributes,
@additional_attributes,
# $no_std,
$help,
$man);
......@@ -82,7 +82,6 @@ my $srun = "${FindBin::Bin}/srun";
GetOptions('a=s' => \$start_time,
'A=s' => \$account,
# 'c=i' => \$checkpoint_interval,
'C=s' => \$directive_prefix,
'e=s' => \$err_path,
'h' => \$hold,
'I' => \$interactive,
......@@ -103,7 +102,7 @@ GetOptions('a=s' => \$start_time,
'V' => sub { warn "option -V is not necessary, " .
"since the current environment " .
"is exported by default\n" },
'W=s' => \$additional_attributes,
'W=s' => \@additional_attributes,
# 'z' => \$no_std,
'help|?' => \$help,
'man' => \$man,
......@@ -135,20 +134,23 @@ if ($ARGV[0]) {
}
}
my $depend;
my $group_list;
my %res_opts;
my %node_opts;
if($additional_attributes) {
my ($umask, $value) = $additional_attributes =~ /(umask=)([0-9]+)/i;
if ($umask) {
# Process options provided with the -W name=value syntax.
my $W;
foreach $W (@additional_attributes) {
my($name, $value) = split('=', $W);
if ($name eq 'umask') {
$ENV{SLURM_UMASK} = $value;
$additional_attributes =~ s/(umask=)([0-9]+)//;
}
($depend, $value) = $additional_attributes =~ /(depend=)(\S+)/i;
if ($depend) {
} elsif ($name eq 'depend') {
$depend = $value;
$additional_attributes =~ s/(depend=)(\S+)//;
} elsif ($name eq 'group_list') {
$group_list = $value;
# } else {
# print("Invalid attribute: $W!");
# exit(1);
}
}
......@@ -215,7 +217,6 @@ if($interactive) {
$command = "$sbatch";
$command .= " -D $directive_prefix" if $directive_prefix;
$command .= " -e $err_path" if $err_path;
$command .= " -o $out_path" if $out_path;
......@@ -241,6 +242,7 @@ if($res_opts{walltime}) {
$command .= " -t$res_opts{pcput}";
}
$command .= " --constraint='$res_opts{proc}'" if $res_opts{proc};
$command .= " --dependency=$depend" if $depend;
$command .= " --tmp=$res_opts{file}" if $res_opts{file};
$command .= " --mem=$res_opts{mem}" if $res_opts{mem};
......@@ -266,12 +268,46 @@ $command .= " --mail-user=$mail_user_list" if $mail_user_list;
$command .= " -J $job_name" if $job_name;
$command .= " --nice=$priority" if $priority;
$command .= " -p $destination" if $destination;
$command .= " $script" if $script;
# print "$command\n";
my $ret = system($command);
exit ($ret >> 8);
# Execute the command and capture its stdout, stderr, and exit status. Note
# that if interactive mode was requested, the standard output and standard
# error are _not_ captured.
if ($interactive) {
my $ret = system($command);
exit ($ret >> 8);
} else {
# Capture stderr from the command to the stdout stream.
$command .= ' 2>&1';
# Execute the command and capture the combined stdout and stderr.
my $command_output = `$command 2>&1`;
chomp($command_output);
# Save the command exit status.
my $command_exit_status = $CHILD_ERROR;
# If available, extract the job ID from the command output and print
# it to stdout, as done in the PBS version of qsub.
if ($command_exit_status == 0) {
# This prints "Submitted batch job #"
print "$command_output\n";
# This only prints the job ID number, e.g. "#"
# my($job_ID) = $command_output =~ /^.* (\d+)$/;
# print "$job_ID\n";
} else {
print("There was an error running the SLURM sbatch command.\n" .
"The command was:\n" .
"'$command'\n" .
"and the output was:\n" .
"'$command_output'\n");
}
# Exit with the command return code.
exit($command_exit_status >> 8);
}
sub parse_resource_list {
my ($rl) = @_;
......@@ -290,6 +326,7 @@ sub parse_resource_list {
'other' => "",
'pcput' => "",
'pmem' => "",
'proc' => '',
'pvmem' => "",
'select' => "",
'software' => "",
......@@ -306,6 +343,11 @@ sub parse_resource_list {
# The select option uses a ":" separator rather than ","
# This wrapper currently does not support multiple select options
# Protect the colons used to separate elements in walltime=hh:mm:ss.
# Convert to NNhNNmNNs format.
$rl =~ s/walltime=(\d{1,2}):(\d{2}):(\d{2})/walltime=$1h$2m$3s/;
$rl =~ s/:/,/g;
foreach my $key (@keys) {
#print "$rl\n";
......@@ -313,6 +355,13 @@ sub parse_resource_list {
}
# If needed, un-protect the walltime string.
if ($opt{walltime}) {
$opt{walltime} =~ s/(\d{1,2})h(\d{2})m(\d{2})s/$1:$2:$3/;
# Convert to minutes for SLURM.
$opt{walltime} = get_minutes($opt{walltime});
}
if($opt{accelerator} && $opt{accelerator} =~ /^[Tt]/ && !$opt{naccelerators}) {
$opt{naccelerators} = 1;
}
......@@ -434,7 +483,6 @@ B<qsub> - submit a batch job in a familiar pbs format
qsub [-a date_time]
[-A account_string]
[-b secs]
[-C directive_prefix]
[-e path]
[-I]
[-l resource_list]
......
......@@ -22,8 +22,9 @@ Morris Jette and Danny Auble (SchedMD), Yiannis Georgiou (Bull) </li>
<li>Tutorial: <a href="SUG13/energy_sensors.pdf">Energy Accounting and External Sensor Plugins</a>,
Yiannis Georgiou, Martin Perry, Thomas Cadeau (Bull), Danny Auble (SchedMD)</li>
<!-- DO NOT POST
<li>Technical: <a href="SUG13/tbd.pdf">Evaluation of Monitoring and Control Features for Power Management</a>,
Yiannis Georgiou , Thomas Cadeau (Bull), Danny Auble, Moe Jette (SchedMD) Matthieu Hautreux (CEA)</li>
Yiannis Georgiou , Thomas Cadeau (Bull), Danny Auble, Moe Jette (SchedMD) Matthieu Hautreux (CEA)</li> -->
<li>Technical: <a href="SUG13/debugging-slurm-0.4.pdf">Debugging Large Machines</a>,
Matthieu Hautreux (CEA)</li>
......@@ -409,6 +410,6 @@ Danny Auble of LLNL about SLURM.</p>
Learning Chef: Compute Cluter with SLURM</a>
A SLURM Cookbook by Adam DeConinck</p>
<p style="text-align:center;">Last modified 23 September 2013</p>
<p style="text-align:center;">Last modified 25 September 2013</p>
<!--#include virtual="footer.txt"-->
......@@ -440,6 +440,7 @@ Possible values on Blue Gene are "MESH", "TORUS" and "NAV"
\fIContiguous\fP=<yes|no>
Set the job's requirement for contiguous (consecutive) nodes to be allocated.
Possible values are "YES" and "NO".
Only the Slurm administrator or root can change this parameter.
.TP
\fIDependency\fP=<dependency_list>
Defer job's initiation until specified job dependency specification
......@@ -534,18 +535,21 @@ of the cluster) as described in salloc/sbatch/srun man pages.
.TP
\fIMinCPUsNode\fP=<count>
Set the job's minimum number of CPUs per node to the specified value.
Only the Slurm administrator or root can change this parameter.
.TP
\fIMinMemoryCPU\fP=<megabytes>
Set the job's minimum real memory required per allocated CPU to the specified
value.
value. Only the Slurm administrator or root can change this parameter.
Either \fIMinMemoryCPU\fP or \fIMinMemoryNode\fP may be set, but not both.
.TP
\fIMinMemoryNode\fP=<megabytes>
Set the job's minimum real memory required per node to the specified value.
Either \fIMinMemoryCPU\fP or \fIMinMemoryNode\fP may be set, but not both.
Only the Slurm administrator or root can change this parameter.
.TP
\fIMinTmpDiskNode\fP=<megabytes>
Set the job's minimum temporary disk space required per node to the specified value.
Only the Slurm administrator or root can change this parameter.
.TP
\fIName\fP=<name>
Set the job's name to the specified value.
......@@ -556,7 +560,7 @@ The adjustment range is from \-10000 (highest priority)
to 10000 (lowest priority).
Nice value changes are not additive, but overwrite any prior nice
value and are applied to the job's base priority.
Only privileged users can specify a negative adjustment.
Only privileged users, Slurm administrator or root, can specify a negative adjustment.
.TP
\fINodeList\fP=<nodes>
Change the nodes allocated to a running job to shrink it's size.
......@@ -592,6 +596,7 @@ Explicitly setting a job's priority clears any previously set nice value and
removes the priority/multifactor plugin's ability to manage a job's priority.
In order to restore the priority/multifactor plugin's ability to manage a
job's priority, hold and then release the job.
Only the Slurm administrator or root can increase job's priority.
.TP
\fIQOS\fP=<name>
Set the job's QOS (Quality Of Service) to the specified value.
......@@ -625,7 +630,7 @@ Possible values are "YES" and "NO".
.TP
\fIShared\fP=<yes|no>
Set the job's ability to share nodes with other jobs. Possible values are
"YES" and "NO".
"YES" and "NO". Only the Slurm administrator or root can increase job's priority.
.TP
\fIStartTime\fP=<time_spec>
Set the job's earliest initiation time.
......@@ -684,7 +689,7 @@ precede the time with a "+" or "\-" to increment or decrement the current
time limit (e.g. "TimeLimit=+30"). In order to increment or decrement the
current time limit, the \fIJobId\fP specification must precede the
\fITimeLimit\fP specification.
Only the Slurm administrator or root can increase job's TimeLimit.
.TP
\fIwait\-for\-switch\fP=<max\-time\-to\-wait>
When a tree topology is used, this defines the maximum time to wait for the
......
......@@ -106,7 +106,8 @@ int slurm_spank_task_init(spank_t sp, int ac, char **av)
if (spank_getenv(sp, "SYSTEM", val, sizeof(val)) == ESPANK_SUCCESS)
spank_setenv(sp, "PBS_O_SYSTEM", val, 1);
if (spank_getenv(sp, "WORKDIR", val, sizeof(val)) == ESPANK_SUCCESS)
if (spank_getenv(sp, "SLURM_SUBMIT_DIR", val, sizeof(val)) ==
ESPANK_SUCCESS)
spank_setenv(sp, "PBS_O_WORKDIR", val, 1);
/* PBS_QUEUE is set in the job_submit/pbs plugin, but only for
......
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