gnu: deutex: Update to 5.2.1.
[jackhill/guix/guix.git] / gnu / packages / parallel.scm
CommitLineData
e3aaefe7 1;;; GNU Guix --- Functional package management for GNU
552f5c00 2;;; Copyright © 2013, 2014 Eric Bavier <bavier@member.fsf.org>
ff03ef0b 3;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
de596e99 4;;; Copyright © 2015, 2016, 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
552f5c00
PP
5;;; Copyright © 2016 Pjotr Prins <pjotr.guix@thebird.nl>
6;;; Copyright © 2016 Andreas Enge <andreas@enge.fr>
524eee02 7;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
47bc991f 8;;; Copyright © 2016 Ben Woodcroft <donttrustben@gmail.com>
035ee04b 9;;; Copyright © 2017, 2018 Rutger Helling <rhelling@mykolab.com>
d4c95a23 10;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
4e7950fd 11;;; Copyright © 2018 Clément Lassieur <clement@lassieur.org>
0c212811 12;;; Copyright © 2019 Ludovic Courtès <ludo@gnu.org>
e3aaefe7
EB
13;;;
14;;; This file is part of GNU Guix.
15;;;
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.
20;;;
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.
25;;;
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/>.
28
29(define-module (gnu packages parallel)
552f5c00 30 #:use-module (guix download)
0c212811
LC
31 #:use-module (guix git-download)
32 #:use-module (guix build-system gnu)
33 #:use-module (guix build-system python)
552f5c00 34 #:use-module ((guix licenses) #:prefix license:)
bead6dcb 35 #:use-module ((guix utils) #:select (target-64bit?))
552f5c00 36 #:use-module (guix packages)
e3aaefe7 37 #:use-module (gnu packages)
552f5c00
PP
38 #:use-module (gnu packages admin)
39 #:use-module (gnu packages autotools)
524eee02 40 #:use-module (gnu packages base)
552f5c00
PP
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)
312ec128 47 #:use-module (gnu packages python-science)
0c212811 48 #:use-module (gnu packages python-xyz)
552f5c00
PP
49 #:use-module (gnu packages readline)
50 #:use-module (gnu packages tcl)
51 #:use-module (gnu packages tls)
52 #:use-module (gnu packages web))
e3aaefe7
EB
53
54(define-public parallel
55 (package
56 (name "parallel")
026a0ba9 57 (version "20191222")
e3aaefe7
EB
58 (source
59 (origin
60 (method url-fetch)
61 (uri (string-append "mirror://gnu/parallel/parallel-"
62 version ".tar.bz2"))
63 (sha256
026a0ba9 64 (base32 "0xvw578440s9cc382n7z2l8npj30nwr6wwmkyxn2pj1pcszfjagy"))))
e3aaefe7 65 (build-system gnu-build-system)
47bc991f
BW
66 (arguments
67 `(#:phases
68 (modify-phases %standard-phases
69 (add-after 'unpack 'patch-bin-sh
70 (lambda _
71 (for-each
72 (lambda (file)
73 (substitute* file
2c36baa5 74 ;; Patch hard coded '/bin/sh' in the line ending in:
47bc991f
BW
75 ;; $Global::shell = $ENV{'PARALLEL_SHELL'} ||
76 ;; parent_shell($$) || $ENV{'SHELL'} || "/bin/sh";
4e7950fd 77 (("/bin/sh\\\";\n$") (string-append (which "sh") "\";\n"))))
fccab993
EF
78 (list "src/parallel" "src/sem"))
79 #t))
4e7950fd
CL
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")
84 `("PATH" ":" prefix
85 ,(map (lambda (input)
86 (string-append (assoc-ref inputs input) "/bin"))
87 '("perl"
88 "procps"))))
89 #t)))
90 (add-after 'wrap-program 'post-install-test
47bc991f 91 (lambda* (#:key outputs #:allow-other-keys)
28b0b21e
TGR
92 (invoke (string-append
93 (assoc-ref outputs "out") "/bin/parallel")
94 "echo"
95 ":::" "1" "2" "3"))))))
47bc991f 96 (inputs
5ca5ab8b 97 `(("perl" ,perl)
47bc991f 98 ("procps" ,procps)))
fccab993 99 (home-page "https://www.gnu.org/software/parallel/")
e3aaefe7
EB
100 (synopsis "Build and execute command lines in parallel")
101 (description
102 "GNU Parallel is a tool for executing shell jobs in parallel using one
103or more computers. Jobs can consist of single commands or of scripts
104and they are executed on lists of files, hosts, users or other items.")
552f5c00
PP
105 (license license:gpl3+)))
106
107(define-public slurm
108 (package
109 (name "slurm")
7c96befa 110 (version "19.05.3-2")
552f5c00
PP
111 (source (origin
112 (method url-fetch)
113 (uri (string-append
ea1f073d
LF
114 "https://download.schedmd.com/slurm/slurm-"
115 version ".tar.bz2"))
552f5c00
PP
116 (sha256
117 (base32
7c96befa 118 "0qj4blfymrd2ry2qmb58l3jbr4jwygc3adcfw7my27rippcijlyc"))
552f5c00
PP
119 (modules '((guix build utils)))
120 (snippet
121 '(begin
7c96befa
LC
122 ;; According to
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
127 ;; contribs/pmi/.
4ff22ec3 128 (substitute* "configure.ac"
7c96befa
LC
129 (("^[[:space:]]+contribs/(.*)$" all directory)
130 (if (and (string-prefix? "pmi" directory)
131 (not (string-prefix? "pmi2" directory)))
132 all
133 "")))
134
135 (rename-file "contribs/pmi" "tmp-pmi")
552f5c00 136 (delete-file-recursively "contribs")
7c96befa
LC
137 (mkdir "contribs")
138 (rename-file "tmp-pmi" "contribs/pmi")
552f5c00
PP
139 #t))))
140 ;; FIXME: More optional inputs could be added,
141 ;; in particular mysql and gtk+.
142 (inputs `(("expect" ,expect)
143 ("freeipmi" ,freeipmi)
58a536bb 144 ("hwloc" ,hwloc-2 "lib")
552f5c00
PP
145 ("json-c" ,json-c)
146 ("linux-pam" , linux-pam)
147 ("munge" ,munge)
148 ("numactl" ,numactl)
552f5c00
PP
149 ("perl" ,perl)
150 ("python" ,python-wrapper)
151 ("readline" ,readline)))
152 (native-inputs
153 `(("autoconf" ,autoconf)
154 ("pkg-config" ,pkg-config)))
155 (build-system gnu-build-system)
156 (arguments
157 `(#:configure-flags
e31ece97 158 (list "--enable-pam" "--sysconfdir=/etc/slurm"
52cd164a 159 "--disable-static"
552f5c00
PP
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"))
bead6dcb
LC
163 (string-append "--with-munge=" (assoc-ref %build-inputs "munge"))
164
165 ;; 32-bit support is marked as deprecated and needs to be
166 ;; explicitly enabled.
167 ,@(if (target-64bit?) '() '("--enable-deprecated")))
552f5c00
PP
168 #:phases
169 (modify-phases %standard-phases
4ff22ec3 170 (add-after 'unpack 'autoconf
7c96befa
LC
171 (lambda _ (invoke "autoconf"))) ;configure.ac was patched
172 (add-after 'install 'install-libpmi
173 (lambda _
174 ;; Open MPI expects libpmi to be provided by Slurm so install it.
175 (invoke "make" "install" "-C" "contribs/pmi"))))))
91257587 176 (home-page "https://slurm.schedmd.com/")
552f5c00
PP
177 (synopsis "Workload manager for cluster computing")
178 (description
179 "SLURM is a fault-tolerant and highly scalable cluster management and job
180scheduling system for large and small clusters. It allocates access to
181resources (computer nodes) to users for some duration of time, provides a
182framework for starting, executing, and monitoring work (typically a parallel
183job) on a set of allocated nodes, and arbitrates contention for resources
184by managing a queue of pending work.")
70260b33
TGR
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
524eee02
RW
191
192(define-public slurm-drmaa
193 (package
194 (name "slurm-drmaa")
195 (version "1.0.7")
196 (source (origin
197 (method url-fetch)
198 (uri "http://apps.man.poznan.pl/trac/slurm-drmaa/downloads/9")
199 (file-name (string-append name "-" version ".tar.gz"))
200 (sha256
201 (base32
202 "0grw55hmny2mc4nc0y1arnvxd2k0dcdfn476kzs180fibjxgfw14"))))
203 (build-system gnu-build-system)
204 (inputs
205 `(("slurm" ,slurm)))
206 (native-inputs
207 `(("which" ,which)))
208 (home-page "http://apps.man.poznan.pl/trac/slurm-drmaa")
209 (synopsis "Distributed resource management application API for SLURM")
210 (description
211 "PSNC DRMAA for Simple Linux Utility for Resource Management (SLURM) is
212an implementation of Open Grid Forum DRMAA 1.0 (Distributed Resource
213Management Application API) specification for submission and control of jobs
214to SLURM. Using DRMAA, grid applications builders, portal developers and ISVs
215can use the same high-level API to link their software with different
216cluster/resource management systems.")
217 (license license:gpl3+)))
0c212811
LC
218
219(define-public python-slurm-magic
220 (let ((commit "73dd1a2b85799f7dae4b3f1cd9027536eff0c4d7")
221 (revision "0"))
222 (package
223 (name "python-slurm-magic")
224 (version (git-version "0.0" revision commit))
225 (home-page "https://github.com/NERSC/slurm-magic")
226 (source (origin
227 (method git-fetch)
228 (uri (git-reference (url home-page)
229 (commit commit)))
230 (sha256
231 (base32
232 "19pp2vs0wm8mx0arz9n6lw9wgyv70w9wyi4y6b91qc5j3bz5igfs"))
233 (file-name (git-file-name name version))))
234 (build-system python-build-system)
235 (arguments
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
241 ;; instead.
242 (let ((slurm (assoc-ref inputs "slurm")))
243 (substitute* "slurm_magic.py"
244 (("name = (.*)$" _ value)
245 (string-append "name = \""
246 slurm "/bin/\" + "
247 value "\n")))
248 #t))))))
249 (inputs
250 `(("slurm" ,slurm)))
251 (propagated-inputs
252 `(("python-ipython" ,python-ipython)
253 ("python-pandas" ,python-pandas)))
254 (synopsis "Control the SLURM batch scheduler from Jupyter Notebook")
255 (description
256 "This package implements Jupyter/IPython
257@uref{http://ipython.readthedocs.io/en/stable/interactive/magics.html, magic
258commands} for interacting with the SLURM workload manager. SLURM magic simply
259wraps command-line executables and the commands themselves should look like
260their command-line counterparts. Commands are spawned via @code{subprocess}
261and output captured in the notebook. Whatever arguments are accepted by a
262SLURM command line executable are also accepted by the corresponding magic
263command---e.g., @code{%salloc}, @code{%sbatch}, etc.")
264 (license license:bsd-3))))