gnu: parallel: Update to 20191022.
[jackhill/guix/guix.git] / gnu / packages / parallel.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014 Eric Bavier <bavier@member.fsf.org>
3 ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
4 ;;; Copyright © 2015, 2016, 2017, 2018 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 Tobias Geerinckx-Rice <me@tobias.gr>
11 ;;; Copyright © 2018 Clément Lassieur <clement@lassieur.org>
12 ;;; Copyright © 2019 Ludovic Courtès <ludo@gnu.org>
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)
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 packages)
36 #:use-module (gnu packages)
37 #:use-module (gnu packages admin)
38 #:use-module (gnu packages autotools)
39 #:use-module (gnu packages base)
40 #:use-module (gnu packages freeipmi)
41 #:use-module (gnu packages linux)
42 #:use-module (gnu packages mpi)
43 #:use-module (gnu packages perl)
44 #:use-module (gnu packages pkg-config)
45 #:use-module (gnu packages python)
46 #:use-module (gnu packages python-xyz)
47 #:use-module (gnu packages readline)
48 #:use-module (gnu packages tcl)
49 #:use-module (gnu packages tls)
50 #:use-module (gnu packages web))
51
52 (define-public parallel
53 (package
54 (name "parallel")
55 (version "20191022")
56 (source
57 (origin
58 (method url-fetch)
59 (uri (string-append "mirror://gnu/parallel/parallel-"
60 version ".tar.bz2"))
61 (sha256
62 (base32 "1a89x5ix9kls1abj8zkgxdf3g3s5phzb83xcd4cwpz4szfjfw6v4"))))
63 (build-system gnu-build-system)
64 (arguments
65 `(#:phases
66 (modify-phases %standard-phases
67 (add-after 'unpack 'patch-bin-sh
68 (lambda _
69 (for-each
70 (lambda (file)
71 (substitute* file
72 ;; Patch hard coded '/bin/sh' in the line ending in:
73 ;; $Global::shell = $ENV{'PARALLEL_SHELL'} ||
74 ;; parent_shell($$) || $ENV{'SHELL'} || "/bin/sh";
75 (("/bin/sh\\\";\n$") (string-append (which "sh") "\";\n"))))
76 (list "src/parallel" "src/sem"))
77 #t))
78 (add-after 'install 'wrap-program
79 (lambda* (#:key inputs outputs #:allow-other-keys)
80 (let ((out (assoc-ref outputs "out")))
81 (wrap-program (string-append out "/bin/parallel")
82 `("PATH" ":" prefix
83 ,(map (lambda (input)
84 (string-append (assoc-ref inputs input) "/bin"))
85 '("perl"
86 "procps"))))
87 #t)))
88 (add-after 'wrap-program 'post-install-test
89 (lambda* (#:key outputs #:allow-other-keys)
90 (invoke (string-append
91 (assoc-ref outputs "out") "/bin/parallel")
92 "echo"
93 ":::" "1" "2" "3"))))))
94 (inputs
95 `(("perl" ,perl)
96 ("procps" ,procps)))
97 (home-page "https://www.gnu.org/software/parallel/")
98 (synopsis "Build and execute command lines in parallel")
99 (description
100 "GNU Parallel is a tool for executing shell jobs in parallel using one
101 or more computers. Jobs can consist of single commands or of scripts
102 and they are executed on lists of files, hosts, users or other items.")
103 (license license:gpl3+)))
104
105 (define-public slurm
106 (package
107 (name "slurm")
108 (version "17.11.3")
109 (source (origin
110 (method url-fetch)
111 (uri (string-append
112 "https://download.schedmd.com/slurm/slurm-"
113 version ".tar.bz2"))
114 (sha256
115 (base32
116 "1x3i6z03d9m46fvj1cslrapm1drvgyqch9pn4xf23kvbz4gkhaps"))
117 (modules '((guix build utils)))
118 (snippet
119 '(begin
120 (substitute* "configure.ac"
121 (("^[[:space:]]+contribs/.*$") ""))
122 (delete-file-recursively "contribs")
123 #t))))
124 ;; FIXME: More optional inputs could be added,
125 ;; in particular mysql and gtk+.
126 (inputs `(("expect" ,expect)
127 ("freeipmi" ,freeipmi)
128 ("hwloc" ,hwloc "lib")
129 ("json-c" ,json-c)
130 ("linux-pam" , linux-pam)
131 ("munge" ,munge)
132 ("numactl" ,numactl)
133 ("openssl" ,openssl)
134 ("perl" ,perl)
135 ("python" ,python-wrapper)
136 ("readline" ,readline)))
137 (native-inputs
138 `(("autoconf" ,autoconf)
139 ("pkg-config" ,pkg-config)))
140 (build-system gnu-build-system)
141 (arguments
142 `(#:configure-flags
143 (list "--enable-pam" "--sysconfdir=/etc/slurm"
144 (string-append "--with-freeipmi=" (assoc-ref %build-inputs "freeipmi"))
145 (string-append "--with-hwloc=" (assoc-ref %build-inputs "hwloc"))
146 (string-append "--with-json=" (assoc-ref %build-inputs "json-c"))
147 (string-append "--with-munge=" (assoc-ref %build-inputs "munge"))
148 (string-append "--with-ssl=" (assoc-ref %build-inputs "openssl")))
149 #:phases
150 (modify-phases %standard-phases
151 (add-after 'unpack 'autoconf
152 (lambda _ (invoke "autoconf")))))) ; configure.ac was patched
153 (home-page "https://slurm.schedmd.com/")
154 (synopsis "Workload manager for cluster computing")
155 (description
156 "SLURM is a fault-tolerant and highly scalable cluster management and job
157 scheduling system for large and small clusters. It allocates access to
158 resources (computer nodes) to users for some duration of time, provides a
159 framework for starting, executing, and monitoring work (typically a parallel
160 job) on a set of allocated nodes, and arbitrates contention for resources
161 by managing a queue of pending work.")
162 (license (list license:bsd-2 ; src/common/log.[ch], src/common/uthash
163 license:expat ; slurm/pmi.h
164 license:isc ; src/common/strlcpy.c
165 license:lgpl2.1+ ; hilbert.[ch], src/common/slurm_time.h
166 license:zlib ; src/common/strnatcmp.c
167 license:gpl2+)))) ; the rest, often with OpenSSL exception
168
169 (define-public slurm-drmaa
170 (package
171 (name "slurm-drmaa")
172 (version "1.0.7")
173 (source (origin
174 (method url-fetch)
175 (uri "http://apps.man.poznan.pl/trac/slurm-drmaa/downloads/9")
176 (file-name (string-append name "-" version ".tar.gz"))
177 (sha256
178 (base32
179 "0grw55hmny2mc4nc0y1arnvxd2k0dcdfn476kzs180fibjxgfw14"))))
180 (build-system gnu-build-system)
181 (inputs
182 `(("slurm" ,slurm)))
183 (native-inputs
184 `(("which" ,which)))
185 (home-page "http://apps.man.poznan.pl/trac/slurm-drmaa")
186 (synopsis "Distributed resource management application API for SLURM")
187 (description
188 "PSNC DRMAA for Simple Linux Utility for Resource Management (SLURM) is
189 an implementation of Open Grid Forum DRMAA 1.0 (Distributed Resource
190 Management Application API) specification for submission and control of jobs
191 to SLURM. Using DRMAA, grid applications builders, portal developers and ISVs
192 can use the same high-level API to link their software with different
193 cluster/resource management systems.")
194 (license license:gpl3+)))
195
196 (define-public python-slurm-magic
197 (let ((commit "73dd1a2b85799f7dae4b3f1cd9027536eff0c4d7")
198 (revision "0"))
199 (package
200 (name "python-slurm-magic")
201 (version (git-version "0.0" revision commit))
202 (home-page "https://github.com/NERSC/slurm-magic")
203 (source (origin
204 (method git-fetch)
205 (uri (git-reference (url home-page)
206 (commit commit)))
207 (sha256
208 (base32
209 "19pp2vs0wm8mx0arz9n6lw9wgyv70w9wyi4y6b91qc5j3bz5igfs"))
210 (file-name (git-file-name name version))))
211 (build-system python-build-system)
212 (arguments
213 '(#:phases (modify-phases %standard-phases
214 (add-before 'build 'set-slurm-path
215 (lambda* (#:key inputs #:allow-other-keys)
216 ;; The '_execute' method tries to exec 'salloc'
217 ;; etc. from $PATH. Record the absolute file name
218 ;; instead.
219 (let ((slurm (assoc-ref inputs "slurm")))
220 (substitute* "slurm_magic.py"
221 (("name = (.*)$" _ value)
222 (string-append "name = \""
223 slurm "/bin/\" + "
224 value "\n")))
225 #t))))))
226 (inputs
227 `(("slurm" ,slurm)))
228 (propagated-inputs
229 `(("python-ipython" ,python-ipython)
230 ("python-pandas" ,python-pandas)))
231 (synopsis "Control the SLURM batch scheduler from Jupyter Notebook")
232 (description
233 "This package implements Jupyter/IPython
234 @uref{http://ipython.readthedocs.io/en/stable/interactive/magics.html, magic
235 commands} for interacting with the SLURM workload manager. SLURM magic simply
236 wraps command-line executables and the commands themselves should look like
237 their command-line counterparts. Commands are spawned via @code{subprocess}
238 and output captured in the notebook. Whatever arguments are accepted by a
239 SLURM command line executable are also accepted by the corresponding magic
240 command---e.g., @code{%salloc}, @code{%sbatch}, etc.")
241 (license license:bsd-3))))