bscpkgs/garlic/stages/srun.nix
Rodrigo Arias Mallo a576be8031 WIP stage redesign
2020-10-09 16:42:06 +02:00

32 lines
481 B
Nix

{
stdenv
, slurm
, garlicTools
}:
{
nextStage
, cpuBind
, nixPrefix
, srunOptions ? ""
}:
with garlicTools;
stdenv.mkDerivation rec {
name = "srun";
phases = [ "installPhase" ];
preferLocalBuild = true;
dontPatchShebangs = true;
installPhase = ''
cat > $out <<EOF
#!/bin/sh -ex
exec ${slurm}/bin/srun \
--mpi=pmi2 \
--cpu-bind=${cpuBind} \
${srunOptions} \
${nixPrefix}${stageProgram nextStage}
EOF
chmod +x $out
'';
}