2014-05-01 13:16:16 -04:00
|
|
|
;;; GNU Guix --- Functional package management for GNU
|
2018-08-16 16:47:41 -04:00
|
|
|
;;; Copyright © 2014, 2015, 2018 Eric Bavier <bavier@member.fsf.org>
|
2018-02-06 11:33:14 -05:00
|
|
|
;;; Copyright © 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
|
2014-10-18 22:03:42 -04:00
|
|
|
;;; Copyright © 2014 Ian Denhardt <ian@zenhack.net>
|
2016-02-03 15:05:51 -05:00
|
|
|
;;; Copyright © 2016 Andreas Enge <andreas@enge.fr>
|
2017-07-23 17:00:21 -04:00
|
|
|
;;; Copyright © 2017 Dave Love <fx@gnu.org>
|
2017-11-07 13:26:34 -05:00
|
|
|
;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
|
2018-10-04 15:26:38 -04:00
|
|
|
;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
|
2014-05-01 13:16:16 -04:00
|
|
|
;;;
|
|
|
|
;;; This file is part of GNU Guix.
|
|
|
|
;;;
|
|
|
|
;;; GNU Guix is free software; you can redistribute it and/or modify it
|
|
|
|
;;; under the terms of the GNU General Public License as published by
|
|
|
|
;;; the Free Software Foundation; either version 3 of the License, or (at
|
|
|
|
;;; your option) any later version.
|
|
|
|
;;;
|
|
|
|
;;; GNU Guix is distributed in the hope that it will be useful, but
|
|
|
|
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
;;; GNU General Public License for more details.
|
|
|
|
;;;
|
|
|
|
;;; You should have received a copy of the GNU General Public License
|
|
|
|
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
(define-module (gnu packages mpi)
|
|
|
|
#:use-module (guix packages)
|
2014-05-09 09:49:08 -04:00
|
|
|
#:use-module ((guix licenses)
|
|
|
|
#:hide (expat))
|
2014-05-01 13:16:16 -04:00
|
|
|
#:use-module (guix download)
|
2014-10-18 22:03:42 -04:00
|
|
|
#:use-module (guix utils)
|
2014-05-01 13:16:16 -04:00
|
|
|
#:use-module (guix build-system gnu)
|
|
|
|
#:use-module (gnu packages)
|
|
|
|
#:use-module (gnu packages gcc)
|
2014-05-09 09:49:08 -04:00
|
|
|
#:use-module (gnu packages linux)
|
|
|
|
#:use-module (gnu packages pciutils)
|
|
|
|
#:use-module (gnu packages xorg)
|
|
|
|
#:use-module (gnu packages gtk)
|
|
|
|
#:use-module (gnu packages xml)
|
2015-06-15 03:24:14 -04:00
|
|
|
#:use-module (gnu packages perl)
|
2014-05-09 09:49:08 -04:00
|
|
|
#:use-module (gnu packages ncurses)
|
|
|
|
#:use-module (gnu packages pkg-config)
|
2017-11-07 13:26:34 -05:00
|
|
|
#:use-module (gnu packages valgrind)
|
2018-02-06 11:33:14 -05:00
|
|
|
#:use-module (srfi srfi-1)
|
2017-11-07 13:26:34 -05:00
|
|
|
#:use-module (ice-9 match))
|
2014-05-01 13:16:16 -04:00
|
|
|
|
2014-05-09 09:49:08 -04:00
|
|
|
(define-public hwloc
|
2018-02-06 11:33:14 -05:00
|
|
|
;; Note: For now we keep 1.x as the default because many packages have yet
|
|
|
|
;; to migrate to 2.0.
|
2014-05-09 09:49:08 -04:00
|
|
|
(package
|
|
|
|
(name "hwloc")
|
2018-03-26 12:04:38 -04:00
|
|
|
(version "1.11.10")
|
2014-05-09 09:49:08 -04:00
|
|
|
(source (origin
|
|
|
|
(method url-fetch)
|
2016-04-14 04:19:40 -04:00
|
|
|
(uri (string-append "https://www.open-mpi.org/software/hwloc/v"
|
2015-06-14 18:11:00 -04:00
|
|
|
(version-major+minor version)
|
|
|
|
"/downloads/hwloc-" version ".tar.bz2"))
|
2014-05-09 09:49:08 -04:00
|
|
|
(sha256
|
|
|
|
(base32
|
2018-03-26 12:04:38 -04:00
|
|
|
"1ryibcng40xcq22lsj85fn2vcvrksdx9rr3wwxpq8dw37lw0is1b"))))
|
2014-05-09 09:49:08 -04:00
|
|
|
(build-system gnu-build-system)
|
2017-06-30 11:55:41 -04:00
|
|
|
(outputs '("out" ;'lstopo' & co., depends on Cairo, libx11, etc.
|
|
|
|
"lib" ;small closure
|
|
|
|
"debug"))
|
2014-05-09 09:49:08 -04:00
|
|
|
(inputs
|
2014-05-12 17:43:04 -04:00
|
|
|
`(("libx11" ,libx11)
|
2014-05-09 09:49:08 -04:00
|
|
|
("cairo" ,cairo)
|
|
|
|
("ncurses" ,ncurses)
|
2016-02-03 15:05:51 -05:00
|
|
|
("expat" ,expat)
|
|
|
|
,@(if (not (string-prefix? "armhf"
|
|
|
|
(or (%current-target-system)
|
|
|
|
(%current-system))))
|
|
|
|
`(("numactl" ,numactl))
|
|
|
|
'())))
|
2015-08-23 18:28:36 -04:00
|
|
|
(propagated-inputs
|
|
|
|
;; hwloc.pc lists it in 'Requires.private'.
|
|
|
|
`(("libpciaccess" ,libpciaccess)))
|
2014-05-09 09:49:08 -04:00
|
|
|
(native-inputs
|
|
|
|
`(("pkg-config" ,pkg-config)))
|
2015-06-17 05:17:10 -04:00
|
|
|
(arguments
|
2017-06-30 11:31:03 -04:00
|
|
|
`(#:configure-flags '("--localstatedir=/var")
|
|
|
|
#:phases
|
2015-06-17 05:17:10 -04:00
|
|
|
(modify-phases %standard-phases
|
2018-04-10 08:29:33 -04:00
|
|
|
(add-before 'check 'skip-linux-libnuma-test
|
|
|
|
(lambda _
|
|
|
|
;; Arrange to skip 'tests/linux-libnuma', which fails on some
|
|
|
|
;; machines: <https://github.com/open-mpi/hwloc/issues/213>.
|
|
|
|
(substitute* "tests/linux-libnuma.c"
|
|
|
|
(("numa_available\\(\\)")
|
|
|
|
"-1"))
|
|
|
|
#t))
|
2017-06-30 11:55:41 -04:00
|
|
|
(add-after 'install 'refine-libnuma
|
|
|
|
;; Give -L arguments for libraries to avoid propagation
|
|
|
|
(lambda* (#:key inputs outputs #:allow-other-keys)
|
|
|
|
(let ((out (assoc-ref outputs "lib"))
|
|
|
|
(numa (assoc-ref inputs "numactl")))
|
|
|
|
(substitute* (map (lambda (f) (string-append out "/" f))
|
|
|
|
'("lib/pkgconfig/hwloc.pc" "lib/libhwloc.la"))
|
|
|
|
(("-lnuma" lib)
|
|
|
|
(string-append "-L" numa "/lib " lib))))))
|
|
|
|
(add-after 'install 'avoid-circular-references
|
|
|
|
(lambda* (#:key outputs #:allow-other-keys)
|
|
|
|
(let ((lib (assoc-ref outputs "lib")))
|
|
|
|
;; Suppress the 'prefix=' and 'exec_prefix=' lines so that the
|
|
|
|
;; "lib" output doesn't refer to "out".
|
|
|
|
(substitute* (string-append lib "/lib/pkgconfig/hwloc.pc")
|
|
|
|
(("^.*prefix=.*$")
|
|
|
|
""))
|
|
|
|
#t))))))
|
2016-04-14 04:19:40 -04:00
|
|
|
(home-page "https://www.open-mpi.org/projects/hwloc/")
|
2014-05-09 09:49:08 -04:00
|
|
|
(synopsis "Abstraction of hardware architectures")
|
|
|
|
(description
|
|
|
|
"hwloc provides a portable abstraction (across OS,
|
|
|
|
versions, architectures, ...) of the hierarchical topology of modern
|
|
|
|
architectures, including NUMA memory nodes, sockets, shared caches, cores and
|
|
|
|
simultaneous multithreading. It also gathers various attributes such as cache
|
|
|
|
and memory information. It primarily aims at helping high-performance
|
|
|
|
computing applications with gathering information about the hardware so as to
|
|
|
|
exploit it accordingly and efficiently.
|
|
|
|
|
|
|
|
hwloc may display the topology in multiple convenient formats. It also offers
|
|
|
|
a powerful programming interface to gather information about the hardware,
|
|
|
|
bind processes, and much more.")
|
|
|
|
(license bsd-3)))
|
|
|
|
|
2018-02-06 11:33:14 -05:00
|
|
|
(define-public hwloc-2.0
|
|
|
|
;; Note: 2.0 isn't the default yet, see above.
|
|
|
|
(package
|
|
|
|
(inherit hwloc)
|
2018-10-04 15:26:38 -04:00
|
|
|
(version "2.0.2")
|
2018-02-06 11:33:14 -05:00
|
|
|
(source (origin
|
|
|
|
(method url-fetch)
|
|
|
|
(uri (string-append "https://www.open-mpi.org/software/hwloc/v"
|
|
|
|
(version-major+minor version)
|
|
|
|
"/downloads/hwloc-" version ".tar.bz2"))
|
|
|
|
(sha256
|
|
|
|
(base32
|
2018-10-04 15:26:38 -04:00
|
|
|
"1phc863d5b2fvwpyyq4mlh4rkjdslh6h0h197zmyk3prwrq7si8l"))))
|
2018-02-06 11:33:14 -05:00
|
|
|
|
|
|
|
;; libnuma is no longer needed.
|
2018-04-10 08:29:33 -04:00
|
|
|
(inputs (alist-delete "numactl" (package-inputs hwloc)))
|
|
|
|
(arguments
|
|
|
|
(substitute-keyword-arguments (package-arguments hwloc)
|
|
|
|
((#:phases phases)
|
|
|
|
`(modify-phases ,phases
|
|
|
|
(replace 'skip-linux-libnuma-test
|
|
|
|
(lambda _
|
|
|
|
;; Arrange to skip 'tests/hwloc/linux-libnuma', which fails on
|
|
|
|
;; some machines: <https://github.com/open-mpi/hwloc/issues/213>.
|
|
|
|
(substitute* "tests/hwloc/linux-libnuma.c"
|
|
|
|
(("numa_available\\(\\)")
|
|
|
|
"-1"))
|
|
|
|
#t))))))))
|
2018-02-06 11:33:14 -05:00
|
|
|
|
2014-05-01 13:16:16 -04:00
|
|
|
(define-public openmpi
|
|
|
|
(package
|
|
|
|
(name "openmpi")
|
2018-05-12 11:53:54 -04:00
|
|
|
(version "3.0.1")
|
2014-05-01 13:16:16 -04:00
|
|
|
(source
|
|
|
|
(origin
|
|
|
|
(method url-fetch)
|
2016-07-08 13:15:38 -04:00
|
|
|
(uri (string-append "https://www.open-mpi.org/software/ompi/v"
|
2014-10-18 22:03:42 -04:00
|
|
|
(version-major+minor version)
|
2014-05-01 13:16:16 -04:00
|
|
|
"/downloads/openmpi-" version ".tar.bz2"))
|
|
|
|
(sha256
|
|
|
|
(base32
|
2018-05-12 11:53:54 -04:00
|
|
|
"0pbqrm5faf57nasy1s81wqivl7zvxmv8lzjh8hvb0f3qxv8m0d36"))))
|
2014-05-01 13:16:16 -04:00
|
|
|
(build-system gnu-build-system)
|
2014-05-12 17:43:04 -04:00
|
|
|
(inputs
|
2017-06-30 11:55:41 -04:00
|
|
|
`(("hwloc" ,hwloc "lib")
|
2015-06-25 11:56:07 -04:00
|
|
|
("gfortran" ,gfortran)
|
2017-08-02 09:11:54 -04:00
|
|
|
("libfabric" ,libfabric)
|
2018-05-25 06:11:41 -04:00
|
|
|
,@(if (and (not (%current-target-system))
|
|
|
|
(member (%current-system) (package-supported-systems psm)))
|
|
|
|
`(("psm" ,psm))
|
|
|
|
'())
|
2018-05-25 07:41:59 -04:00
|
|
|
,@(if (and (not (%current-target-system))
|
|
|
|
(member (%current-system) (package-supported-systems psm2)))
|
|
|
|
`(("psm2" ,psm2))
|
|
|
|
'())
|
2017-08-02 09:11:54 -04:00
|
|
|
("rdma-core" ,rdma-core)
|
2014-05-18 12:08:17 -04:00
|
|
|
("valgrind" ,valgrind)))
|
2014-05-12 17:43:04 -04:00
|
|
|
(native-inputs
|
2015-06-15 03:24:14 -04:00
|
|
|
`(("pkg-config" ,pkg-config)
|
|
|
|
("perl" ,perl)))
|
2017-10-02 16:54:43 -04:00
|
|
|
(outputs '("out" "debug"))
|
2014-05-01 13:16:16 -04:00
|
|
|
(arguments
|
2017-09-11 16:30:40 -04:00
|
|
|
`(#:configure-flags `("--enable-mpi-ext=affinity" ;cr doesn't work
|
2014-05-18 12:08:17 -04:00
|
|
|
"--enable-memchecker"
|
2017-07-23 17:02:54 -04:00
|
|
|
"--with-sge"
|
2017-07-31 10:04:44 -04:00
|
|
|
|
|
|
|
;; VampirTrace is obsoleted by scorep and disabling
|
|
|
|
;; it reduces the closure size considerably.
|
|
|
|
"--disable-vt"
|
|
|
|
|
2014-05-18 12:08:17 -04:00
|
|
|
,(string-append "--with-valgrind="
|
|
|
|
(assoc-ref %build-inputs "valgrind"))
|
2014-05-12 17:43:04 -04:00
|
|
|
,(string-append "--with-hwloc="
|
2016-07-08 17:00:07 -04:00
|
|
|
(assoc-ref %build-inputs "hwloc")))
|
|
|
|
#:phases (modify-phases %standard-phases
|
2017-07-31 12:15:19 -04:00
|
|
|
(add-before 'build 'remove-absolute
|
|
|
|
(lambda _
|
2017-09-04 13:04:21 -04:00
|
|
|
;; Remove compiler absolute file names (OPAL_FC_ABSOLUTE
|
|
|
|
;; etc.) to reduce the closure size. See
|
|
|
|
;; <https://lists.gnu.org/archive/html/guix-devel/2017-07/msg00388.html>
|
|
|
|
;; and
|
|
|
|
;; <https://www.mail-archive.com/users@lists.open-mpi.org//msg31397.html>.
|
2017-07-31 12:15:19 -04:00
|
|
|
(substitute* '("orte/tools/orte-info/param.c"
|
|
|
|
"oshmem/tools/oshmem_info/param.c"
|
|
|
|
"ompi/tools/ompi_info/param.c")
|
|
|
|
(("_ABSOLUTE") ""))
|
2017-09-04 13:04:21 -04:00
|
|
|
;; Avoid valgrind (which pulls in gdb etc.).
|
|
|
|
(substitute*
|
2018-05-12 11:53:54 -04:00
|
|
|
'("./ompi/mca/io/romio314/src/io_romio314_component.c")
|
|
|
|
(("MCA_io_romio314_COMPLETE_CONFIGURE_FLAGS")
|
2017-09-04 13:04:21 -04:00
|
|
|
"\"[elided to reduce closure]\""))
|
2017-07-31 12:15:19 -04:00
|
|
|
#t))
|
2016-07-08 17:00:07 -04:00
|
|
|
(add-before 'build 'scrub-timestamps ;reproducibility
|
|
|
|
(lambda _
|
|
|
|
(substitute* '("ompi/tools/ompi_info/param.c"
|
|
|
|
"orte/tools/orte-info/param.c"
|
|
|
|
"oshmem/tools/oshmem_info/param.c")
|
|
|
|
((".*(Built|Configured) on.*") ""))
|
|
|
|
#t))
|
|
|
|
(add-after 'install 'remove-logs ;reproducibility
|
|
|
|
(lambda* (#:key outputs #:allow-other-keys)
|
|
|
|
(let ((out (assoc-ref outputs "out")))
|
|
|
|
(for-each delete-file (find-files out "config.log"))
|
|
|
|
#t))))))
|
2014-05-01 13:16:16 -04:00
|
|
|
(home-page "http://www.open-mpi.org")
|
2017-07-23 17:30:40 -04:00
|
|
|
(synopsis "MPI-3 implementation")
|
2014-05-01 13:16:16 -04:00
|
|
|
(description
|
2017-07-23 17:30:40 -04:00
|
|
|
"The Open MPI Project is an MPI-3 implementation that is developed and
|
2014-05-08 15:48:59 -04:00
|
|
|
maintained by a consortium of academic, research, and industry partners. Open
|
|
|
|
MPI is therefore able to combine the expertise, technologies, and resources
|
|
|
|
from all across the High Performance Computing community in order to build the
|
|
|
|
best MPI library available. Open MPI offers advantages for system and
|
|
|
|
software vendors, application developers and computer science researchers.")
|
2014-05-01 13:16:16 -04:00
|
|
|
;; See file://LICENSE
|
|
|
|
(license bsd-2)))
|
2017-07-27 10:52:34 -04:00
|
|
|
|
|
|
|
(define-public openmpi-thread-multiple
|
|
|
|
(package
|
|
|
|
(inherit openmpi)
|
|
|
|
(name "openmpi-thread-multiple")
|
|
|
|
(arguments
|
|
|
|
(substitute-keyword-arguments (package-arguments openmpi)
|
|
|
|
((#:configure-flags flags)
|
|
|
|
`(cons "--enable-mpi-thread-multiple" ,flags))))
|
|
|
|
(description " This version of Open@tie{}MPI has an implementation of
|
|
|
|
@code{MPI_Init_thread} that provides @code{MPI_THREAD_MULTIPLE}. This won't
|
|
|
|
work correctly with all transports (such as @code{openib}), and the
|
|
|
|
performance is generally worse than the vanilla @code{openmpi} package, which
|
|
|
|
only provides @code{MPI_THREAD_FUNNELED}.")))
|
2018-08-16 16:47:41 -04:00
|
|
|
|
|
|
|
;;; Build phase to be used for packages that execute MPI code.
|
|
|
|
(define-public %openmpi-setup
|
|
|
|
'(lambda _
|
|
|
|
;; By default, running the test suite would fail because 'ssh' could not
|
|
|
|
;; be found in $PATH. Define this variable to placate Open MPI without
|
|
|
|
;; adding a dependency on OpenSSH (the agent isn't used anyway.)
|
|
|
|
(setenv "OMPI_MCA_plm_rsh_agent" (which "false"))
|
|
|
|
;; Allow oversubscription in case there are less physical cores available
|
|
|
|
;; in the build environment than the package wants while testing.
|
|
|
|
(setenv "OMPI_MCA_rmaps_base_oversubscribe" "yes")
|
|
|
|
#t))
|