Add srun wrapper and use pmi2

This commit is contained in:
2020-08-17 18:50:18 +02:00
parent df18435dfc
commit 01295487d8
7 changed files with 138 additions and 18 deletions

View File

@@ -10,6 +10,7 @@
, argv ? ""
, binary ? "/bin/run"
, ntasks ? null
, nodes ? null
, exclusive ? true # By default we run in exclusive mode
, qos ? null
, time ? null
@@ -50,6 +51,7 @@ stdenv.mkDerivation rec {
#SBATCH --job-name="${name}"
''
+ sbatchOpt "ntasks" ntasks
+ sbatchOpt "nodes" nodes
+ sbatchOpt "chdir" "${chdirPrefix}/$(basename $out)"
+ sbatchOpt "output" output
+ sbatchOpt "error" error
@@ -59,7 +61,7 @@ stdenv.mkDerivation rec {
+ optionalString (extra!=null) extra
+
''
srun ${nixPrefix}${app}${binary} ${argv}
exec ${nixPrefix}${app}${binary} ${argv}
EOF
mkdir -p $out/bin