1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014, 2020 Eric Bavier <bavier@posteo.net>
3 ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
4 ;;; Copyright © 2015, 2016, 2017, 2018, 2020 Efraim Flashner <efraim@flashner.co.il>
5 ;;; Copyright © 2016 Pjotr Prins <pjotr.guix@thebird.nl>
6 ;;; Copyright © 2016 Andreas Enge <andreas@enge.fr>
7 ;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
8 ;;; Copyright © 2016 Ben Woodcroft <donttrustben@gmail.com>
9 ;;; Copyright © 2017, 2018 Rutger Helling <rhelling@mykolab.com>
10 ;;; Copyright © 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
11 ;;; Copyright © 2018 Clément Lassieur <clement@lassieur.org>
12 ;;; Copyright © 2019 Ludovic Courtès <ludo@gnu.org>
14 ;;; This file is part of GNU Guix.
16 ;;; GNU Guix is free software; you can redistribute it and/or modify it
17 ;;; under the terms of the GNU General Public License as published by
18 ;;; the Free Software Foundation; either version 3 of the License, or (at
19 ;;; your option) any later version.
21 ;;; GNU Guix is distributed in the hope that it will be useful, but
22 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
23 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 ;;; GNU General Public License for more details.
26 ;;; You should have received a copy of the GNU General Public License
27 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
29 (define-module (gnu packages parallel)
30 #:use-module (guix download)
31 #:use-module (guix git-download)
32 #:use-module (guix build-system gnu)
33 #:use-module (guix build-system python)
34 #:use-module ((guix licenses) #:prefix license:)
35 #:use-module ((guix utils) #:select (target-64bit?))
36 #:use-module (guix packages)
37 #:use-module (gnu packages)
38 #:use-module (gnu packages admin)
39 #:use-module (gnu packages autotools)
40 #:use-module (gnu packages base)
41 #:use-module (gnu packages freeipmi)
42 #:use-module (gnu packages linux)
43 #:use-module (gnu packages mpi)
44 #:use-module (gnu packages perl)
45 #:use-module (gnu packages pkg-config)
46 #:use-module (gnu packages python)
47 #:use-module (gnu packages python-science)
48 #:use-module (gnu packages python-xyz)
49 #:use-module (gnu packages readline)
50 #:use-module (gnu packages tcl)
51 #:use-module (gnu packages tls)
52 #:use-module (gnu packages web))
54 (define-public parallel
61 (uri (string-append "mirror://gnu/parallel/parallel-"
64 (base32 "0c2mr2rzsz0y24q4mbm2zmc2fz6bcda4gbc4qgg59sirrj8vzpjb"))))
65 (build-system gnu-build-system)
68 (modify-phases %standard-phases
69 (add-after 'unpack 'patch-bin-sh
74 ;; Patch hard coded '/bin/sh' in the line ending in:
75 ;; $Global::shell = $ENV{'PARALLEL_SHELL'} ||
76 ;; parent_shell($$) || $ENV{'SHELL'} || "/bin/sh";
77 (("/bin/sh\\\";\n$") (string-append (which "sh") "\";\n"))))
78 (list "src/parallel" "src/sem"))
80 (add-after 'install 'wrap-program
81 (lambda* (#:key inputs outputs #:allow-other-keys)
82 (let ((out (assoc-ref outputs "out")))
83 (wrap-program (string-append out "/bin/parallel")
86 (string-append (assoc-ref inputs input) "/bin"))
90 (add-after 'wrap-program 'post-install-test
91 (lambda* (#:key outputs #:allow-other-keys)
92 (invoke (string-append
93 (assoc-ref outputs "out") "/bin/parallel")
95 ":::" "1" "2" "3"))))))
99 (home-page "https://www.gnu.org/software/parallel/")
100 (synopsis "Build and execute command lines in parallel")
102 "GNU Parallel is a tool for executing shell jobs in parallel using one
103 or more computers. Jobs can consist of single commands or of scripts
104 and they are executed on lists of files, hosts, users or other items.")
105 (license license:gpl3+)))
110 (version "19.05.3-2")
114 "https://download.schedmd.com/slurm/slurm-"
118 "0qj4blfymrd2ry2qmb58l3jbr4jwygc3adcfw7my27rippcijlyc"))
119 (modules '((guix build utils)))
123 ;; <https://lists.gnu.org/archive/html/guix-devel/2016-02/msg00534.html>
124 ;; there are non-free bits under contribs/, though it's not
125 ;; clear which ones. libpmi is clearly free (it used to be
126 ;; under src/api/), so remove all of contribs/ except
128 (substitute* "configure.ac"
129 (("^[[:space:]]+contribs/(.*)$" all directory)
130 (if (and (string-prefix? "pmi" directory)
131 (not (string-prefix? "pmi2" directory)))
135 (rename-file "contribs/pmi" "tmp-pmi")
136 (delete-file-recursively "contribs")
138 (rename-file "tmp-pmi" "contribs/pmi")
140 ;; FIXME: More optional inputs could be added,
141 ;; in particular mysql and gtk+.
142 (inputs `(("expect" ,expect)
143 ("freeipmi" ,freeipmi)
144 ("hwloc" ,hwloc-2 "lib")
146 ("linux-pam" , linux-pam)
150 ("python" ,python-wrapper)
151 ("readline" ,readline)))
153 `(("autoconf" ,autoconf)
154 ("pkg-config" ,pkg-config)))
155 (build-system gnu-build-system)
158 (list "--enable-pam" "--sysconfdir=/etc/slurm"
160 (string-append "--with-freeipmi=" (assoc-ref %build-inputs "freeipmi"))
161 (string-append "--with-hwloc=" (assoc-ref %build-inputs "hwloc"))
162 (string-append "--with-json=" (assoc-ref %build-inputs "json-c"))
163 (string-append "--with-munge=" (assoc-ref %build-inputs "munge"))
165 ;; 32-bit support is marked as deprecated and needs to be
166 ;; explicitly enabled.
167 ,@(if (target-64bit?) '() '("--enable-deprecated")))
169 (modify-phases %standard-phases
170 (add-after 'unpack 'autoconf
171 (lambda _ (invoke "autoconf"))) ;configure.ac was patched
172 (add-after 'install 'install-libpmi
174 ;; Open MPI expects libpmi to be provided by Slurm so install it.
175 (invoke "make" "install" "-C" "contribs/pmi"))))))
176 (home-page "https://slurm.schedmd.com/")
177 (synopsis "Workload manager for cluster computing")
179 "SLURM is a fault-tolerant and highly scalable cluster management and job
180 scheduling system for large and small clusters. It allocates access to
181 resources (computer nodes) to users for some duration of time, provides a
182 framework for starting, executing, and monitoring work (typically a parallel
183 job) on a set of allocated nodes, and arbitrates contention for resources
184 by managing a queue of pending work.")
185 (license (list license:bsd-2 ; src/common/log.[ch], src/common/uthash
186 license:expat ; slurm/pmi.h
187 license:isc ; src/common/strlcpy.c
188 license:lgpl2.1+ ; hilbert.[ch], src/common/slurm_time.h
189 license:zlib ; src/common/strnatcmp.c
190 license:gpl2+)))) ; the rest, often with OpenSSL exception
192 (define-public slurm-drmaa
198 (uri "http://apps.man.poznan.pl/trac/slurm-drmaa/downloads/9")
199 (file-name (string-append name "-" version ".tar.gz"))
202 "0grw55hmny2mc4nc0y1arnvxd2k0dcdfn476kzs180fibjxgfw14"))))
203 (build-system gnu-build-system)
208 (home-page "http://apps.man.poznan.pl/trac/slurm-drmaa")
209 (synopsis "Distributed resource management application API for SLURM")
211 "PSNC DRMAA for Simple Linux Utility for Resource Management (SLURM) is
212 an implementation of Open Grid Forum DRMAA 1.0 (Distributed Resource
213 Management Application API) specification for submission and control of jobs
214 to SLURM. Using DRMAA, grid applications builders, portal developers and ISVs
215 can use the same high-level API to link their software with different
216 cluster/resource management systems.")
217 (license license:gpl3+)))
219 (define-public python-slurm-magic
220 (let ((commit "73dd1a2b85799f7dae4b3f1cd9027536eff0c4d7")
223 (name "python-slurm-magic")
224 (version (git-version "0.0" revision commit))
225 (home-page "https://github.com/NERSC/slurm-magic")
228 (uri (git-reference (url home-page)
232 "19pp2vs0wm8mx0arz9n6lw9wgyv70w9wyi4y6b91qc5j3bz5igfs"))
233 (file-name (git-file-name name version))))
234 (build-system python-build-system)
236 '(#:phases (modify-phases %standard-phases
237 (add-before 'build 'set-slurm-path
238 (lambda* (#:key inputs #:allow-other-keys)
239 ;; The '_execute' method tries to exec 'salloc'
240 ;; etc. from $PATH. Record the absolute file name
242 (let ((slurm (assoc-ref inputs "slurm")))
243 (substitute* "slurm_magic.py"
244 (("name = (.*)$" _ value)
245 (string-append "name = \""
252 `(("python-ipython" ,python-ipython)
253 ("python-pandas" ,python-pandas)))
254 (synopsis "Control the SLURM batch scheduler from Jupyter Notebook")
256 "This package implements Jupyter/IPython
257 @uref{http://ipython.readthedocs.io/en/stable/interactive/magics.html, magic
258 commands} for interacting with the SLURM workload manager. SLURM magic simply
259 wraps command-line executables and the commands themselves should look like
260 their command-line counterparts. Commands are spawned via @code{subprocess}
261 and output captured in the notebook. Whatever arguments are accepted by a
262 SLURM command line executable are also accepted by the corresponding magic
263 command---e.g., @code{%salloc}, @code{%sbatch}, etc.")
264 (license license:bsd-3))))