projects/guix·blob bootstrap-team · refs

883 lines · 36.2 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013, 2014, 2020 Eric Bavier <[email protected]>
3;;; Copyright © 2015 Mark H Weaver <[email protected]>
4;;; Copyright © 2015-2025 Efraim Flashner <[email protected]>
5;;; Copyright © 2016 Pjotr Prins <[email protected]>
6;;; Copyright © 2016 Andreas Enge <[email protected]>
7;;; Copyright © 2016, 2020, 2021, 2022, 2023, 2025 Ricardo Wurmus <[email protected]>
8;;; Copyright © 2016 Ben Woodcroft <[email protected]>
9;;; Copyright © 2017, 2018 Rutger Helling <[email protected]>
10;;; Copyright © 2018–2022 Tobias Geerinckx-Rice <[email protected]>
11;;; Copyright © 2018 Clément Lassieur <[email protected]>
12;;; Copyright © 2019-2026 Ludovic Courtès <[email protected]>
13;;; Copyright © 2019 Mădălin Ionel Patrașcu <[email protected]>
14;;; Copyright © 2020 Roel Janssen <[email protected]>
15;;; Copyright © 2021, 2024 Maxim Cournoyer <[email protected]>
16;;; Copyright © 2021 Stefan Reichör <[email protected]>
17;;; Copyright © 2024 Zheng Junjie <[email protected]>
18;;; Copyright © 2024, 2025 David Elsing <[email protected]>
19;;; Copyright © 2024 Romain Garbage <[email protected]>
20;;; Copyright © 2024 Arun Isaac <[email protected]>
21;;; Copyright © 2025 Sharlatan Hellseher <[email protected]>
22;;;
23;;; This file is part of GNU Guix.
24;;;
25;;; GNU Guix is free software; you can redistribute it and/or modify it
26;;; under the terms of the GNU General Public License as published by
27;;; the Free Software Foundation; either version 3 of the License, or (at
28;;; your option) any later version.
29;;;
30;;; GNU Guix is distributed in the hope that it will be useful, but
31;;; WITHOUT ANY WARRANTY; without even the implied warranty of
32;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
33;;; GNU General Public License for more details.
34;;;
35;;; You should have received a copy of the GNU General Public License
36;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
37
38(define-module (gnu packages parallel)
39 #:use-module (guix download)
40 #:use-module (guix git-download)
41 #:use-module (guix build-system cmake)
42 #:use-module (guix build-system gnu)
43 #:use-module (guix build-system python)
44 #:use-module (guix build-system pyproject)
45 #:use-module ((guix licenses) #:prefix license:)
46 #:use-module ((guix utils) #:select (target-64bit?))
47 #:use-module (guix packages)
48 #:use-module (guix utils)
49 #:use-module (guix gexp)
50 #:use-module (gnu packages)
51 #:use-module (gnu packages admin)
52 #:use-module (gnu packages autotools)
53 #:use-module (gnu packages base)
54 #:use-module (gnu packages bash)
55 #:use-module (gnu packages check)
56 #:use-module (gnu packages compression)
57 #:use-module (gnu packages databases)
58 #:use-module (gnu packages documentation)
59 #:use-module (gnu packages flex)
60 #:use-module (gnu packages freeipmi)
61 #:use-module (gnu packages gcc)
62 #:use-module (gnu packages glib)
63 #:use-module (gnu packages libevent)
64 #:use-module (gnu packages linux)
65 #:use-module (gnu packages maths)
66 #:use-module (gnu packages mpi)
67 #:use-module (gnu packages networking)
68 #:use-module (gnu packages perl)
69 #:use-module (gnu packages pkg-config)
70 #:use-module (gnu packages python)
71 #:use-module (gnu packages python-build)
72 #:use-module (gnu packages python-science)
73 #:use-module (gnu packages python-xyz)
74 #:use-module (gnu packages readline)
75 #:use-module (gnu packages serialization)
76 #:use-module (gnu packages texinfo)
77 #:use-module (gnu packages tcl)
78 #:use-module (gnu packages tls)
79 #:use-module (gnu packages web))
80
81(define-public parallel
82 (package
83 (name "parallel")
84 (version "20251222")
85 (outputs '("out" "doc"))
86 (source
87 (origin
88 (method url-fetch)
89 (uri (string-append "mirror://gnu/parallel/parallel-"
90 version ".tar.bz2"))
91 (sha256
92 (base32 "0xf2j9jmjba7scjdlnk6n9p53ycakzkfkikhdzzssb0gva456sxm"))
93 (snippet
94 '(begin
95 (use-modules (guix build utils))
96 ;; Delete pre-generated manpages and documents.
97 ;; TODO: generate rst files.
98 ;; parallel_cheat_bw.pdf uses libreoffice to be generated.
99 (rename-file "src/parallel_cheat_bw.pdf"
100 "src/parallel_cheat_bw.pdf-keep")
101 (for-each delete-file (find-files "src" "\\.(1|7|html|pdf)$"))
102 (rename-file "src/parallel_cheat_bw.pdf-keep"
103 "src/parallel_cheat_bw.pdf")))))
104 (build-system gnu-build-system)
105 (arguments
106 (list
107 #:configure-flags
108 #~(list (string-append "--docdir=" #$output:doc "/share/doc/parallel"))
109 #:phases
110 #~(modify-phases %standard-phases
111 (add-after 'unpack 'patch-bin-sh
112 (lambda _
113 (for-each
114 (lambda (file)
115 (substitute* file
116 ;; Patch hard coded '/bin/sh' in the line ending in:
117 ;; $Global::shell = $ENV{'PARALLEL_SHELL'} ||
118 ;; parent_shell($$) || $ENV{'SHELL'} || "/bin/sh";
119 (("/bin/sh\\\";\n$") (string-append (which "sh") "\";\n"))))
120 (list "src/parallel" "src/sem"))))
121 (add-before 'install 'add-install-to-path
122 (lambda _
123 (setenv "PATH"
124 (string-append (getenv "PATH") ":" #$output "/bin"))))
125 (add-after 'install 'wrap-program
126 (lambda* (#:key inputs #:allow-other-keys)
127 (wrap-program (string-append #$output "/bin/parallel")
128 `("PATH" ":" prefix
129 ,(map (lambda (input)
130 (string-append (assoc-ref inputs input) "/bin"))
131 '("perl" "procps"))))))
132 (add-after 'wrap-program 'post-install-test
133 (lambda* (#:key tests? #:allow-other-keys)
134 (when tests?
135 (invoke (string-append #$output "/bin/parallel")
136 "echo"
137 ":::" "1" "2" "3"))))
138 (add-after 'post-install-test 'replace-texi-files
139 (lambda _
140 ;; Build info files.
141 (for-each
142 (lambda (file)
143 (let ((info-file
144 (string-append (car (string-split file #\.)) ".info")))
145 (invoke "makeinfo" "--no-split" "-o" info-file file)
146 (install-file info-file
147 (string-append #$output:doc "/share/info"))))
148 (find-files "src" "\\.texi$"))
149 ;; Remove texi files.
150 (for-each
151 delete-file
152 (find-files (string-append #$output:doc "/share/doc/parallel")
153 "\\.texi$")))))))
154 (native-inputs
155 (list perl pod2pdf texinfo))
156 (inputs
157 (list bash-minimal perl procps))
158 (home-page "https://www.gnu.org/software/parallel/")
159 (synopsis "Build and execute command lines in parallel")
160 (description
161 "GNU Parallel is a tool for executing shell jobs in parallel using one
162or more computers. Jobs can consist of single commands or of scripts
163and they are executed on lists of files, hosts, users or other items.")
164 (license license:gpl3+)))
165
166(define-public xe
167 (package
168 (name "xe")
169 (version "1.0")
170 (source
171 (origin
172 (method git-fetch)
173 (uri (git-reference
174 (url "https://github.com/leahneukirchen/xe")
175 (commit (string-append "v" version))))
176 (file-name (git-file-name name version))
177 (sha256
178 (base32 "1ijvf7q5pxk4rlj7p9q6fmpdqiwmc28gffkk6yg390k1a1z3msf9"))))
179 (build-system gnu-build-system)
180 (arguments
181 (list #:tests? #f
182 #:make-flags #~(list (string-append "CC=" #$(cc-for-target))
183 (string-append "PREFIX=" #$output))
184 #:phases #~(modify-phases %standard-phases
185 (delete 'configure))))
186 (synopsis "Execute a command for every argument")
187 (description
188 "The xe utility constructs command lines from specified arguments,
189combining some of the best features of xargs(1) and apply(1). Parallel
190execution is also possible.")
191 (home-page "https://github.com/leahneukirchen/xe")
192 (license license:public-domain)))
193
194(define-public xjobs
195 (package
196 (name "xjobs")
197 (version "20250529")
198 (source (origin
199 (method url-fetch)
200 (uri (string-append
201 "http://www.maier-komor.de/xjobs/xjobs-"
202 version ".tgz"))
203 (sha256
204 (base32
205 "13hkaipl3cgr9cvama34b442n35ckr42p1f24kygkrad3ymy87hx"))))
206 (build-system gnu-build-system)
207 (arguments `(#:tests? #f)) ;; No tests
208 (native-inputs
209 (list flex))
210 (home-page "https://www.maier-komor.de/xjobs.html")
211 (properties `((release-monitoring-url . ,home-page)))
212 (synopsis
213 "Parallel execution of jobs with several useful options")
214 (description
215 "xjobs reads job descriptions line by line and executes them in
216parallel. It limits the number of parallel executing jobs and starts new jobs
217when jobs finish.")
218 (license license:gpl2+)))
219
220(define-public slurm-minimal
221 (package
222 (name "slurm-minimal")
223 (version "23.11.10")
224 (source (origin
225 (method url-fetch)
226 (uri (string-append
227 "https://download.schedmd.com/slurm/slurm-"
228 version ".tar.bz2"))
229 (sha256
230 (base32
231 "0gf7x85bzpkrx87mb16wyiyvkjxqq01sbajsjxwrspyi2v675hgr"))
232 (modules '((guix build utils)))
233 (snippet
234 '(begin
235 ;; According to
236 ;; <https://lists.gnu.org/archive/html/guix-devel/2016-02/msg00534.html>
237 ;; there are non-free bits under contribs/, though it's not
238 ;; clear which ones. libpmi is clearly free (it used to be
239 ;; under src/api/) and so is pmi2 (lax non-copyleft
240 ;; license), so remove all of contribs/ except pmi and pmi2.
241 (substitute* "configure.ac"
242 (("^[[:space:]]+contribs/(.*)$" all directory)
243 (if (string-prefix? "pmi" directory)
244 all
245 "")))
246
247 (rename-file "contribs/pmi" "tmp-pmi")
248 (rename-file "contribs/pmi2" "tmp-pmi2")
249 (delete-file-recursively "contribs")
250 (mkdir "contribs")
251 (rename-file "tmp-pmi" "contribs/pmi")
252 (rename-file "tmp-pmi2" "contribs/pmi2")))))
253 (inputs
254 (append
255 (list freeipmi
256 `(,hwloc-2 "lib")
257 json-c
258 linux-pam)
259 (if (supported-package? openpmix-4)
260 (list openpmix-4)
261 '())
262 (list munge
263 numactl
264 readline)))
265 (native-inputs
266 (list autoconf expect perl pkg-config python-wrapper))
267 (build-system gnu-build-system)
268 (arguments
269 (list #:configure-flags
270 #~(list "--enable-pam" "--sysconfdir=/etc/slurm"
271 "--disable-static"
272 (string-append "--with-freeipmi=" #$(this-package-input "freeipmi"))
273 (string-append "--with-hwloc="
274 (ungexp (this-package-input "hwloc") "lib"))
275 (string-append "--with-json=" #$(this-package-input "json-c"))
276 (string-append "--with-munge=" #$(this-package-input "munge"))
277
278 ;; Use PMIx bundled with Open MPI (this is required for Open MPI 5.x).
279 ;; Note: Older versions that inherit from this package lack the
280 ;; 'openpmix' dependency.
281 #$(let ((openmpix (this-package-input "openpmix")))
282 (if openmpix
283 #~(string-append "--with-pmix=" #$openmpix)
284 "--without-pmix"))
285
286 ;; 32-bit support is marked as deprecated and needs to be
287 ;; explicitly enabled.
288 #$@(if (target-64bit?) '() '("--enable-deprecated")))
289 #:phases
290 #~(modify-phases %standard-phases
291 (add-after 'unpack 'patch-plugin-linker-flags
292 (lambda _
293 (substitute* (find-files "src/plugins/" "Makefile.in")
294 (("_la_LDFLAGS = ")
295 "_la_LDFLAGS = ../../../api/libslurm.la "))))
296 (add-after 'patch-plugin-linker-flags 'autoconf
297 (lambda _ (invoke "autoconf"))) ;configure.ac was patched
298 (add-after 'install 'install-libpmi
299 (lambda _
300 ;; Open MPI expects libpmi to be provided by Slurm so install it.
301 (invoke "make" "install" "-C" "contribs/pmi")
302
303 ;; Others expect pmi2.
304 (invoke "make" "install" "-C" "contribs/pmi2"))))))
305 (home-page "https://slurm.schedmd.com/")
306 (synopsis "Workload manager for cluster computing")
307 (description
308 "SLURM is a fault-tolerant and highly scalable cluster management and job
309scheduling system for large and small clusters. It allocates access to
310resources (computer nodes) to users for some duration of time, provides a
311framework for starting, executing, and monitoring work (typically a parallel
312job) on a set of allocated nodes, and arbitrates contention for resources
313by managing a queue of pending work.")
314 (license (list license:bsd-2 ; src/common/log.[ch], src/common/uthash
315 license:expat ; slurm/pmi.h
316 license:isc ; src/common/strlcpy.c
317 license:lgpl2.1+ ; hilbert.[ch], src/common/slurm_time.h
318 license:zlib ; src/common/strnatcmp.c
319 (license:non-copyleft ;contribs/pmi2, Argonne Natl. Lab.
320 "https://github.com/SchedMD/slurm/blob/master/contribs/pmi2/COPYRIGHT")
321 license:gpl2+)))) ; the rest, often with OpenSSL exception
322
323(define (make-slurm base-slurm)
324 "Make a slurm package with all optional features enabled. Base it off of the
325minimal slurm package BASE-SLURM."
326 (package
327 (inherit base-slurm)
328 (name "slurm")
329 (arguments
330 (substitute-keyword-arguments (package-arguments base-slurm)
331 ((#:configure-flags flags #~'())
332 #~(cons* "--enable-slurmrestd"
333 (string-append "--with-bpf="
334 (dirname
335 (dirname (search-input-directory
336 %build-inputs "include/linux"))))
337 (string-append "--with-http-parser="
338 #$(this-package-input "http-parser"))
339 (string-append "--with-rdkafka="
340 #$(this-package-input "librdkafka"))
341 (string-append "--with-yaml="
342 #$(this-package-input "libyaml"))
343 #$flags))))
344 ;; FIXME: More optional inputs could be added.
345 (inputs
346 (modify-inputs (package-inputs base-slurm)
347 ;; Add dependencies required by the slurm REST API.
348 (prepend dbus freeipmi http-parser
349 libjwt librdkafka libyaml (list mariadb "dev"))))))
350
351(define-public slurm (make-slurm slurm-minimal))
352
353;; The SLURM client/daemon protocol and file format changes from time to time
354;; in incompatible ways, as noted in
355;; <https://slurm.schedmd.com/troubleshoot.html#network>. Thus, keep older
356;; releases here. See also <https://issues.guix.gnu.org/44387>.
357;; As noted in the link, YY.MM is the release scheme, and the 'maintenance'
358;; digit does not introduce incompatibilities.
359
360(define-public slurm-minimal-25.05
361 (package
362 (inherit slurm-minimal)
363 (version "25.05.4")
364 (source (origin
365 (inherit (package-source slurm))
366 (method url-fetch)
367 (uri (string-append
368 "https://download.schedmd.com/slurm/slurm-"
369 version ".tar.bz2"))
370 (sha256
371 (base32
372 "130pjygqk794dchknjqdsinciv2b7c7r5agqsgca7m804xp09wnl"))))
373 (inputs (modify-inputs (package-inputs slurm-minimal)
374 (replace "openpmix" openpmix))))) ;use version 6.0.0
375
376(define-public slurm-25.05 (make-slurm slurm-minimal-25.05))
377
378(define-public slurm-minimal-24.05
379 (package
380 (inherit slurm-minimal)
381 (version "24.05.5")
382 (source (origin
383 (inherit (package-source slurm))
384 (method url-fetch)
385 (uri (string-append
386 "https://download.schedmd.com/slurm/slurm-"
387 version ".tar.bz2"))
388 (sha256
389 (base32
390 "0vxiymp40lgcb1z76cyqdpqpy7w14r483v54dk4aq84v0aw0mixl"))))))
391
392(define-public slurm-24.05 (make-slurm slurm-minimal-24.05))
393
394(define-public slurm-minimal-23.11
395 (package
396 (inherit slurm-minimal)
397 (version "23.11.11")
398 (source (origin
399 (inherit (package-source slurm))
400 (method url-fetch)
401 (uri (string-append
402 "https://download.schedmd.com/slurm/slurm-"
403 version ".tar.bz2"))
404 (patches
405 (search-patches "slurm-23-salloc-fallback-shell.patch"))
406 (sha256
407 (base32
408 "0pg4liysbppfgynwsj3i1lzr60rnybnvzja37x6xgyjvxgf165sa"))))))
409
410(define-public slurm-23.11 (make-slurm slurm-minimal-23.11))
411
412(define-public slurm-minimal-22.05
413 (package
414 (inherit slurm-minimal-23.11)
415 (version "22.05.1")
416 (source (origin
417 (inherit (package-source slurm-minimal-23.11))
418 (method url-fetch)
419 (uri (string-append
420 "https://download.schedmd.com/slurm/slurm-"
421 version ".tar.bz2"))
422 (patches '()) ;drop 'salloc' patch
423 (sha256
424 (base32
425 "0f3hhlki8g7slllsnyj1qikbsvr62i0hig85lcdcfnmsagzlhbyi"))))))
426
427(define-public slurm-22.05 (make-slurm slurm-minimal-22.05))
428
429(define-public slurm-drmaa
430 (package
431 (name "slurm-drmaa")
432 (version "1.1.5")
433 (source (origin
434 (method url-fetch)
435 (uri (string-append
436 "https://github.com/natefoo/slurm-drmaa/releases/download/"
437 version "/slurm-drmaa-" version ".tar.gz"))
438 (sha256
439 (base32
440 "1vydd44wp1xns7dd6zh7yin7i5p0ia3x2bk7ql56wfzhi22yf9sd"))
441 (patches (search-patches "slurm-drmaa-25.patch"))
442 (modules '((guix build utils)))
443 (snippet
444 ;; This is a typo fixed in upstream commit
445 ;; d4a43450a42b25c491217ed8b8e0af79a538c6e3
446 '(substitute* "slurm_drmaa/util.h"
447 (("slurmdrmaa__init") "slurmdrmaa_init")))))
448 (build-system gnu-build-system)
449 (arguments `(#:tests? #f)) ; The tests require "bats".
450 (inputs
451 (list slurm))
452 (native-inputs
453 (list which))
454 (home-page "https://github.com/natefoo/slurm-drmaa")
455 (synopsis "Distributed resource management application API for SLURM")
456 (description
457 "PSNC DRMAA for Simple Linux Utility for Resource Management (SLURM) is
458an implementation of Open Grid Forum DRMAA 1.0 (Distributed Resource
459Management Application API) specification for submission and control of jobs
460to SLURM. Using DRMAA, grid applications builders, portal developers and ISVs
461can use the same high-level API to link their software with different
462cluster/resource management systems.")
463 (license license:gpl3+)))
464
465(define-public python-pathos
466 (package
467 (name "python-pathos")
468 (version "0.3.4")
469 (source
470 (origin
471 (method url-fetch)
472 (uri (pypi-uri "pathos" version))
473 (sha256
474 (base32 "0m077iw5fml4r7csgi4j7ngvdmg1y9jxly64gi56argq1qnr3m5s"))))
475 (build-system pyproject-build-system)
476 (arguments
477 (list
478 #:phases
479 #~(modify-phases %standard-phases
480 (replace 'check
481 ;; XXX: Tests freeze when invoked with Pytest directly, this step
482 ;; is taken from project's tox.ini.
483 (lambda* (#:key tests? inputs outputs #:allow-other-keys)
484 (when tests?
485 (invoke "python" "./pathos/tests/__main__.py")))))))
486 (native-inputs
487 (list python-setuptools))
488 (propagated-inputs
489 (list python-dill
490 python-multiprocess
491 python-pox
492 python-ppft))
493 (home-page "https://pypi.org/project/pathos/")
494 (synopsis
495 "Parallel graph management and execution in heterogeneous computing")
496 (description
497 "Python-pathos is a framework for heterogeneous computing. It provides a
498consistent high-level interface for configuring and launching parallel
499computations across heterogeneous resources. Python-pathos provides
500configurable launchers for parallel and distributed computing, where each
501launcher contains the syntactic logic to configure and launch jobs in an
502execution environment.")
503 (license license:bsd-3)))
504
505(define-public python-ppft
506 (package
507 (name "python-ppft")
508 (version "1.7.7")
509 (source
510 (origin
511 (method url-fetch)
512 (uri (pypi-uri "ppft" version))
513 (sha256
514 (base32
515 "15hvw39m2r3chm8zbqgkld0m1cl049rxidln4a6jnk72rx479xzk"))))
516 (build-system pyproject-build-system)
517 (arguments
518 (list
519 #:phases
520 #~(modify-phases %standard-phases
521 (replace 'check
522 (lambda* (#:key tests? inputs outputs #:allow-other-keys)
523 (when tests?
524 (invoke "python" "./ppft/tests/__main__.py")))))))
525 (native-inputs
526 (list python-setuptools))
527 (home-page "https://pypi.org/project/ppft/")
528 (synopsis "Fork of Parallel Python")
529 (description
530 "This package is a fork of Parallel Python. The Parallel Python
531module (@code{pp}) provides an easy and efficient way to create
532parallel-enabled applications for @dfn{symmetric multiprocessing} (SMP)
533computers and clusters. It features cross-platform portability and dynamic
534load balancing.")
535 (license license:bsd-3)))
536
537(define-public python-schwimmbad
538 (package
539 (name "python-schwimmbad")
540 (version "0.4.2")
541 (source
542 (origin
543 (method url-fetch)
544 (uri (pypi-uri "schwimmbad" version))
545 (sha256
546 (base32 "1aac1rswb0r0vzbxvjj2jyx5j0vqyjj7mygc71n9zbkpmr8m1rpg"))))
547 (build-system pyproject-build-system)
548 (propagated-inputs
549 (list python-dill
550 python-joblib
551 python-mpi4py
552 python-multiprocess))
553 (native-inputs
554 (list python-hatch-vcs python-hatchling python-pytest))
555 (home-page "https://github.com/adrn/schwimmbad")
556 (synopsis "Common interface for parallel processing pools")
557 (description
558 "@code{schwimmbad} provides a uniform interface to parallel processing
559pools and enables switching easily between local development (e.g., serial
560processing or with @code{multiprocessing}) and deployment on a cluster or
561supercomputer (via, e.g., MPI or JobLib).")
562 (license license:expat)))
563
564(define-public python-slurm-magic
565 (let ((commit "4c708cc137cb9f4bd5b44cf26837b466d9bf7b65")
566 (revision "0"))
567 (package
568 (name "python-slurm-magic")
569 (version (git-version "0.0.0" revision commit))
570 (home-page "https://github.com/NERSC/slurm-magic")
571 (source
572 (origin
573 (method git-fetch)
574 (uri (git-reference
575 (url home-page)
576 (commit commit)))
577 (sha256
578 (base32 "0s69bmiskc6i9x98z6nf9jyi0jc51jpr5599f9b2f2jznz5wr64v"))
579 (file-name (git-file-name name version))))
580 (build-system pyproject-build-system)
581 (arguments
582 (list
583 #:tests? #f ; No tests.
584 #:phases
585 #~(modify-phases %standard-phases
586 (add-before 'build 'set-slurm-path
587 (lambda* (#:key inputs #:allow-other-keys)
588 ;; The '_execute' method tries to exec 'salloc'
589 ;; etc. from $PATH. Record the absolute file name
590 ;; instead.
591 (let ((slurm-bin (dirname
592 (search-input-file inputs "/bin/sinfo"))))
593 (substitute* "slurm_magic.py"
594 (("name = (.*)$" _ value)
595 (string-append "name = \"" slurm-bin "/\" + "
596 value "\n")))))))))
597 (native-inputs (list python-setuptools))
598 (inputs (list slurm))
599 (propagated-inputs (list python-ipython python-pandas))
600 (synopsis "Control the SLURM batch scheduler from Jupyter Notebook")
601 (description
602 "This package implements Jupyter/IPython
603@uref{http://ipython.readthedocs.io/en/stable/interactive/magics.html, magic
604commands} for interacting with the SLURM workload manager. SLURM magic simply
605wraps command-line executables and the commands themselves should look like
606their command-line counterparts. Commands are spawned via @code{subprocess}
607and output captured in the notebook. Whatever arguments are accepted by a
608SLURM command line executable are also accepted by the corresponding magic
609command---e.g., @code{%salloc}, @code{%sbatch}, etc.")
610 (license license:bsd-3))))
611
612(define-public pthreadpool
613 ;; This repository has only one tag, 0.1, which is older than what users
614 ;; such as XNNPACK expect.
615 (let ((commit "560c60d342a76076f0557a3946924c6478470044")
616 (version "0.1")
617 (revision "3"))
618 (package
619 (name "pthreadpool")
620 (version (git-version version revision commit))
621 (home-page "https://github.com/Maratyszcza/pthreadpool")
622 (source (origin
623 (method git-fetch)
624 (uri (git-reference (url home-page) (commit commit)))
625 (file-name (git-file-name name version))
626 (sha256
627 (base32
628 "0l82ix1h8pmjikf15bvmlap355gmyfjpahmgz4lbd6g40ab3ls5c"))
629 (patches (search-patches "pthreadpool-system-libraries.patch"))))
630 (build-system cmake-build-system)
631 (arguments '(#:configure-flags '("-DBUILD_SHARED_LIBS=ON")))
632 (inputs
633 (list googletest-1.12 googlebenchmark fxdiv))
634 (synopsis "Efficient thread pool implementation")
635 (description
636 "The pthreadpool library implements an efficient and portable thread
637pool, similar to those implemented by OpenMP run-time support libraries for
638constructs such as @code{#pragma omp parallel for}, with additional
639features.")
640 (license license:bsd-2))))
641
642(define-public cpuinfo
643 ;; There's currently no tag on this repo.
644 (let ((revision "7")
645 (commit "c4b4f4bf08c0cf486fc3111d0244ebf2a48ad01b"))
646 (package
647 (name "cpuinfo")
648 (version (git-version "0.0" revision commit))
649 (home-page "https://github.com/pytorch/cpuinfo")
650 (source (origin
651 (method git-fetch)
652 (uri (git-reference (url home-page) (commit commit)))
653 (file-name (git-file-name name version))
654 (sha256
655 (base32
656 "1gjigxszhjj3422nq50kgffq1iirgl7ik9wf50m2lz64qwb5dkz5"))))
657 (build-system cmake-build-system)
658 (arguments
659 (list
660 ;; cpuinfo does not work in the build container for aarch64:
661 ;; https://github.com/pytorch/cpuinfo/issues/143
662 #:tests? (not (or (target-aarch64?)
663 (target-riscv64?)))
664 #:configure-flags
665 #~(list "-DBUILD_SHARED_LIBS=ON"
666 "-DUSE_SYSTEM_LIBS=ON")))
667 (inputs
668 (list googletest googlebenchmark))
669 (native-inputs
670 (list python-wrapper))
671 (synopsis "C/C++ library to obtain information about the CPU")
672 (description
673 "The cpuinfo library provides a C/C++ and a command-line interface to
674obtain information about the CPU being used: supported instruction set,
675processor name, cache information, and topology information.")
676 (license license:bsd-2))))
677
678(define-public clog
679 (package
680 (inherit cpuinfo) ;distributed with cpuinfo but not built by it
681 (name "clog")
682 (source (origin
683 (inherit (package-source cpuinfo))
684 (patches (search-patches "clog-fix-shared-build.patch"))))
685 (arguments
686 (list
687 #:configure-flags
688 ''("-DBUILD_SHARED_LIBS=ON"
689 "-DUSE_SYSTEM_LIBS=ON")
690 #:phases #~(modify-phases %standard-phases
691 (add-after 'unpack 'chdir
692 (lambda _
693 (chdir "deps/clog"))))))
694 (native-inputs (list googletest-1.8))
695 (inputs '())
696 (synopsis "C-style logging library based on printf")
697 (description
698 "This package provides a C-style library for logging errors,
699warnings, information notes, and debug information. Its features are:
700@itemize
701@item printf-style interface for formatting variadic parameters.
702@item Separate functions for logging errors, warnings, information notes, and
703debug information.
704@item Independent logging settings for different modules.
705@item Logging to logcat on Android and stderr/stdout on other platforms.
706@item Compatible with C99 and C++.
707@item Covered with unit tests.
708@end itemize")))
709
710(define-public psimd
711 ;; There is currently no tag in this repo.
712 (let ((commit "072586a71b55b7f8c584153d223e95687148a900")
713 (version "0.0")
714 (revision "1"))
715 (package
716 (name "psimd")
717 (version (git-version version revision commit))
718 (home-page "https://github.com/Maratyszcza/Psimd")
719 (source (origin
720 (method git-fetch)
721 (uri (git-reference (url home-page) (commit commit)))
722 (file-name (git-file-name name version))
723 (sha256
724 (base32
725 "16mslhvqs0gpqbg7kkq566a8gkn58cgjpqca8ljj9qcv5mk9apwm"))))
726 (build-system cmake-build-system)
727 (arguments '(#:tests? #f)) ;there are no tests
728 (synopsis "Portable 128-bit SIMD intrinsics")
729 (description
730 "This header-only C++ library provides a portable interface to
731single-instruction multiple-data (SIMD) intrinsics.")
732 (license license:expat))))
733
734(define-public openpmix
735 (package
736 (name "openpmix")
737 (version "6.0.0")
738 (source (origin
739 (method url-fetch)
740 (uri (string-append
741 "https://github.com/openpmix/openpmix/releases/download/v"
742 version "/pmix-" version ".tar.bz2"))
743 (sha256
744 (base32
745 "062k2agr311j06pavmrim1savmcv4f3c5jir4w1jxs0cdnb6ksdz"))
746 (modules '((guix build utils)))
747 (snippet
748 ;; Remove ~5 MiB of pre-built HTML doc.
749 #~(delete-file-recursively "docs/_build/html"))))
750 (build-system gnu-build-system)
751 (arguments
752 (list
753 #:configure-flags
754 #~(list "--enable-python-bindings") ;disabled by default
755
756 ;; Don't keep a reference to GCC.
757 #:disallowed-references (and (not (%current-target-system))
758 (list (canonical-package gcc)))
759 #:phases
760 #~(modify-phases %standard-phases
761 (add-after 'unpack 'set-LDFLAGS
762 (lambda _
763 ;; The Cython-compiled shared library would fail the
764 ;; validate-runpath phase otherwise.
765 (setenv "LDFLAGS"
766 (string-append "-Wl,-rpath=" #$output "/lib"))))
767 (add-before 'configure 'strip-pmix-cc-absolute
768 (lambda _
769 ;; The 'pmix_info' program prints the 'configure' command line,
770 ;; compiler absolute file name, etc., which causes it to keep
771 ;; references to many build-time packages. Scrub these.
772 (substitute* "configure"
773 (("PMIX_CC_ABSOLUTE=\"(.*)\"" _ cc)
774 (string-append "PMIX_CC_ABSOLUTE=\"$(basename \""
775 cc "\")\"\n")))))
776 (add-after 'configure 'strip-pmix-config-header
777 (lambda _
778 (substitute* "src/include/pmix_config.h"
779 (("#define PMIX_CONFIGURE_CLI .*")
780 "#define PMIX_CONFIGURE_CLI \"[scrubbed]\"\n")))))))
781 (inputs (list libevent `(,hwloc "lib") zlib))
782 (native-inputs (list perl python python-cython-0))
783 (synopsis "PMIx library")
784 (description
785 "PMIx is an application programming interface standard that provides
786libraries and programming models with portable and well-defined access to
787commonly needed services in distributed and parallel computing systems.")
788 (home-page "https://openpmix.org/")
789 ;; configure: WARNING: PMIx does not support 32 bit builds.
790 (supported-systems %64bit-supported-systems)
791 ;; The provided license is kind of BSD-style but specific.
792 (license (license:fsf-free "https://github.com/openpmix/openpmix?tab=License-1-ov-file#License-1-ov-file"))))
793
794(define-public openpmix-4
795 (package
796 (inherit openpmix)
797 (version "4.2.8")
798 (source (origin
799 (method url-fetch)
800 (uri (string-append
801 "https://github.com/openpmix/openpmix/releases/download/v"
802 version "/pmix-" version ".tar.bz2"))
803 (sha256
804 (base32
805 "1j9xlhqrrmgjdkwakamn78y5gj756adi53hn25zksgr3is3l5d09"))
806 (snippet
807 '(begin (use-modules (guix build utils))
808 ;; Remove ~5 MiB of pre-built HTML doc.
809 (delete-file-recursively "docs/_build/html")))))
810 (arguments
811 (substitute-keyword-arguments (package-arguments openpmix)
812 ((#:configure-flags flags #~'())
813 #~(list (string-append "--with-hwloc="
814 (ungexp (this-package-input "hwloc") "lib"))
815 "--enable-python-bindings"))))))
816
817(define-public prrte
818 (package
819 (name "prrte")
820 (version "4.0.0")
821 (source (origin
822 (method url-fetch)
823 (uri (string-append
824 "https://github.com/openpmix/prrte/releases/download/v"
825 version "/prrte-" version ".tar.bz2"))
826 (sha256
827 (base32
828 "1r2dxnv3spmfd3l5is8cly2mmmc98xgm9wvvih99j35sw1hwjbiw"))))
829 (build-system gnu-build-system)
830 (arguments
831 (list #:configure-flags
832 #~(list "--disable-static")
833
834 #:phases
835 #~(modify-phases %standard-phases
836 (add-after 'unpack 'remove-absolute-references
837 (lambda _
838 ;; Remove references to GCC, the shell, etc. (shown by
839 ;; 'prte_info') to reduce the closure size.
840 (substitute* "src/tools/prte_info/param.c"
841 (("_ABSOLUTE")
842 "")
843 (("PRTE_CONFIGURE_CLI")
844 "\"[elided to reduce closure]\""))))
845 (add-after 'unpack 'patch-prted-reference
846 (lambda _
847 ;; Record the absolute file name of 'prted' instead of
848 ;; assuming it will be found in $PATH at run time.
849 (substitute* "src/runtime/prte_mca_params.c"
850 (("prte_launch_agent =.*")
851 (string-append "prte_launch_agent = \""
852 #$output "/bin/prted\";\n")))))
853 (add-after 'install 'adjust-pcc-link
854 (lambda* (#:key inputs #:allow-other-keys)
855 ;; Adjust the 'pcc' symlink to its points to 'pmixcc' using
856 ;; its absolute file name instead of just 'pmixcc'.
857 (let* ((pcc (string-append #$output "/bin/pcc"))
858 (target (string-append "/bin/" (readlink pcc))))
859 (delete-file pcc)
860 (symlink (search-input-file inputs target)
861 pcc)))))
862
863 #:disallowed-references (list (canonical-package gcc))))
864 (inputs (list libevent
865 `(,hwloc "lib")
866 openpmix
867 libnl))
868 (native-inputs (list pkg-config perl))
869 (outputs '("out"
870
871 ;; Move ~5 MiB of HTML docs (including CSS, JS, and fonts!) to a
872 ;; separate output.
873 "doc"))
874 (synopsis "PMIx Reference RunTime Environment (PRRTE)")
875 (description
876 "The PMIx Reference RunTime Environment is a runtime environment
877containing the reference implementation and capable of operating
878within a host SMS. The reference RTE therefore provides an easy way of
879exploring PMIx capabilities and testing PMIx-based applications
880outside of a PMIx-enabled environment.")
881 (home-page "https://openpmix.github.io/")
882 ;; The provided license is kind of BSD-style but specific.
883 (license (license:fsf-free "https://github.com/openpmix/prrte?tab=License-1-ov-file#License-1-ov-file"))))