gnu: zn_poly: Rename to zn-poly, according to our naming conventions.
[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
PP
34 #:use-module ((guix licenses) #:prefix license:)
35 #:use-module (guix packages)
e3aaefe7 36 #:use-module (gnu packages)
552f5c00
PP
37 #:use-module (gnu packages admin)
38 #:use-module (gnu packages autotools)
524eee02 39 #:use-module (gnu packages base)
552f5c00
PP
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)
0c212811 46 #:use-module (gnu packages python-xyz)
552f5c00
PP
47 #:use-module (gnu packages readline)
48 #:use-module (gnu packages tcl)
49 #:use-module (gnu packages tls)
50 #:use-module (gnu packages web))
e3aaefe7
EB
51
52(define-public parallel
53 (package
54 (name "parallel")
e26d628b 55 (version "20190522")
e3aaefe7
EB
56 (source
57 (origin
58 (method url-fetch)
59 (uri (string-append "mirror://gnu/parallel/parallel-"
60 version ".tar.bz2"))
61 (sha256
e26d628b 62 (base32 "0y3z9wybs3gak3zwgsby8r5gg6dwd3qlrkch0q4fn0i1j1jhmijv"))))
e3aaefe7 63 (build-system gnu-build-system)
47bc991f
BW
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
2c36baa5 72 ;; Patch hard coded '/bin/sh' in the line ending in:
47bc991f
BW
73 ;; $Global::shell = $ENV{'PARALLEL_SHELL'} ||
74 ;; parent_shell($$) || $ENV{'SHELL'} || "/bin/sh";
4e7950fd 75 (("/bin/sh\\\";\n$") (string-append (which "sh") "\";\n"))))
fccab993
EF
76 (list "src/parallel" "src/sem"))
77 #t))
4e7950fd
CL
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
47bc991f 89 (lambda* (#:key outputs #:allow-other-keys)
28b0b21e
TGR
90 (invoke (string-append
91 (assoc-ref outputs "out") "/bin/parallel")
92 "echo"
93 ":::" "1" "2" "3"))))))
47bc991f 94 (inputs
5ca5ab8b 95 `(("perl" ,perl)
47bc991f 96 ("procps" ,procps)))
fccab993 97 (home-page "https://www.gnu.org/software/parallel/")
e3aaefe7
EB
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
101or more computers. Jobs can consist of single commands or of scripts
102and they are executed on lists of files, hosts, users or other items.")
552f5c00
PP
103 (license license:gpl3+)))
104
105(define-public slurm
106 (package
107 (name "slurm")
6e076b3d 108 (version "17.11.3")
552f5c00
PP
109 (source (origin
110 (method url-fetch)
111 (uri (string-append
ea1f073d
LF
112 "https://download.schedmd.com/slurm/slurm-"
113 version ".tar.bz2"))
552f5c00
PP
114 (sha256
115 (base32
6e076b3d 116 "1x3i6z03d9m46fvj1cslrapm1drvgyqch9pn4xf23kvbz4gkhaps"))
552f5c00
PP
117 (modules '((guix build utils)))
118 (snippet
119 '(begin
4ff22ec3
TGR
120 (substitute* "configure.ac"
121 (("^[[:space:]]+contribs/.*$") ""))
552f5c00
PP
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)
798b7678 128 ("hwloc" ,hwloc "lib")
552f5c00
PP
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
e31ece97 143 (list "--enable-pam" "--sysconfdir=/etc/slurm"
552f5c00
PP
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
4ff22ec3
TGR
151 (add-after 'unpack 'autoconf
152 (lambda _ (invoke "autoconf")))))) ; configure.ac was patched
91257587 153 (home-page "https://slurm.schedmd.com/")
552f5c00
PP
154 (synopsis "Workload manager for cluster computing")
155 (description
156 "SLURM is a fault-tolerant and highly scalable cluster management and job
157scheduling system for large and small clusters. It allocates access to
158resources (computer nodes) to users for some duration of time, provides a
159framework for starting, executing, and monitoring work (typically a parallel
160job) on a set of allocated nodes, and arbitrates contention for resources
161by managing a queue of pending work.")
70260b33
TGR
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
524eee02
RW
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
189an implementation of Open Grid Forum DRMAA 1.0 (Distributed Resource
190Management Application API) specification for submission and control of jobs
191to SLURM. Using DRMAA, grid applications builders, portal developers and ISVs
192can use the same high-level API to link their software with different
193cluster/resource management systems.")
194 (license license:gpl3+)))
0c212811
LC
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
235commands} for interacting with the SLURM workload manager. SLURM magic simply
236wraps command-line executables and the commands themselves should look like
237their command-line counterparts. Commands are spawned via @code{subprocess}
238and output captured in the notebook. Whatever arguments are accepted by a
239SLURM command line executable are also accepted by the corresponding magic
240command---e.g., @code{%salloc}, @code{%sbatch}, etc.")
241 (license license:bsd-3))))