sbatch: assert types to avoid silent parse errors
This commit is contained in:
parent
9c8282362a
commit
87fa3bb336
13
NOISE
13
NOISE
@ -120,5 +120,18 @@ ABSTRACT
|
||||
we build within Nix, they will be copied with the current data and
|
||||
consequently not updated during the Nix compilation process.
|
||||
|
||||
1.9 Sbatch silently fails on parsing
|
||||
|
||||
When submitting a job with a wrong specification in MN4 with SLURM
|
||||
17.11.9-2, for example this bogus line:
|
||||
|
||||
#SBATCH --nodes=1 2
|
||||
|
||||
It silently fails to parse the options, falling back to the defaults,
|
||||
without any error.
|
||||
|
||||
We have improved our checking to detect bogus options passed to SLURM,
|
||||
so we prevent this problem from happening.
|
||||
|
||||
/* vim: set ts=2 sw=2 tw=72 fo=watqc expandtab spell autoindent: */
|
||||
|
||||
|
@ -22,7 +22,6 @@
|
||||
, time ? null
|
||||
, output ? "stdout.log"
|
||||
, error ? "stderr.log"
|
||||
, contiguous ? null
|
||||
, extra ? null
|
||||
, acctgFreq ? null
|
||||
}:
|
||||
@ -30,6 +29,24 @@
|
||||
with stdenv.lib;
|
||||
with garlicTools;
|
||||
|
||||
# sbatch fails silently if we pass garbage, so we assert the types here to avoid
|
||||
# sending `nodes = [ 1 2 ]` by mistake.
|
||||
assert (jobName != null) -> isString jobName;
|
||||
assert (chdir != null) -> isString chdir;
|
||||
assert (nixPrefix != null) -> isString nixPrefix;
|
||||
assert (ntasks != null) -> isInt ntasks;
|
||||
assert (ntasksPerNode != null) -> isInt ntasksPerNode;
|
||||
assert (ntasksPerSocket != null) -> isInt ntasksPerSocket;
|
||||
assert (cpusPerTask != null) -> isInt cpusPerTask;
|
||||
assert (nodes != null) -> isInt nodes;
|
||||
assert (exclusive != null) -> isBool exclusive;
|
||||
assert (qos != null) -> isString qos;
|
||||
assert (reservation != null) -> isString reservation;
|
||||
assert (time != null) -> isString time;
|
||||
assert (output != null) -> isString output;
|
||||
assert (error != null) -> isString error;
|
||||
assert (extra != null) -> isString extra;
|
||||
|
||||
let
|
||||
|
||||
sbatchOpt = name: value: optionalString (value!=null)
|
||||
|
Loading…
Reference in New Issue
Block a user