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, 2021 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, 2020 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, 2020 Ludovic Courtès <ludo@gnu.org>
13 ;;; Copyright © 2020 Roel Janssen <roel@gnu.org>
15 ;;; This file is part of GNU Guix.
17 ;;; GNU Guix is free software; you can redistribute it and/or modify it
18 ;;; under the terms of the GNU General Public License as published by
19 ;;; the Free Software Foundation; either version 3 of the License, or (at
20 ;;; your option) any later version.
22 ;;; GNU Guix is distributed in the hope that it will be useful, but
23 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
24 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 ;;; GNU General Public License for more details.
27 ;;; You should have received a copy of the GNU General Public License
28 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
30 (define-module (gnu packages parallel)
31 #:use-module (guix download)
32 #:use-module (guix git-download)
33 #:use-module (guix build-system gnu)
34 #:use-module (guix build-system python)
35 #:use-module ((guix licenses) #:prefix license:)
36 #:use-module ((guix utils) #:select (target-64bit?))
37 #:use-module (guix packages)
38 #:use-module (gnu packages)
39 #:use-module (gnu packages admin)
40 #:use-module (gnu packages autotools)
41 #:use-module (gnu packages base)
42 #:use-module (gnu packages freeipmi)
43 #:use-module (gnu packages linux)
44 #:use-module (gnu packages mpi)
45 #:use-module (gnu packages perl)
46 #:use-module (gnu packages pkg-config)
47 #:use-module (gnu packages python)
48 #:use-module (gnu packages python-science)
49 #:use-module (gnu packages python-xyz)
50 #:use-module (gnu packages readline)
51 #:use-module (gnu packages tcl)
52 #:use-module (gnu packages tls)
53 #:use-module (gnu packages web))
55 (define-public parallel
62 (uri (string-append "mirror://gnu/parallel/parallel-"
65 (base32 "13kxg2vmy20ciiv1gp96g33bmvma1nh5d66jdix1fqj6xjaizr5n"))))
66 (build-system gnu-build-system)
69 (modify-phases %standard-phases
70 (add-after 'unpack 'patch-bin-sh
75 ;; Patch hard coded '/bin/sh' in the line ending in:
76 ;; $Global::shell = $ENV{'PARALLEL_SHELL'} ||
77 ;; parent_shell($$) || $ENV{'SHELL'} || "/bin/sh";
78 (("/bin/sh\\\";\n$") (string-append (which "sh") "\";\n"))))
79 (list "src/parallel" "src/sem"))
81 (add-after 'install 'wrap-program
82 (lambda* (#:key inputs outputs #:allow-other-keys)
83 (let ((out (assoc-ref outputs "out")))
84 (wrap-program (string-append out "/bin/parallel")
87 (string-append (assoc-ref inputs input) "/bin"))
91 (add-after 'wrap-program 'post-install-test
92 (lambda* (#:key outputs #:allow-other-keys)
93 (invoke (string-append
94 (assoc-ref outputs "out") "/bin/parallel")
96 ":::" "1" "2" "3"))))))
100 (home-page "https://www.gnu.org/software/parallel/")
101 (synopsis "Build and execute command lines in parallel")
103 "GNU Parallel is a tool for executing shell jobs in parallel using one
104 or more computers. Jobs can consist of single commands or of scripts
105 and they are executed on lists of files, hosts, users or other items.")
106 (license license:gpl3+)))
115 "https://download.schedmd.com/slurm/slurm-"
119 "15h2vs58apgdz02ijgr46090vjyaa81qcm76mm6fxlvkkfd4pyxp"))
120 (modules '((guix build utils)))
124 ;; <https://lists.gnu.org/archive/html/guix-devel/2016-02/msg00534.html>
125 ;; there are non-free bits under contribs/, though it's not
126 ;; clear which ones. libpmi is clearly free (it used to be
127 ;; under src/api/), so remove all of contribs/ except
129 (substitute* "configure.ac"
130 (("^[[:space:]]+contribs/(.*)$" all directory)
131 (if (and (string-prefix? "pmi" directory)
132 (not (string-prefix? "pmi2" directory)))
136 (rename-file "contribs/pmi" "tmp-pmi")
137 (delete-file-recursively "contribs")
139 (rename-file "tmp-pmi" "contribs/pmi")
141 ;; FIXME: More optional inputs could be added,
142 ;; in particular mysql and gtk+.
143 (inputs `(("freeipmi" ,freeipmi)
144 ("hwloc" ,hwloc-2 "lib")
146 ("linux-pam" , linux-pam)
149 ("readline" ,readline)))
151 `(("autoconf" ,autoconf)
154 ("pkg-config" ,pkg-config)
155 ("python" ,python-wrapper)))
156 (build-system gnu-build-system)
159 (list "--enable-pam" "--sysconfdir=/etc/slurm"
161 (string-append "--with-freeipmi=" (assoc-ref %build-inputs "freeipmi"))
162 (string-append "--with-hwloc=" (assoc-ref %build-inputs "hwloc"))
163 (string-append "--with-json=" (assoc-ref %build-inputs "json-c"))
164 (string-append "--with-munge=" (assoc-ref %build-inputs "munge"))
166 ;; 32-bit support is marked as deprecated and needs to be
167 ;; explicitly enabled.
168 ,@(if (target-64bit?) '() '("--enable-deprecated")))
170 (modify-phases %standard-phases
171 (add-after 'unpack 'autoconf
172 (lambda _ (invoke "autoconf"))) ;configure.ac was patched
173 (add-after 'install 'install-libpmi
175 ;; Open MPI expects libpmi to be provided by Slurm so install it.
176 (invoke "make" "install" "-C" "contribs/pmi"))))))
177 (home-page "https://slurm.schedmd.com/")
178 (synopsis "Workload manager for cluster computing")
180 "SLURM is a fault-tolerant and highly scalable cluster management and job
181 scheduling system for large and small clusters. It allocates access to
182 resources (computer nodes) to users for some duration of time, provides a
183 framework for starting, executing, and monitoring work (typically a parallel
184 job) on a set of allocated nodes, and arbitrates contention for resources
185 by managing a queue of pending work.")
186 (license (list license:bsd-2 ; src/common/log.[ch], src/common/uthash
187 license:expat ; slurm/pmi.h
188 license:isc ; src/common/strlcpy.c
189 license:lgpl2.1+ ; hilbert.[ch], src/common/slurm_time.h
190 license:zlib ; src/common/strnatcmp.c
191 license:gpl2+)))) ; the rest, often with OpenSSL exception
193 ;; The SLURM client/daemon protocol and file format changes from time to time
194 ;; in incompatible ways, as noted in
195 ;; <https://slurm.schedmd.com/troubleshoot.html#network>. Thus, keep older
196 ;; releases here. See also <https://issues.guix.gnu.org/44387>.
198 (define-public slurm-20.02
201 (version "20.02.6-1")
203 (inherit (package-source slurm))
206 "https://download.schedmd.com/slurm/slurm-"
210 "0qj4blfymrd2ry2qmb58l3jbr4jwygc3adcfw7my27rippcijlyc"))))))
213 (define-public slurm-19.05
216 (version "19.05.3-2")
218 (inherit (package-source slurm))
221 "https://download.schedmd.com/slurm/slurm-"
225 "0qj4blfymrd2ry2qmb58l3jbr4jwygc3adcfw7my27rippcijlyc"))))))
228 (define-public slurm-18.08
231 (version "18.08.5-2")
234 (inherit (package-source slurm))
236 "https://download.schedmd.com/slurm/slurm-"
240 "0xrj12nmkhvhzi7cyh4yvdm8qa51ji3j82mgpq7sx87g30f9spn4"))))))
242 (define-public slurm-drmaa
249 "https://github.com/natefoo/slurm-drmaa/releases/download/"
250 version "/slurm-drmaa-" version ".tar.gz"))
253 "19r4cm88pcpm3wli4cc61zq7354pg67cg866f3a430p15hm1knrn"))))
254 (build-system gnu-build-system)
255 (arguments `(#:tests? #f)) ; The tests require "bats".
260 (home-page "https://github.com/natefoo/slurm-drmaa")
261 (synopsis "Distributed resource management application API for SLURM")
263 "PSNC DRMAA for Simple Linux Utility for Resource Management (SLURM) is
264 an implementation of Open Grid Forum DRMAA 1.0 (Distributed Resource
265 Management Application API) specification for submission and control of jobs
266 to SLURM. Using DRMAA, grid applications builders, portal developers and ISVs
267 can use the same high-level API to link their software with different
268 cluster/resource management systems.")
269 (license license:gpl3+)))
271 (define-public python-slurm-magic
272 (let ((commit "73dd1a2b85799f7dae4b3f1cd9027536eff0c4d7")
275 (name "python-slurm-magic")
276 (version (git-version "0.0" revision commit))
277 (home-page "https://github.com/NERSC/slurm-magic")
280 (uri (git-reference (url home-page)
284 "19pp2vs0wm8mx0arz9n6lw9wgyv70w9wyi4y6b91qc5j3bz5igfs"))
285 (file-name (git-file-name name version))))
286 (build-system python-build-system)
288 '(#:phases (modify-phases %standard-phases
289 (add-before 'build 'set-slurm-path
290 (lambda* (#:key inputs #:allow-other-keys)
291 ;; The '_execute' method tries to exec 'salloc'
292 ;; etc. from $PATH. Record the absolute file name
294 (let ((slurm (assoc-ref inputs "slurm")))
295 (substitute* "slurm_magic.py"
296 (("name = (.*)$" _ value)
297 (string-append "name = \""
304 `(("python-ipython" ,python-ipython)
305 ("python-pandas" ,python-pandas)))
306 (synopsis "Control the SLURM batch scheduler from Jupyter Notebook")
308 "This package implements Jupyter/IPython
309 @uref{http://ipython.readthedocs.io/en/stable/interactive/magics.html, magic
310 commands} for interacting with the SLURM workload manager. SLURM magic simply
311 wraps command-line executables and the commands themselves should look like
312 their command-line counterparts. Commands are spawned via @code{subprocess}
313 and output captured in the notebook. Whatever arguments are accepted by a
314 SLURM command line executable are also accepted by the corresponding magic
315 command---e.g., @code{%salloc}, @code{%sbatch}, etc.")
316 (license license:bsd-3))))