123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538 |
- (define-module (gnu packages mpi)
- #:use-module (guix packages)
- #:use-module ((guix licenses) #:prefix license:)
- #:use-module (guix download)
- #:use-module (guix utils)
- #:use-module (guix deprecation)
- #:use-module (guix build-system gnu)
- #:use-module (guix build-system python)
- #:use-module (gnu packages)
- #:use-module (gnu packages base)
- #:use-module (gnu packages compression)
- #:use-module (gnu packages fabric-management)
- #:use-module (gnu packages gcc)
- #:use-module (gnu packages java)
- #:use-module (gnu packages libevent)
- #: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)
- #:use-module (gnu packages perl)
- #:use-module (gnu packages ncurses)
- #:use-module (gnu packages parallel)
- #:use-module (gnu packages pkg-config)
- #:use-module (gnu packages valgrind)
- #:use-module (srfi srfi-1)
- #:use-module (ice-9 match))
- (define-public hwloc-1
-
-
- (package
- (name "hwloc")
- (version "1.11.12")
- (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
- "0za1b9lvrm3rhn0lrxja5f64r0aq1qs4m0pxn1ji2mbi8ndppyyx"))))
- (properties
-
- `((release-monitoring-url
- . "https://www-lb.open-mpi.org/software/hwloc/current")))
- (build-system gnu-build-system)
- (outputs '("out"
- "lib"
- "doc"
- "debug"))
- (inputs
- `(("libx11" ,libx11)
- ("cairo" ,cairo)
- ("ncurses" ,ncurses)
- ("expat" ,expat)
- ,@(if (not (string-prefix? "armhf"
- (or (%current-target-system)
- (%current-system))))
- `(("numactl" ,numactl))
- '())))
- (propagated-inputs
-
- (list libpciaccess))
- (native-inputs
- (list pkg-config))
- (arguments
- `(#:configure-flags '("--localstatedir=/var")
- #:phases
- (modify-phases %standard-phases
- (add-before 'check 'skip-linux-libnuma-test
- (lambda _
-
-
- (substitute* "tests/linux-libnuma.c"
- (("numa_available\\(\\)")
- "-1"))
- #t))
- (add-after 'install 'refine-libnuma
-
- (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")))
-
-
- (substitute* (string-append lib "/lib/pkgconfig/hwloc.pc")
- (("^.*prefix=.*$")
- ""))
- #t)))
- (add-after 'install 'move-man3-pages
- (lambda* (#:key outputs #:allow-other-keys)
-
- (let ((out (assoc-ref outputs "out"))
- (doc (assoc-ref outputs "doc")))
- (copy-recursively (string-append out "/share/man/man3")
- (string-append doc "/share/man/man3"))
- (delete-file-recursively (string-append out "/share/man/man3"))
- #t))))))
- (home-page "https://www.open-mpi.org/projects/hwloc/")
- (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 license:bsd-3)))
- (define-public hwloc-2
-
- (package
- (inherit hwloc-1)
- (version "2.7.1")
- (source (origin
- (method url-fetch)
- (uri (string-append "https://download.open-mpi.org/release/hwloc/v"
- (version-major+minor version)
- "/hwloc-" version ".tar.bz2"))
- (sha256
- (base32
- "13ajxwshxl1pa8b5gnkmm7hcg97m6xrlgz8vj1hmsb57qcv1skhd"))))
-
- (inputs (alist-delete "numactl" (package-inputs hwloc-1)))
- (arguments
- (substitute-keyword-arguments (package-arguments hwloc-1)
- ((#:phases phases)
- `(modify-phases ,phases
- (replace 'skip-linux-libnuma-test
- (lambda _
-
-
- (substitute* "tests/hwloc/linux-libnuma.c"
- (("numa_available\\(\\)")
- "-1"))
- #t))
- (add-before 'check 'skip-test-that-fails-on-qemu
- (lambda _
-
-
- (substitute* "tests/hwloc/hwloc_get_last_cpu_location.c"
- (("hwloc_topology_init" all)
- (string-append "exit (77);\n" all)))
- #t))))))))
- (define-deprecated hwloc-2.0 hwloc-2)
- (define-public hwloc
-
- hwloc-2)
- (define-public openmpi
- (package
- (name "openmpi")
- (version "4.1.2")
- (source
- (origin
- (method url-fetch)
- (uri (string-append "https://www.open-mpi.org/software/ompi/v"
- (version-major+minor version)
- "/downloads/openmpi-" version ".tar.bz2"))
- (sha256
- (base32 "09xmlr4mfs02kwcf5cmdgkcdjj81fjwjmpa3rz2k28f3gz7wfy4v"))
- (patches (search-patches "openmpi-mtl-priorities.patch"))))
- (properties
-
- `((release-monitoring-url
- . "https://www.open-mpi.org/software/ompi/current")))
- (build-system gnu-build-system)
- (inputs
- `(("hwloc" ,hwloc-2 "lib")
- ("gfortran" ,gfortran)
- ("libfabric" ,libfabric)
- ("libevent" ,libevent)
- ("opensm" ,opensm)
- ,@(if (and (not (%current-target-system))
- (member (%current-system) (package-supported-systems psm)))
- `(("psm" ,psm))
- '())
- ,@(if (and (not (%current-target-system))
- (member (%current-system) (package-supported-systems psm2)))
- `(("psm2" ,psm2))
- '())
- ,@(if (and (not (%current-target-system))
- (member (%current-system) (package-supported-systems ucx)))
- `(("ucx" ,ucx))
- '())
- ("rdma-core" ,rdma-core)
- ("valgrind" ,valgrind)
- ("slurm" ,slurm)))
- (native-inputs
- (list pkg-config perl))
- (outputs '("out" "debug"))
- (arguments
- `(#:configure-flags `("--enable-mpi-ext=affinity"
- "--enable-memchecker"
- "--with-sge"
- "--with-valgrind"
- "--with-hwloc=external"
- "--with-libevent"
-
-
- "--enable-mpirun-prefix-by-default"
-
- "--enable-openib-control-hdr-padding"
- "--enable-openib-dynamic-sl"
- "--enable-openib-udcm"
- "--enable-openib-rdmacm"
- "--enable-openib-rdmacm-ibaddr"
-
-
- ,(string-append "--with-pmi="
- (assoc-ref %build-inputs "slurm")))
- #:phases (modify-phases %standard-phases
-
- (add-after 'unpack 'find-opensm-headers
- (lambda* (#:key inputs #:allow-other-keys)
- (setenv "C_INCLUDE_PATH"
- (search-input-directory inputs
- "/include/infiniband"))
- (setenv "CPLUS_INCLUDE_PATH"
- (search-input-directory inputs
- "/include/infiniband"))))
- (add-before 'build 'remove-absolute
- (lambda _
-
-
-
-
-
- (substitute* '("orte/tools/orte-info/param.c"
- "oshmem/tools/oshmem_info/param.c"
- "ompi/tools/ompi_info/param.c")
- (("_ABSOLUTE") ""))
-
- (substitute*
- '("./ompi/mca/io/romio321/src/io_romio321_component.c")
- (("MCA_io_romio321_COMPLETE_CONFIGURE_FLAGS")
- "\"[elided to reduce closure]\""))
- #t))
- (add-before 'build 'scrub-timestamps
- (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
- (lambda* (#:key outputs #:allow-other-keys)
- (let ((out (assoc-ref outputs "out")))
- (for-each delete-file (find-files out "config.log"))
- #t))))))
- (home-page "https://www.open-mpi.org")
- (synopsis "MPI-3 implementation")
- (description
- "The Open MPI Project is an MPI-3 implementation that is developed and
- 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.")
-
- (license license:bsd-2)))
- (define-public openmpi-c++
- (package/inherit openmpi
- (name "openmpi-c++")
- (outputs '("out"))
- (arguments
- (substitute-keyword-arguments (package-arguments openmpi)
- ((#:configure-flags flags)
- `(cons "--enable-mpi-cxx" ,flags))))
- (synopsis "C++ bindings for MPI")))
- (define-public java-openmpi
- (package/inherit openmpi
- (name "java-openmpi")
- (inputs
- `(("openmpi" ,openmpi)
- ,@(package-inputs openmpi)))
- (native-inputs
- `(("jdk" ,openjdk11 "jdk")
- ("zip" ,(@ (gnu packages compression) zip))
- ,@(package-native-inputs openmpi)))
- (outputs '("out"))
- (arguments
- `(#:modules ((guix build gnu-build-system)
- ((guix build ant-build-system) #:prefix ant:)
- (guix build utils))
- #:imported-modules ((guix build ant-build-system)
- (guix build syscalls)
- ,@%gnu-build-system-modules)
- ,@(substitute-keyword-arguments (package-arguments openmpi)
- ((#:configure-flags flags)
- `(cons "--enable-mpi-java" ,flags))
- ((#:make-flags flags ''())
- `(append '("-C" "ompi/mpi/java")
- ,flags))
- ((#:phases phases)
- `(modify-phases ,phases
-
-
-
-
- (add-after 'unpack 'set-JAVA_HOME
- (lambda* (#:key inputs #:allow-other-keys)
- (setenv "JAVA_HOME" (assoc-ref inputs "jdk"))
- #t))
- (add-after 'unpack 'link-with-existing-mpi-libraries
- (lambda* (#:key inputs #:allow-other-keys)
- (substitute* "ompi/mpi/java/c/Makefile.in"
- (("\\$\\(top_builddir\\)/ompi/lib@OMPI_LIBMPI_NAME@.la")
- (search-input-file inputs "/lib/libmpi.la")))))
- (add-after 'install 'strip-jar-timestamps
- (assoc-ref ant:%standard-phases 'strip-jar-timestamps)))))))
- (synopsis "Java bindings for MPI")))
- (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}.")))
- (define-public %openmpi-setup
- '(lambda _
-
-
-
- (setenv "OMPI_MCA_plm_rsh_agent" (which "false"))
-
-
- (setenv "OMPI_MCA_rmaps_base_mapping_policy" "core:OVERSUBSCRIBE")
-
-
-
-
-
-
-
- (setenv "UCX_LOG_LEVEL" "error")
- #t))
- (define-public python-mpi4py
- (package
- (name "python-mpi4py")
- (version "3.0.3")
- (source
- (origin
- (method url-fetch)
- (uri (pypi-uri "mpi4py" version))
- (sha256
- (base32 "07ssbhssv27rrjx1c5vd3vsr31vay5d8xcf4zh9yblcyidn72b81"))))
- (build-system python-build-system)
- (arguments
- `(#:phases
- (modify-phases %standard-phases
- (add-after 'build 'mpi-setup
- ,%openmpi-setup)
- (add-before 'check 'pre-check
- (lambda _
-
-
- (substitute* "test/test_spawn.py"
- (("unittest.skipMPI\\('openmpi\\(<3.0.0\\)'\\)")
- "unittest.skipMPI('openmpi')"))
- #t)))))
- (inputs
- (list openmpi))
- (home-page "https://bitbucket.org/mpi4py/mpi4py/")
- (synopsis "Python bindings for the Message Passing Interface standard")
- (description "MPI for Python (mpi4py) provides bindings of the Message
- Passing Interface (MPI) standard for the Python programming language, allowing
- any Python program to exploit multiple processors.
- mpi4py is constructed on top of the MPI-1/MPI-2 specification and provides an
- object oriented interface which closely follows MPI-2 C++ bindings. It
- supports point-to-point and collective communications of any picklable Python
- object as well as optimized communications of Python objects (such as NumPy
- arrays) that expose a buffer interface.")
- (license license:bsd-3)))
- (define-public mpich
- (package
- (name "mpich")
- (version "3.3.2")
- (source (origin
- (method url-fetch)
- (uri (string-append "http://www.mpich.org/static/downloads/"
- version "/mpich-" version ".tar.gz"))
- (sha256
- (base32
- "1farz5zfx4cd0c3a0wb9pgfypzw0xxql1j1294z1sxslga1ziyjb"))))
- (build-system gnu-build-system)
- (inputs
- `(,zlib
- (,hwloc-2 "lib")
- ,slurm
- ,@(if (and (not (%current-target-system))
- (member (%current-system) (package-supported-systems ucx)))
- (list ucx)
- '())))
- (native-inputs
- (list perl which gfortran))
- (outputs '("out" "debug"))
- (arguments
- `(#:configure-flags
- (list "--disable-silent-rules"
- "--enable-debuginfo"
-
-
-
- "--with-device=ch4:ucx"
- (string-append "--with-hwloc-prefix="
- (assoc-ref %build-inputs "hwloc"))
- ,@(if (assoc "ucx" (package-inputs this-package))
- `((string-append "--with-ucx="
- (assoc-ref %build-inputs "ucx")))
- '()))
- #:phases (modify-phases %standard-phases
- (add-after 'unpack 'patch-sources
- (lambda _
- (substitute* "./maint/gen_subcfg_m4"
- (("/usr/bin/env") (which "env")))
- (substitute* "src/glue/romio/all_romio_symbols"
- (("/usr/bin/env") (which "env")))
- (substitute* (find-files "." "buildiface")
- (("/usr/bin/env") (which "env")))
- (substitute* "maint/extracterrmsgs"
- (("/usr/bin/env") (which "env")))
- (substitute* (find-files "." "f77tof90")
- (("/usr/bin/env") (which "env")))
- (substitute* (find-files "." "\\.sh$")
- (("/bin/sh") (which "sh")))))
- (add-before 'configure 'fix-makefile
- (lambda _
-
-
-
- (substitute* "Makefile.in"
- (("^pmpi_convenience_libs = (.*) @hwloclib@ (.*)$" _
- before after)
- (string-append "pmpi_convenience_libs = "
- before " " after)))))
- (add-before 'configure 'define-gfortran-wrapper
- (lambda* (#:key inputs #:allow-other-keys)
-
-
-
-
-
- (mkdir-p ".gfortran-wrapper/bin")
- (call-with-output-file ".gfortran-wrapper/bin/gfortran"
- (lambda (port)
- (display (string-append "#!" (which "sh") "\n")
- port)
- (display
- (string-append "exec \"" (which "gfortran")
- "\" -fallow-argument-mismatch"
- " \"$@\"\n")
- port)
- (chmod port #o755)))
- (setenv "PATH"
- (string-append (getcwd) "/"
- ".gfortran-wrapper/bin:"
- (getenv "PATH"))))))))
- (home-page "https://www.mpich.org/")
- (synopsis "Implementation of the Message Passing Interface (MPI)")
- (description
- "MPICH is a high-performance and portable implementation of the Message
- Passing Interface (MPI) standard (MPI-1, MPI-2 and MPI-3). MPICH provides an
- MPI implementation that efficiently supports different computation and
- communication platforms including commodity clusters, high-speed networks (10
- Gigabit Ethernet, InfiniBand, Myrinet, Quadrics), and proprietary high-end
- computing systems (Blue Gene, Cray). It enables research in MPI through a
- modular framework for other derived implementations.")
- (license license:bsd-2)))
|