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

@@ -1,9 +1,11 @@
{
stdenv
, bash
}:
{
app
, env ? ""
, argv # bash array as string, example: argv=''(-f "file with spaces" -t 10)''
}:
@@ -12,11 +14,14 @@ stdenv.mkDerivation {
name = "${app.name}-argv";
preferLocalBuild = true;
phases = [ "installPhase" ];
dontPatchShebangs = true;
installPhase = ''
mkdir -p $out/bin
cat > $out/bin/run <<EOF
#!/bin/sh
#!${bash}/bin/bash
# Requires /nix to use bash
${env}
argv=${argv}
exec ${app}/bin/run \''${argv[@]}
EOF