srun: allow commands to run before srun

This commit is contained in:
Rodrigo Arias 2021-02-26 17:00:09 +01:00
parent 8a77900201
commit 051a74b85d

View File

@ -7,6 +7,7 @@
nextStage nextStage
, cpuBind , cpuBind
, nixPrefix , nixPrefix
, preSrun ? ""
, srunOptions ? "" , srunOptions ? ""
, output ? "stdout.log" , output ? "stdout.log"
, error ? "stderr.log" , error ? "stderr.log"
@ -22,6 +23,9 @@ stdenv.mkDerivation rec {
installPhase = '' installPhase = ''
cat > $out <<'EOF' cat > $out <<'EOF'
#!/bin/sh -e #!/bin/sh -e
${preSrun}
exec ${slurm}/bin/srun \ exec ${slurm}/bin/srun \
--mpi=pmi2 \ --mpi=pmi2 \
--cpu-bind=${cpuBind} \ --cpu-bind=${cpuBind} \