From 27d69830a9475253c239ada6c161a938c52c01f8 Mon Sep 17 00:00:00 2001 From: Justin Bedo Date: Fri, 14 Jun 2019 09:48:34 +1000 Subject: slurm,qsub: update to allow chaining of execution engines Previously exec was redefined to defer to slurm/pbs for execution. This did not chain the previous exec, meaning you couldn't chain execs. --- default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'default.nix') diff --git a/default.nix b/default.nix index c951ac9..a0ecce0 100644 --- a/default.nix +++ b/default.nix @@ -40,12 +40,12 @@ let slurm = attrs: bionix.extend (self: super: with self; rec { slurmDefs = { ppn = 1; mem = 1; walltime = "24:00:00"; partition = null; slurmFlags = null; salloc = "/usr/bin/salloc"; } // attrs; slurm = attrs: (callPackage ./lib/slurm.nix {}) (slurmDefs // attrs); - exec = f: x: y: slurm (builtins.intersectAttrs slurmDefs x) (f (builtins.removeAttrs x (builtins.attrNames slurmDefs)) y); + exec = f: x: y: slurm (builtins.intersectAttrs slurmDefs x) (super.exec f (builtins.removeAttrs x (builtins.attrNames slurmDefs)) y); }); qsub = attrs: bionix.extend (self: super: with self; rec { qsubDefs = { ppn = 1; mem = 1; walltime = "24:00:00"; tmpDir = "/tmp"; sleepTime = 60; queue = null; qsubFlags = null; qsubPath = "/usr/bin"; } // attrs; qsub = attrs: (callPackage ./lib/qsub.nix {}) (qsubDefs // attrs); - exec = f: x: y: qsub (builtins.intersectAttrs qsubDefs x) (f (builtins.removeAttrs x (builtins.attrNames qsubDefs)) y); + exec = f: x: y: qsub (builtins.intersectAttrs qsubDefs x) (super.exec (builtins.removeAttrs x (builtins.attrNames qsubDefs)) y); }); def = f: defs: attrs: f (defs // attrs); pipe = let g = fs: with builtins; let h = head fs; t = tail fs; in if t != [] then x: (g t (h x)) else h; in g; -- cgit v1.2.3