Commit | Line | Data |
---|---|---|
e3aaefe7 | 1 | ;;; GNU Guix --- Functional package management for GNU |
da09cd16 | 2 | ;;; Copyright © 2013, 2014, 2020 Eric Bavier <bavier@posteo.net> |
ff03ef0b | 3 | ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org> |
a9164807 | 4 | ;;; Copyright © 2015, 2016, 2017, 2018, 2020 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> |
5490b2c7 | 10 | ;;; Copyright © 2018, 2019, 2020 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> |
a7dff955 | 13 | ;;; Copyright © 2020 Roel Janssen <roel@gnu.org> |
e3aaefe7 EB |
14 | ;;; |
15 | ;;; This file is part of GNU Guix. | |
16 | ;;; | |
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. | |
21 | ;;; | |
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. | |
26 | ;;; | |
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/>. | |
29 | ||
30 | (define-module (gnu packages parallel) | |
552f5c00 | 31 | #:use-module (guix download) |
0c212811 LC |
32 | #:use-module (guix git-download) |
33 | #:use-module (guix build-system gnu) | |
34 | #:use-module (guix build-system python) | |
552f5c00 | 35 | #:use-module ((guix licenses) #:prefix license:) |
bead6dcb | 36 | #:use-module ((guix utils) #:select (target-64bit?)) |
552f5c00 | 37 | #:use-module (guix packages) |
e3aaefe7 | 38 | #:use-module (gnu packages) |
552f5c00 PP |
39 | #:use-module (gnu packages admin) |
40 | #:use-module (gnu packages autotools) | |
524eee02 | 41 | #:use-module (gnu packages base) |
552f5c00 PP |
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) | |
312ec128 | 48 | #:use-module (gnu packages python-science) |
0c212811 | 49 | #:use-module (gnu packages python-xyz) |
552f5c00 PP |
50 | #:use-module (gnu packages readline) |
51 | #:use-module (gnu packages tcl) | |
52 | #:use-module (gnu packages tls) | |
53 | #:use-module (gnu packages web)) | |
e3aaefe7 EB |
54 | |
55 | (define-public parallel | |
56 | (package | |
57 | (name "parallel") | |
7e33054b | 58 | (version "20200822") |
e3aaefe7 EB |
59 | (source |
60 | (origin | |
61 | (method url-fetch) | |
62 | (uri (string-append "mirror://gnu/parallel/parallel-" | |
63 | version ".tar.bz2")) | |
64 | (sha256 | |
7e33054b | 65 | (base32 "02dy46g6f05p7s2qs8h6yg20p1zl3flxxf77n5jw74l3h1m24m4n")))) |
e3aaefe7 | 66 | (build-system gnu-build-system) |
47bc991f BW |
67 | (arguments |
68 | `(#:phases | |
69 | (modify-phases %standard-phases | |
70 | (add-after 'unpack 'patch-bin-sh | |
71 | (lambda _ | |
72 | (for-each | |
73 | (lambda (file) | |
74 | (substitute* file | |
2c36baa5 | 75 | ;; Patch hard coded '/bin/sh' in the line ending in: |
47bc991f BW |
76 | ;; $Global::shell = $ENV{'PARALLEL_SHELL'} || |
77 | ;; parent_shell($$) || $ENV{'SHELL'} || "/bin/sh"; | |
4e7950fd | 78 | (("/bin/sh\\\";\n$") (string-append (which "sh") "\";\n")))) |
fccab993 EF |
79 | (list "src/parallel" "src/sem")) |
80 | #t)) | |
4e7950fd CL |
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") | |
85 | `("PATH" ":" prefix | |
86 | ,(map (lambda (input) | |
87 | (string-append (assoc-ref inputs input) "/bin")) | |
88 | '("perl" | |
89 | "procps")))) | |
90 | #t))) | |
91 | (add-after 'wrap-program 'post-install-test | |
47bc991f | 92 | (lambda* (#:key outputs #:allow-other-keys) |
28b0b21e TGR |
93 | (invoke (string-append |
94 | (assoc-ref outputs "out") "/bin/parallel") | |
95 | "echo" | |
96 | ":::" "1" "2" "3")))))) | |
47bc991f | 97 | (inputs |
5ca5ab8b | 98 | `(("perl" ,perl) |
47bc991f | 99 | ("procps" ,procps))) |
fccab993 | 100 | (home-page "https://www.gnu.org/software/parallel/") |
e3aaefe7 EB |
101 | (synopsis "Build and execute command lines in parallel") |
102 | (description | |
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.") | |
552f5c00 PP |
106 | (license license:gpl3+))) |
107 | ||
108 | (define-public slurm | |
109 | (package | |
110 | (name "slurm") | |
7c96befa | 111 | (version "19.05.3-2") |
552f5c00 PP |
112 | (source (origin |
113 | (method url-fetch) | |
114 | (uri (string-append | |
ea1f073d LF |
115 | "https://download.schedmd.com/slurm/slurm-" |
116 | version ".tar.bz2")) | |
552f5c00 PP |
117 | (sha256 |
118 | (base32 | |
7c96befa | 119 | "0qj4blfymrd2ry2qmb58l3jbr4jwygc3adcfw7my27rippcijlyc")) |
552f5c00 PP |
120 | (modules '((guix build utils))) |
121 | (snippet | |
122 | '(begin | |
7c96befa LC |
123 | ;; According to |
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 | |
128 | ;; contribs/pmi/. | |
4ff22ec3 | 129 | (substitute* "configure.ac" |
7c96befa LC |
130 | (("^[[:space:]]+contribs/(.*)$" all directory) |
131 | (if (and (string-prefix? "pmi" directory) | |
132 | (not (string-prefix? "pmi2" directory))) | |
133 | all | |
134 | ""))) | |
135 | ||
136 | (rename-file "contribs/pmi" "tmp-pmi") | |
552f5c00 | 137 | (delete-file-recursively "contribs") |
7c96befa LC |
138 | (mkdir "contribs") |
139 | (rename-file "tmp-pmi" "contribs/pmi") | |
552f5c00 PP |
140 | #t)))) |
141 | ;; FIXME: More optional inputs could be added, | |
142 | ;; in particular mysql and gtk+. | |
143 | (inputs `(("expect" ,expect) | |
144 | ("freeipmi" ,freeipmi) | |
58a536bb | 145 | ("hwloc" ,hwloc-2 "lib") |
552f5c00 PP |
146 | ("json-c" ,json-c) |
147 | ("linux-pam" , linux-pam) | |
148 | ("munge" ,munge) | |
149 | ("numactl" ,numactl) | |
552f5c00 PP |
150 | ("perl" ,perl) |
151 | ("python" ,python-wrapper) | |
152 | ("readline" ,readline))) | |
153 | (native-inputs | |
154 | `(("autoconf" ,autoconf) | |
155 | ("pkg-config" ,pkg-config))) | |
156 | (build-system gnu-build-system) | |
157 | (arguments | |
158 | `(#:configure-flags | |
e31ece97 | 159 | (list "--enable-pam" "--sysconfdir=/etc/slurm" |
52cd164a | 160 | "--disable-static" |
552f5c00 PP |
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")) | |
bead6dcb LC |
164 | (string-append "--with-munge=" (assoc-ref %build-inputs "munge")) |
165 | ||
166 | ;; 32-bit support is marked as deprecated and needs to be | |
167 | ;; explicitly enabled. | |
168 | ,@(if (target-64bit?) '() '("--enable-deprecated"))) | |
552f5c00 PP |
169 | #:phases |
170 | (modify-phases %standard-phases | |
4ff22ec3 | 171 | (add-after 'unpack 'autoconf |
7c96befa LC |
172 | (lambda _ (invoke "autoconf"))) ;configure.ac was patched |
173 | (add-after 'install 'install-libpmi | |
174 | (lambda _ | |
175 | ;; Open MPI expects libpmi to be provided by Slurm so install it. | |
176 | (invoke "make" "install" "-C" "contribs/pmi")))))) | |
91257587 | 177 | (home-page "https://slurm.schedmd.com/") |
552f5c00 PP |
178 | (synopsis "Workload manager for cluster computing") |
179 | (description | |
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.") | |
70260b33 TGR |
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 | |
524eee02 RW |
192 | |
193 | (define-public slurm-drmaa | |
194 | (package | |
195 | (name "slurm-drmaa") | |
a7dff955 | 196 | (version "1.1.1") |
524eee02 RW |
197 | (source (origin |
198 | (method url-fetch) | |
a7dff955 RJ |
199 | (uri (string-append |
200 | "https://github.com/natefoo/slurm-drmaa/releases/download/" | |
201 | version "/slurm-drmaa-" version ".tar.gz")) | |
524eee02 RW |
202 | (sha256 |
203 | (base32 | |
a7dff955 | 204 | "19r4cm88pcpm3wli4cc61zq7354pg67cg866f3a430p15hm1knrn")))) |
524eee02 | 205 | (build-system gnu-build-system) |
a7dff955 | 206 | (arguments `(#:tests? #f)) ; The tests require "bats". |
524eee02 RW |
207 | (inputs |
208 | `(("slurm" ,slurm))) | |
209 | (native-inputs | |
210 | `(("which" ,which))) | |
a7dff955 | 211 | (home-page "https://github.com/natefoo/slurm-drmaa") |
524eee02 RW |
212 | (synopsis "Distributed resource management application API for SLURM") |
213 | (description | |
214 | "PSNC DRMAA for Simple Linux Utility for Resource Management (SLURM) is | |
215 | an implementation of Open Grid Forum DRMAA 1.0 (Distributed Resource | |
216 | Management Application API) specification for submission and control of jobs | |
217 | to SLURM. Using DRMAA, grid applications builders, portal developers and ISVs | |
218 | can use the same high-level API to link their software with different | |
219 | cluster/resource management systems.") | |
220 | (license license:gpl3+))) | |
0c212811 LC |
221 | |
222 | (define-public python-slurm-magic | |
223 | (let ((commit "73dd1a2b85799f7dae4b3f1cd9027536eff0c4d7") | |
224 | (revision "0")) | |
225 | (package | |
226 | (name "python-slurm-magic") | |
227 | (version (git-version "0.0" revision commit)) | |
228 | (home-page "https://github.com/NERSC/slurm-magic") | |
229 | (source (origin | |
230 | (method git-fetch) | |
231 | (uri (git-reference (url home-page) | |
232 | (commit commit))) | |
233 | (sha256 | |
234 | (base32 | |
235 | "19pp2vs0wm8mx0arz9n6lw9wgyv70w9wyi4y6b91qc5j3bz5igfs")) | |
236 | (file-name (git-file-name name version)))) | |
237 | (build-system python-build-system) | |
238 | (arguments | |
239 | '(#:phases (modify-phases %standard-phases | |
240 | (add-before 'build 'set-slurm-path | |
241 | (lambda* (#:key inputs #:allow-other-keys) | |
242 | ;; The '_execute' method tries to exec 'salloc' | |
243 | ;; etc. from $PATH. Record the absolute file name | |
244 | ;; instead. | |
245 | (let ((slurm (assoc-ref inputs "slurm"))) | |
246 | (substitute* "slurm_magic.py" | |
247 | (("name = (.*)$" _ value) | |
248 | (string-append "name = \"" | |
249 | slurm "/bin/\" + " | |
250 | value "\n"))) | |
251 | #t)))))) | |
252 | (inputs | |
253 | `(("slurm" ,slurm))) | |
254 | (propagated-inputs | |
255 | `(("python-ipython" ,python-ipython) | |
256 | ("python-pandas" ,python-pandas))) | |
257 | (synopsis "Control the SLURM batch scheduler from Jupyter Notebook") | |
258 | (description | |
259 | "This package implements Jupyter/IPython | |
260 | @uref{http://ipython.readthedocs.io/en/stable/interactive/magics.html, magic | |
261 | commands} for interacting with the SLURM workload manager. SLURM magic simply | |
262 | wraps command-line executables and the commands themselves should look like | |
263 | their command-line counterparts. Commands are spawned via @code{subprocess} | |
264 | and output captured in the notebook. Whatever arguments are accepted by a | |
265 | SLURM command line executable are also accepted by the corresponding magic | |
266 | command---e.g., @code{%salloc}, @code{%sbatch}, etc.") | |
267 | (license license:bsd-3)))) |