From d5fd734513671d957c20a66655c98d325bb1760f Mon Sep 17 00:00:00 2001 From: Justin Bedo Date: Thu, 16 May 2019 21:18:27 +1000 Subject: slurm: renamed from sbatch --- lib/sbatch.nix | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 lib/sbatch.nix (limited to 'lib/sbatch.nix') diff --git a/lib/sbatch.nix b/lib/sbatch.nix deleted file mode 100644 index d52c23e..0000000 --- a/lib/sbatch.nix +++ /dev/null @@ -1,28 +0,0 @@ -{stdenv, lib, writeScript, coreutils}: - -with lib; - -{ ppn, mem, walltime, partition ? null, slurmFlags ? null, salloc ? "/usr/bin/salloc" }: -drv: - let ppnReified = if drv.multicore then ppn else 1; - in lib.overrideDerivation drv ({ args, builder, name, ... }: { - builder = stdenv.shell; - args = let - script = writeScript "sbatch-script" '' - #!${stdenv.shell} - ${builder} ${lib.escapeShellArgs args} - ''; - - sbatch = writeScript "sbatch" '' - #!${stdenv.shell} - NIX_BUILD_CORES=${toString ppnReified} - - ${salloc} -c $NIX_BUILD_CORES --mem=${toString mem}G -t ${walltime} \ - -J "${name}" \ - ${optionalString (partition != null) "-p ${partition}"} \ - ${optionalString (slurmFlags != null) slurmFlags} \ - ${script} - ''; - - in [ "-c" sbatch ]; - }) -- cgit v1.2.3