parallel.scm 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  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. ;;;
  13. ;;; This file is part of GNU Guix.
  14. ;;;
  15. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  16. ;;; under the terms of the GNU General Public License as published by
  17. ;;; the Free Software Foundation; either version 3 of the License, or (at
  18. ;;; your option) any later version.
  19. ;;;
  20. ;;; GNU Guix is distributed in the hope that it will be useful, but
  21. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  22. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  23. ;;; GNU General Public License for more details.
  24. ;;;
  25. ;;; You should have received a copy of the GNU General Public License
  26. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  27. (define-module (gnu packages parallel)
  28. #:use-module (guix build-system gnu)
  29. #:use-module (guix download)
  30. #:use-module ((guix licenses) #:prefix license:)
  31. #:use-module (guix packages)
  32. #:use-module (gnu packages)
  33. #:use-module (gnu packages admin)
  34. #:use-module (gnu packages autotools)
  35. #:use-module (gnu packages base)
  36. #:use-module (gnu packages freeipmi)
  37. #:use-module (gnu packages linux)
  38. #:use-module (gnu packages mpi)
  39. #:use-module (gnu packages perl)
  40. #:use-module (gnu packages pkg-config)
  41. #:use-module (gnu packages python)
  42. #:use-module (gnu packages readline)
  43. #:use-module (gnu packages tcl)
  44. #:use-module (gnu packages tls)
  45. #:use-module (gnu packages web))
  46. (define-public parallel
  47. (package
  48. (name "parallel")
  49. (version "20190222")
  50. (source
  51. (origin
  52. (method url-fetch)
  53. (uri (string-append "mirror://gnu/parallel/parallel-"
  54. version ".tar.bz2"))
  55. (sha256
  56. (base32
  57. "073bj0ji9liq07j6a7y9i4kxfkv06kvavhh7654f2bgfavfbmcc6"))))
  58. (build-system gnu-build-system)
  59. (arguments
  60. `(#:phases
  61. (modify-phases %standard-phases
  62. (add-after 'unpack 'patch-bin-sh
  63. (lambda _
  64. (for-each
  65. (lambda (file)
  66. (substitute* file
  67. ;; Patch hard coded '/bin/sh' in the line ending in:
  68. ;; $Global::shell = $ENV{'PARALLEL_SHELL'} ||
  69. ;; parent_shell($$) || $ENV{'SHELL'} || "/bin/sh";
  70. (("/bin/sh\\\";\n$") (string-append (which "sh") "\";\n"))))
  71. (list "src/parallel" "src/sem"))
  72. #t))
  73. (add-after 'install 'wrap-program
  74. (lambda* (#:key inputs outputs #:allow-other-keys)
  75. (let ((out (assoc-ref outputs "out")))
  76. (wrap-program (string-append out "/bin/parallel")
  77. `("PATH" ":" prefix
  78. ,(map (lambda (input)
  79. (string-append (assoc-ref inputs input) "/bin"))
  80. '("perl"
  81. "procps"))))
  82. #t)))
  83. (add-after 'wrap-program 'post-install-test
  84. (lambda* (#:key outputs #:allow-other-keys)
  85. (invoke (string-append
  86. (assoc-ref outputs "out") "/bin/parallel")
  87. "echo"
  88. ":::" "1" "2" "3"))))))
  89. (inputs
  90. `(("perl" ,perl)
  91. ("procps" ,procps)))
  92. (home-page "https://www.gnu.org/software/parallel/")
  93. (synopsis "Build and execute command lines in parallel")
  94. (description
  95. "GNU Parallel is a tool for executing shell jobs in parallel using one
  96. or more computers. Jobs can consist of single commands or of scripts
  97. and they are executed on lists of files, hosts, users or other items.")
  98. (license license:gpl3+)))
  99. (define-public slurm
  100. (package
  101. (name "slurm")
  102. (version "17.11.3")
  103. (source (origin
  104. (method url-fetch)
  105. (uri (string-append
  106. "https://download.schedmd.com/slurm/slurm-"
  107. version ".tar.bz2"))
  108. (sha256
  109. (base32
  110. "1x3i6z03d9m46fvj1cslrapm1drvgyqch9pn4xf23kvbz4gkhaps"))
  111. (modules '((guix build utils)))
  112. (snippet
  113. '(begin
  114. (substitute* "configure.ac"
  115. (("^[[:space:]]+contribs/.*$") ""))
  116. (delete-file-recursively "contribs")
  117. #t))))
  118. ;; FIXME: More optional inputs could be added,
  119. ;; in particular mysql and gtk+.
  120. (inputs `(("expect" ,expect)
  121. ("freeipmi" ,freeipmi)
  122. ("hwloc" ,hwloc "lib")
  123. ("json-c" ,json-c)
  124. ("linux-pam" , linux-pam)
  125. ("munge" ,munge)
  126. ("numactl" ,numactl)
  127. ("openssl" ,openssl)
  128. ("perl" ,perl)
  129. ("python" ,python-wrapper)
  130. ("readline" ,readline)))
  131. (native-inputs
  132. `(("autoconf" ,autoconf)
  133. ("pkg-config" ,pkg-config)))
  134. (build-system gnu-build-system)
  135. (arguments
  136. `(#:configure-flags
  137. (list "--enable-pam"
  138. (string-append "--with-freeipmi=" (assoc-ref %build-inputs "freeipmi"))
  139. (string-append "--with-hwloc=" (assoc-ref %build-inputs "hwloc"))
  140. (string-append "--with-json=" (assoc-ref %build-inputs "json-c"))
  141. (string-append "--with-munge=" (assoc-ref %build-inputs "munge"))
  142. (string-append "--with-ssl=" (assoc-ref %build-inputs "openssl")))
  143. #:phases
  144. (modify-phases %standard-phases
  145. (add-after 'unpack 'autoconf
  146. (lambda _ (invoke "autoconf")))))) ; configure.ac was patched
  147. (home-page "https://slurm.schedmd.com/")
  148. (synopsis "Workload manager for cluster computing")
  149. (description
  150. "SLURM is a fault-tolerant and highly scalable cluster management and job
  151. scheduling system for large and small clusters. It allocates access to
  152. resources (computer nodes) to users for some duration of time, provides a
  153. framework for starting, executing, and monitoring work (typically a parallel
  154. job) on a set of allocated nodes, and arbitrates contention for resources
  155. by managing a queue of pending work.")
  156. (license (list license:bsd-2 ; src/common/log.[ch], src/common/uthash
  157. license:expat ; slurm/pmi.h
  158. license:isc ; src/common/strlcpy.c
  159. license:lgpl2.1+ ; hilbert.[ch], src/common/slurm_time.h
  160. license:zlib ; src/common/strnatcmp.c
  161. license:gpl2+)))) ; the rest, often with OpenSSL exception
  162. (define-public slurm-drmaa
  163. (package
  164. (name "slurm-drmaa")
  165. (version "1.0.7")
  166. (source (origin
  167. (method url-fetch)
  168. (uri "http://apps.man.poznan.pl/trac/slurm-drmaa/downloads/9")
  169. (file-name (string-append name "-" version ".tar.gz"))
  170. (sha256
  171. (base32
  172. "0grw55hmny2mc4nc0y1arnvxd2k0dcdfn476kzs180fibjxgfw14"))))
  173. (build-system gnu-build-system)
  174. (inputs
  175. `(("slurm" ,slurm)))
  176. (native-inputs
  177. `(("which" ,which)))
  178. (home-page "http://apps.man.poznan.pl/trac/slurm-drmaa")
  179. (synopsis "Distributed resource management application API for SLURM")
  180. (description
  181. "PSNC DRMAA for Simple Linux Utility for Resource Management (SLURM) is
  182. an implementation of Open Grid Forum DRMAA 1.0 (Distributed Resource
  183. Management Application API) specification for submission and control of jobs
  184. to SLURM. Using DRMAA, grid applications builders, portal developers and ISVs
  185. can use the same high-level API to link their software with different
  186. cluster/resource management systems.")
  187. (license license:gpl3+)))