First successful execution with SLURM

This commit is contained in:
2020-08-04 18:38:33 +02:00
parent 39a639ac10
commit bab4c696d8
4 changed files with 57 additions and 15 deletions

View File

@@ -9,7 +9,7 @@
, binary ? "/bin/run"
, ntasks ? null
, exclusive ? true # By default we run in exclusive mode
, workdir ? "."
, chdir ? "."
, qos ? null
, time ? null
, output ? "job_%j.out"
@@ -42,14 +42,13 @@ stdenv.mkDerivation rec {
dontBuild = true;
installPhase = ''
mkdir -p $out/bin
cat > $out/bin/run <<EOF
mkdir -p $out
cat > $out/job <<EOF
#!/bin/bash
#SBATCH --job-name="${name}"
''
+ sbatchOpt "ntasks" ntasks
+ sbatchOpt "ntasks" ntasks
+ sbatchOpt "workdir" workdir
+ sbatchOpt "chdir" chdir
+ sbatchOpt "output" output
+ sbatchOpt "error" error
+ sbatchEnable "exclusive" exclusive
@@ -62,7 +61,5 @@ stdenv.mkDerivation rec {
srun ${app}${binary} ${argv}
EOF
chmod +x $out/bin/run
'';
}