| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 | |
| 28 |
|
| 29 | (define-module (gnu packages mpi)
|
| 30 | #:use-module (guix gexp)
|
| 31 | #:use-module (guix packages)
|
| 32 | #:use-module ((guix licenses) #:prefix license:)
|
| 33 | #:use-module (guix download)
|
| 34 | #:use-module (guix git-download)
|
| 35 | #:use-module (guix utils)
|
| 36 | #:use-module (guix deprecation)
|
| 37 | #:use-module (guix build-system cmake)
|
| 38 | #:use-module (guix build-system gnu)
|
| 39 | #:use-module (guix build-system pyproject)
|
| 40 | #:use-module (gnu packages)
|
| 41 | #:use-module (gnu packages autotools)
|
| 42 | #:use-module (gnu packages base)
|
| 43 | #:use-module (gnu packages bash)
|
| 44 | #:use-module (gnu packages bison)
|
| 45 | #:use-module (gnu packages check)
|
| 46 | #:use-module (gnu packages compression)
|
| 47 | #:use-module (gnu packages documentation)
|
| 48 | #:use-module (gnu packages fabric-management)
|
| 49 | #:use-module (gnu packages compiler-tools)
|
| 50 | #:use-module (gnu packages gcc)
|
| 51 | #:use-module (gnu packages java)
|
| 52 | #:use-module (gnu packages libevent)
|
| 53 | #:use-module (gnu packages libunwind)
|
| 54 | #:use-module (gnu packages linux)
|
| 55 | #:use-module (gnu packages oneapi)
|
| 56 | #:use-module (gnu packages opencl)
|
| 57 | #:use-module (gnu packages pciutils)
|
| 58 | #:use-module (gnu packages profiling)
|
| 59 | #:use-module (gnu packages python)
|
| 60 | #:use-module (gnu packages xorg)
|
| 61 | #:use-module (gnu packages gtk)
|
| 62 | #:use-module (gnu packages xml)
|
| 63 | #:use-module (gnu packages perl)
|
| 64 | #:use-module (gnu packages ncurses)
|
| 65 | #:use-module (gnu packages parallel)
|
| 66 | #:use-module (gnu packages pkg-config)
|
| 67 | #:use-module (gnu packages python)
|
| 68 | #:use-module (gnu packages python-build)
|
| 69 | #:use-module (gnu packages python-xyz)
|
| 70 | #:use-module (gnu packages rocm)
|
| 71 | #:use-module (gnu packages rocm-tools)
|
| 72 | #:use-module (gnu packages ssh)
|
| 73 | #:use-module (gnu packages valgrind)
|
| 74 | #:use-module (gnu packages version-control)
|
| 75 | #:use-module (gnu packages xdisorg)
|
| 76 | #:use-module (srfi srfi-1)
|
| 77 | #:use-module (ice-9 match))
|
| 78 |
|
| 79 | (define-public hwloc
|
| 80 | (package
|
| 81 | (name "hwloc")
|
| 82 | (version "2.15.0")
|
| 83 | (source
|
| 84 | (origin
|
| 85 | (method git-fetch)
|
| 86 | (uri (git-reference
|
| 87 | (url "https://github.com/open-mpi/hwloc")
|
| 88 | (commit (string-append "hwloc-" version))))
|
| 89 | (file-name (git-file-name name version))
|
| 90 | (sha256
|
| 91 | (base32 "0zcxfpvcbq0awa39hl982lc91mij9pr6yfsz905hbpr9ln6d7591"))))
|
| 92 | (build-system gnu-build-system)
|
| 93 | (outputs '("out" |
| 94 | "lib" |
| 95 | "doc" |
| 96 | "debug"))
|
| 97 | (native-inputs
|
| 98 | (list autoconf automake libtool opencl-headers bash pkg-config))
|
| 99 | (inputs
|
| 100 | (append (if (%current-target-system)
|
| 101 | '() |
| 102 | (list libx11 cairo ncurses expat))
|
| 103 | (list opencl-icd-loader)))
|
| 104 | (propagated-inputs
|
| 105 | |
| 106 | |
| 107 | (list libpciaccess libxml2))
|
| 108 | (arguments
|
| 109 | (list
|
| 110 | #:configure-flags
|
| 111 | #~(list
|
| 112 | (string-append
|
| 113 | "--with-opencl=" #$(this-package-input "opencl-icd-loader"))
|
| 114 | "--localstatedir=/var")
|
| 115 | #:phases
|
| 116 | #~(modify-phases %standard-phases
|
| 117 | (add-before 'check 'skip-linux-libnuma-test
|
| 118 | (lambda _
|
| 119 | |
| 120 | |
| 121 | (substitute* "tests/hwloc/linux-libnuma.c"
|
| 122 | (("numa_available\\(\\)")
|
| 123 | "-1"))))
|
| 124 | (add-after 'install 'refine-libnuma
|
| 125 | |
| 126 | (lambda* (#:key inputs outputs #:allow-other-keys)
|
| 127 | (let ((out (assoc-ref outputs "lib"))
|
| 128 | (numa (assoc-ref inputs "numactl")))
|
| 129 | (substitute* (map (lambda (f) (string-append out "/" f))
|
| 130 | '("lib/pkgconfig/hwloc.pc" "lib/libhwloc.la"))
|
| 131 | (("-lnuma" lib)
|
| 132 | (string-append "-L" numa "/lib " lib))))))
|
| 133 | (add-after 'install 'avoid-circular-references
|
| 134 | (lambda* (#:key outputs #:allow-other-keys)
|
| 135 | (let ((lib (assoc-ref outputs "lib")))
|
| 136 | |
| 137 | |
| 138 | (substitute* (string-append lib "/lib/pkgconfig/hwloc.pc")
|
| 139 | (("^.*prefix=.*$")
|
| 140 | "")))))
|
| 141 | (add-after 'install 'move-man-pages
|
| 142 | (lambda _
|
| 143 | |
| 144 | (copy-recursively (string-append #$output "/share/man/man1")
|
| 145 | (string-append #$output:doc "/share/man/man1"))
|
| 146 | (copy-recursively (string-append #$output "/share/man/man7")
|
| 147 | (string-append #$output:doc "/share/man/man7"))
|
| 148 | (delete-file-recursively
|
| 149 | (string-append #$output "/share/man/man1"))
|
| 150 | (delete-file-recursively
|
| 151 | (string-append #$output "/share/man/man7"))))
|
| 152 | (add-before 'check 'skip-tests-that-require-/sys
|
| 153 | (lambda _
|
| 154 | |
| 155 | (setenv "HWLOC_TEST_GATHER_TOPOLOGY" "0")))
|
| 156 | (add-before 'check 'skip-test-that-fails-on-qemu
|
| 157 | (lambda _
|
| 158 | |
| 159 | |
| 160 | (substitute* "tests/hwloc/hwloc_get_last_cpu_location.c"
|
| 161 | (("hwloc_topology_init" all)
|
| 162 | (string-append "exit (77);\n" all))))))))
|
| 163 | (home-page "https://www.open-mpi.org/projects/hwloc/")
|
| 164 | (synopsis "Abstraction of hardware architectures")
|
| 165 | (description
|
| 166 | "hwloc provides a portable abstraction (across OS,
|
| 167 | versions, architectures, ...) of the hierarchical topology of modern
|
| 168 | architectures, including NUMA memory nodes, sockets, shared caches, cores and
|
| 169 | simultaneous multithreading. It also gathers various attributes such as cache
|
| 170 | and memory information. It primarily aims at helping high-performance
|
| 171 | computing applications with gathering information about the hardware so as to
|
| 172 | exploit it accordingly and efficiently.
|
| 173 |
|
| 174 | hwloc may display the topology in multiple convenient formats. It also offers
|
| 175 | a powerful programming interface to gather information about the hardware,
|
| 176 | bind processes, and much more.")
|
| 177 | (license license:bsd-3)))
|
| 178 |
|
| 179 | (define-public openmpi-4
|
| 180 | (package
|
| 181 | (name "openmpi")
|
| 182 | (version "4.1.6")
|
| 183 | (source
|
| 184 | (origin
|
| 185 | (method url-fetch)
|
| 186 | (uri (string-append "https://www.open-mpi.org/software/ompi/v"
|
| 187 | (version-major+minor version)
|
| 188 | "/downloads/openmpi-" version ".tar.bz2"))
|
| 189 | (sha256
|
| 190 | (base32 "05g4245v0pdqcyjmgn50519ry5v5q8ig26iinmiynvaihm29jh7p"))
|
| 191 | (patches (search-patches "openmpi-mtl-priorities.patch"))))
|
| 192 |
|
| 193 | (properties
|
| 194 | |
| 195 | `((release-monitoring-url
|
| 196 | . "https://www.open-mpi.org/software/ompi/current")))
|
| 197 |
|
| 198 | (build-system gnu-build-system)
|
| 199 | (inputs
|
| 200 | (let ((if-supported
|
| 201 | (lambda (package)
|
| 202 | (if (and (not (%current-target-system))
|
| 203 | (member (%current-system)
|
| 204 | (package-supported-systems package)))
|
| 205 | (list package)
|
| 206 | '()))))
|
| 207 | (append (list `(,hwloc "lib")
|
| 208 | gfortran
|
| 209 | libfabric-1 |
| 210 | libevent
|
| 211 | opensm
|
| 212 | openssh-sans-x)
|
| 213 | (if-supported psm)
|
| 214 | (if-supported psm2)
|
| 215 | (if-supported ucx)
|
| 216 | (if-supported valgrind/pinned)
|
| 217 | (list rdma-core
|
| 218 | slurm)))) |
| 219 | (native-inputs
|
| 220 | (list pkg-config perl))
|
| 221 | (outputs '("out" "debug"))
|
| 222 | (arguments
|
| 223 | (list
|
| 224 | #:configure-flags #~(list (string-append
|
| 225 | "CFLAGS=-g -O2"
|
| 226 | " -Wno-error=implicit-function-declaration"
|
| 227 | " -Wno-error=incompatible-pointer-types")
|
| 228 | "--enable-mpi-ext=affinity" |
| 229 | "--with-sge"
|
| 230 | "--disable-static"
|
| 231 |
|
| 232 | #$@(if (package? (this-package-input "valgrind"))
|
| 233 | #~("--enable-memchecker"
|
| 234 | "--with-valgrind")
|
| 235 | #~("--without-valgrind"))
|
| 236 |
|
| 237 | "--with-hwloc=external"
|
| 238 | "--with-libevent"
|
| 239 |
|
| 240 | |
| 241 | |
| 242 | "--enable-mpirun-prefix-by-default"
|
| 243 |
|
| 244 | |
| 245 | "--enable-openib-control-hdr-padding"
|
| 246 | "--enable-openib-dynamic-sl"
|
| 247 | "--enable-openib-udcm"
|
| 248 | "--enable-openib-rdmacm"
|
| 249 | "--enable-openib-rdmacm-ibaddr"
|
| 250 |
|
| 251 | |
| 252 | |
| 253 | |
| 254 | |
| 255 | "--with-pmix=internal"
|
| 256 |
|
| 257 | |
| 258 | |
| 259 | (string-append "--with-pmi="
|
| 260 | #$(this-package-input "slurm")))
|
| 261 | #:phases #~(modify-phases %standard-phases
|
| 262 | |
| 263 | (add-after 'unpack 'find-opensm-headers
|
| 264 | (lambda* (#:key inputs #:allow-other-keys)
|
| 265 | (setenv "C_INCLUDE_PATH"
|
| 266 | (search-input-directory inputs
|
| 267 | "/include/infiniband"))
|
| 268 | (setenv "CPLUS_INCLUDE_PATH"
|
| 269 | (search-input-directory inputs
|
| 270 | "/include/infiniband"))))
|
| 271 | (add-before 'build 'remove-absolute
|
| 272 | (lambda _
|
| 273 | |
| 274 | |
| 275 | |
| 276 | |
| 277 | |
| 278 | (substitute* '("orte/tools/orte-info/param.c"
|
| 279 | "oshmem/tools/oshmem_info/param.c"
|
| 280 | "ompi/tools/ompi_info/param.c")
|
| 281 | (("_ABSOLUTE") ""))
|
| 282 | |
| 283 | (substitute*
|
| 284 | '("./ompi/mca/io/romio321/src/io_romio321_component.c")
|
| 285 | (("MCA_io_romio321_COMPLETE_CONFIGURE_FLAGS")
|
| 286 | "\"[elided to reduce closure]\""))))
|
| 287 | (add-before 'build 'ssh-absolute-path
|
| 288 | (lambda* (#:key inputs #:allow-other-keys)
|
| 289 | |
| 290 | (substitute* "orte/mca/plm/rsh/plm_rsh_component.c"
|
| 291 | (("mca_plm_rsh_component.agent = \"ssh : rsh\";")
|
| 292 | (format #f "mca_plm_rsh_component.agent = \"~a : rsh\";"
|
| 293 | (search-input-file inputs
|
| 294 | "bin/ssh"))))))
|
| 295 | (add-before 'build 'scrub-timestamps |
| 296 | (lambda _
|
| 297 | (substitute* '("ompi/tools/ompi_info/param.c"
|
| 298 | "orte/tools/orte-info/param.c"
|
| 299 | "oshmem/tools/oshmem_info/param.c")
|
| 300 | ((".*(Built|Configured) on.*") ""))))
|
| 301 | (add-after 'install 'remove-logs |
| 302 | (lambda* (#:key outputs #:allow-other-keys)
|
| 303 | (let ((out (assoc-ref outputs "out")))
|
| 304 | (for-each delete-file (find-files out "config.log"))))))))
|
| 305 | (home-page "https://www.open-mpi.org")
|
| 306 | (synopsis "MPI-3 implementation")
|
| 307 | (description
|
| 308 | "The Open MPI Project is an MPI-3 implementation that is developed and
|
| 309 | maintained by a consortium of academic, research, and industry partners. Open
|
| 310 | MPI is therefore able to combine the expertise, technologies, and resources
|
| 311 | from all across the High Performance Computing community in order to build the
|
| 312 | best MPI library available. Open MPI offers advantages for system and
|
| 313 | software vendors, application developers and computer science researchers.")
|
| 314 | |
| 315 | (license license:bsd-2)))
|
| 316 |
|
| 317 | (define-public openmpi openmpi-4)
|
| 318 |
|
| 319 | (define-public openmpi-5
|
| 320 | (package
|
| 321 | (inherit openmpi)
|
| 322 | (version "5.0.10")
|
| 323 | (source
|
| 324 | (origin
|
| 325 | (method url-fetch)
|
| 326 | (uri (string-append "https://www.open-mpi.org/software/ompi/v"
|
| 327 | (version-major+minor version)
|
| 328 | "/downloads/openmpi-" version ".tar.bz2"))
|
| 329 | (modules '((guix build utils)))
|
| 330 | (snippet
|
| 331 | '(begin
|
| 332 | |
| 333 | |
| 334 | (delete-all-but "3rd-party" "treematch" "Makefile.in" "Makefile.am")
|
| 335 | |
| 336 | |
| 337 | (delete-file-recursively "docs/html")))
|
| 338 | (sha256
|
| 339 | (base32 "1ijc6zbxb49a7dvfs59h74lis3vb5hc1v95qpjyxxr8qq97wrkha"))))
|
| 340 |
|
| 341 | (inputs (modify-inputs inputs
|
| 342 | |
| 343 | |
| 344 | (delete "slurm")
|
| 345 | |
| 346 | (replace "libfabric" libfabric)
|
| 347 | (append openpmix) |
| 348 | (append prrte))) |
| 349 | (native-inputs (modify-inputs native-inputs
|
| 350 | (append python)))
|
| 351 |
|
| 352 | (outputs '("out" "debug"))
|
| 353 | (arguments
|
| 354 | (list #:configure-flags
|
| 355 | #~(list #$(string-append
|
| 356 | "CFLAGS=-g -O2"
|
| 357 | " -Wno-error=incompatible-pointer-types")
|
| 358 | "--enable-mpi-ext=affinity" |
| 359 | "--with-sge"
|
| 360 | "--disable-static"
|
| 361 |
|
| 362 | #$@(if (this-package-input "valgrind")
|
| 363 | #~("--enable-memchecker"
|
| 364 | "--with-valgrind")
|
| 365 | #~("--without-valgrind"))
|
| 366 |
|
| 367 | "--with-hwloc=external"
|
| 368 | "--with-libevent"
|
| 369 |
|
| 370 | |
| 371 | |
| 372 | "--enable-prte-prefix-by-default"
|
| 373 |
|
| 374 | |
| 375 | |
| 376 | |
| 377 | (string-append "--with-pmix=" #$(this-package-input "openpmix"))
|
| 378 | (string-append "--with-prrte=" #$(this-package-input "prrte"))
|
| 379 |
|
| 380 | |
| 381 | |
| 382 | |
| 383 | #$@(if (this-package-input "psm2")
|
| 384 | #~((string-append "--with-psm2=" #$(this-package-input "psm2")))
|
| 385 | #~())
|
| 386 |
|
| 387 | |
| 388 | |
| 389 | #$@(if (this-package-input "ucx")
|
| 390 | #~((string-append "--with-ucx=" #$(this-package-input "ucx")))
|
| 391 | #~()))
|
| 392 |
|
| 393 | #:phases
|
| 394 | #~(modify-phases %standard-phases
|
| 395 | (add-before 'build 'remove-absolute
|
| 396 | (lambda _
|
| 397 | |
| 398 | |
| 399 | |
| 400 | |
| 401 | |
| 402 | (substitute* '("oshmem/tools/oshmem_info/param.c"
|
| 403 | "ompi/tools/ompi_info/param.c")
|
| 404 | (("_ABSOLUTE") "")))))
|
| 405 |
|
| 406 | #:disallowed-references (list (canonical-package gcc))))))
|
| 407 |
|
| 408 | |
| 409 | |
| 410 | |
| 411 | |
| 412 | (define-public openmpi-rocm
|
| 413 | (package/inherit openmpi-5
|
| 414 | (name "openmpi-rocm")
|
| 415 | (arguments
|
| 416 | (substitute-keyword-arguments arguments
|
| 417 | ((#:configure-flags flags '())
|
| 418 | #~(cons* (string-append "--with-rocm="
|
| 419 | #$(this-package-input "rocm-hip-runtime"))
|
| 420 | #$flags))))
|
| 421 | (inputs (modify-inputs (package-inputs openmpi-5)
|
| 422 | |
| 423 | |
| 424 | (append rocm-hip-runtime)
|
| 425 | (replace "ucx" ucx-rocm)
|
| 426 | (replace "libfabric" libfabric-rocm)))
|
| 427 | (synopsis "MPI-3 implementation (with ROCm support)")))
|
| 428 |
|
| 429 | (define-public openmpi-c++
|
| 430 | (package/inherit openmpi
|
| 431 | (name "openmpi-c++")
|
| 432 | (outputs '("out"))
|
| 433 | (arguments
|
| 434 | (substitute-keyword-arguments arguments
|
| 435 | ((#:configure-flags flags)
|
| 436 | #~(cons "--enable-mpi-cxx" #$flags))))
|
| 437 | (synopsis "C++ bindings for MPI")))
|
| 438 |
|
| 439 | |
| 440 | (define-public java-openmpi
|
| 441 | (package/inherit openmpi
|
| 442 | (name "java-openmpi")
|
| 443 | (inputs
|
| 444 | `(("openmpi" ,openmpi)
|
| 445 | ,@(package-inputs openmpi)))
|
| 446 | (native-inputs
|
| 447 | `(("jdk" ,openjdk11 "jdk")
|
| 448 | ("zip" ,(@ (gnu packages compression) zip))
|
| 449 | ,@(package-native-inputs openmpi)))
|
| 450 | (outputs '("out"))
|
| 451 | (arguments
|
| 452 | (cons*
|
| 453 | #:modules '((guix build gnu-build-system)
|
| 454 | ((guix build ant-build-system) #:prefix ant:)
|
| 455 | (guix build utils))
|
| 456 | #:imported-modules `((guix build ant-build-system)
|
| 457 | ,@%default-gnu-imported-modules)
|
| 458 | (substitute-keyword-arguments arguments
|
| 459 | ((#:configure-flags flags)
|
| 460 | #~(cons "--enable-mpi-java" #$flags))
|
| 461 | ((#:make-flags flags ''())
|
| 462 | #~(append '("-C" "ompi/mpi/java")
|
| 463 | #$flags))
|
| 464 | ((#:phases phases)
|
| 465 | #~(modify-phases #$phases
|
| 466 | |
| 467 | |
| 468 | |
| 469 | |
| 470 | (add-after 'unpack 'set-JAVA_HOME
|
| 471 | (lambda* (#:key inputs #:allow-other-keys)
|
| 472 | (setenv "JAVA_HOME" (assoc-ref inputs "jdk"))
|
| 473 | #t))
|
| 474 | (add-after 'unpack 'link-with-existing-mpi-libraries
|
| 475 | (lambda* (#:key inputs #:allow-other-keys)
|
| 476 | (substitute* "ompi/mpi/java/c/Makefile.in"
|
| 477 | (("\\$\\(top_builddir\\)/ompi/lib@[email protected]")
|
| 478 | (search-input-file inputs "/lib/libmpi.la")))))
|
| 479 | (add-after 'install 'strip-jar-timestamps
|
| 480 | (assoc-ref ant:%standard-phases 'strip-jar-timestamps)))))))
|
| 481 | (synopsis "Java bindings for MPI")))
|
| 482 |
|
| 483 | (define-public openmpi-thread-multiple
|
| 484 | (package/inherit openmpi
|
| 485 | (name "openmpi-thread-multiple")
|
| 486 | (arguments
|
| 487 | (substitute-keyword-arguments arguments
|
| 488 | ((#:configure-flags flags)
|
| 489 | #~(cons "--enable-mpi-thread-multiple" #$flags))))
|
| 490 | (description "This version of Open@tie{}MPI has an implementation of
|
| 491 | @code{MPI_Init_thread} that provides @code{MPI_THREAD_MULTIPLE}. This won't
|
| 492 | work correctly with all transports (such as @code{openib}), and the
|
| 493 | performance is generally worse than the vanilla @code{openmpi} package, which
|
| 494 | only provides @code{MPI_THREAD_FUNNELED}.")))
|
| 495 |
|
| 496 | |
| 497 | (define-public %openmpi-setup
|
| 498 | '(lambda _
|
| 499 | |
| 500 | |
| 501 | |
| 502 | (setenv "OMPI_MCA_plm_rsh_agent" (which "false"))
|
| 503 | |
| 504 | |
| 505 | (setenv "OMPI_MCA_rmaps_base_mapping_policy" "core:OVERSUBSCRIBE")
|
| 506 |
|
| 507 | |
| 508 | |
| 509 | |
| 510 | |
| 511 | |
| 512 | |
| 513 | |
| 514 | (setenv "UCX_LOG_LEVEL" "error")
|
| 515 |
|
| 516 | |
| 517 | |
| 518 | |
| 519 | |
| 520 | |
| 521 | |
| 522 | |
| 523 | (setenv "HWLOC_SYNTHETIC" "4")
|
| 524 | #t))
|
| 525 |
|
| 526 | (define-public python-mpi4py
|
| 527 | (package
|
| 528 | (name "python-mpi4py")
|
| 529 | (version "4.1.0")
|
| 530 | (source
|
| 531 | (origin
|
| 532 | (method git-fetch)
|
| 533 | (uri (git-reference
|
| 534 | (url "https://github.com/mpi4py/mpi4py")
|
| 535 | (commit version)))
|
| 536 | (file-name (git-file-name name version))
|
| 537 | (sha256
|
| 538 | (base32 "1r4n2d3nacpa6sq18jp0xk4a81ha0iipgvlsdv0bhfmdvgpv2vqy"))))
|
| 539 | (build-system pyproject-build-system)
|
| 540 | (arguments
|
| 541 | (list
|
| 542 | #:test-flags
|
| 543 | #~(list |
| 544 | "--ignore=test/test_spawn.py"
|
| 545 | "--ignore=test/test_util_pool.py"
|
| 546 | "--ignore=demo/futures/test_futures.py")
|
| 547 | #:phases
|
| 548 | #~(modify-phases %standard-phases
|
| 549 | (add-after 'build 'mpi-setup #$%openmpi-setup)
|
| 550 | (add-before 'check 'pre-check
|
| 551 | (lambda _
|
| 552 | |
| 553 | |
| 554 | (substitute* "test/test_spawn.py"
|
| 555 | (("unittest.skipMPI\\('openmpi\\(<3.0.0\\)'\\)")
|
| 556 | "unittest.skipMPI('openmpi')"))))
|
| 557 | (replace 'check
|
| 558 | (lambda* (#:key tests? test-flags #:allow-other-keys)
|
| 559 | (if tests?
|
| 560 | (apply invoke "mpiexec" "pytest" "-vv" test-flags)
|
| 561 | (format #t "test suite not run~%")))))))
|
| 562 | (native-inputs (list python-cython python-pytest python-setuptools))
|
| 563 | (inputs (list openmpi))
|
| 564 | (properties '((updater-extra-inputs "openmpi")))
|
| 565 | (home-page "https://github.com/mpi4py/mpi4py")
|
| 566 | (synopsis "Python bindings for the Message Passing Interface standard")
|
| 567 | (description
|
| 568 | "MPI for Python (mpi4py) provides bindings of the Message Passing
|
| 569 | Interface (MPI) standard for the Python programming language, allowing any
|
| 570 | Python program to exploit multiple processors.
|
| 571 |
|
| 572 | mpi4py is constructed on top of the MPI-1/MPI-2 specification and provides an
|
| 573 | object oriented interface which closely follows MPI-2 C++ bindings. It
|
| 574 | supports point-to-point and collective communications of any picklable Python
|
| 575 | object as well as optimized communications of Python objects (such as NumPy
|
| 576 | arrays) that expose a buffer interface.")
|
| 577 | (license license:bsd-3)))
|
| 578 |
|
| 579 | (define-public mpich
|
| 580 | (package
|
| 581 | (name "mpich")
|
| 582 | (version "4.3.0")
|
| 583 | (source (origin
|
| 584 | (method url-fetch)
|
| 585 | (uri (string-append "http://www.mpich.org/static/downloads/"
|
| 586 | version "/mpich-" version ".tar.gz"))
|
| 587 | (sha256
|
| 588 | (base32
|
| 589 | "0qyc3c99dzx88y8gzadh4inmmvxms9r61xskrjwwm0xdhhli612y"))))
|
| 590 | (build-system gnu-build-system)
|
| 591 | (inputs
|
| 592 | `(,zlib
|
| 593 | (,hwloc "lib")
|
| 594 | ,slurm
|
| 595 | ,@(if (and (not (%current-target-system))
|
| 596 | (member (%current-system) (package-supported-systems ucx)))
|
| 597 | (list ucx)
|
| 598 | '())))
|
| 599 | (native-inputs
|
| 600 | (list perl which gfortran python-minimal))
|
| 601 | (outputs '("out" "debug"))
|
| 602 | (arguments
|
| 603 | `(#:configure-flags
|
| 604 | (list "--disable-silent-rules" |
| 605 | "--enable-debuginfo"
|
| 606 |
|
| 607 | (string-append "--with-hwloc-prefix="
|
| 608 | (assoc-ref %build-inputs "hwloc"))
|
| 609 |
|
| 610 | ,@(if (assoc "ucx" (package-inputs this-package))
|
| 611 | `((string-append "--with-ucx="
|
| 612 | (assoc-ref %build-inputs "ucx"))
|
| 613 |
|
| 614 | |
| 615 | "--with-device=ch4:ucx")
|
| 616 | '( |
| 617 | "--with-device=ch4")))
|
| 618 |
|
| 619 | #:phases (modify-phases %standard-phases
|
| 620 | (add-after 'unpack 'patch-sources
|
| 621 | (lambda _
|
| 622 | (substitute* "./maint/gen_subcfg_m4"
|
| 623 | (("/usr/bin/env") (which "env")))
|
| 624 | (substitute* "src/glue/romio/all_romio_symbols"
|
| 625 | (("/usr/bin/env") (which "env")))
|
| 626 | (substitute* (find-files "." "buildiface")
|
| 627 | (("/usr/bin/env") (which "env")))
|
| 628 | (substitute* "maint/extracterrmsgs"
|
| 629 | (("/usr/bin/env") (which "env")))
|
| 630 | (substitute* (find-files "." "f77tof90")
|
| 631 | (("/usr/bin/env") (which "env")))
|
| 632 | (substitute* (find-files "." "\\.sh$")
|
| 633 | (("/bin/sh") (which "sh")))))
|
| 634 | |
| 635 | |
| 636 | (delete 'check)
|
| 637 | (add-after 'install 'post-install-check
|
| 638 | (assoc-ref %standard-phases 'check))
|
| 639 | (add-before 'configure 'fix-makefile
|
| 640 | (lambda _
|
| 641 | |
| 642 | |
| 643 | |
| 644 | (substitute* "Makefile.in"
|
| 645 | (("^pmpi_convenience_libs = (.*) @hwloclib@ (.*)$" _
|
| 646 | before after)
|
| 647 | (string-append "pmpi_convenience_libs = "
|
| 648 | before " " after)))))
|
| 649 | (add-before 'configure 'define-gfortran-wrapper
|
| 650 | (lambda* (#:key inputs #:allow-other-keys)
|
| 651 | |
| 652 | |
| 653 | |
| 654 | |
| 655 | |
| 656 | (mkdir-p ".gfortran-wrapper/bin")
|
| 657 | (call-with-output-file ".gfortran-wrapper/bin/gfortran"
|
| 658 | (lambda (port)
|
| 659 | (display (string-append "#!" (which "sh") "\n")
|
| 660 | port)
|
| 661 | (display
|
| 662 | (string-append "exec \"" (which "gfortran")
|
| 663 | "\" -fallow-argument-mismatch"
|
| 664 | " \"$@\"\n")
|
| 665 | port)
|
| 666 | (chmod port #o755)))
|
| 667 |
|
| 668 | (setenv "PATH"
|
| 669 | (string-append (getcwd) "/"
|
| 670 | ".gfortran-wrapper/bin:"
|
| 671 | (getenv "PATH"))))))))
|
| 672 | (home-page "https://www.mpich.org/")
|
| 673 | (synopsis "Implementation of the Message Passing Interface (MPI)")
|
| 674 | (description
|
| 675 | "MPICH is a high-performance and portable implementation of the Message
|
| 676 | Passing Interface (MPI) standard (MPI-1, MPI-2 and MPI-3). MPICH provides an
|
| 677 | MPI implementation that efficiently supports different computation and
|
| 678 | communication platforms including commodity clusters, high-speed networks (10
|
| 679 | Gigabit Ethernet, InfiniBand, Myrinet, Quadrics), and proprietary high-end
|
| 680 | computing systems (Blue Gene, Cray). It enables research in MPI through a
|
| 681 | modular framework for other derived implementations.")
|
| 682 | (license license:bsd-2)))
|
| 683 |
|
| 684 | (define-public mpich-ofi
|
| 685 | (package/inherit mpich
|
| 686 | (name "mpich-ofi")
|
| 687 | (inputs (modify-inputs inputs
|
| 688 | (delete ucx)
|
| 689 | (append libfabric)
|
| 690 | (append rdma-core)
|
| 691 | (append psm2)))
|
| 692 | (arguments
|
| 693 | (substitute-keyword-arguments arguments
|
| 694 | ((#:configure-flags flags)
|
| 695 | #~(list "--disable-silent-rules" |
| 696 | "--enable-debuginfo"
|
| 697 | "--with-device=ch4:ofi"
|
| 698 |
|
| 699 | (string-append "--with-hwloc-prefix="
|
| 700 | #$(this-package-input "hwloc"))
|
| 701 |
|
| 702 | (string-append "--with-libfabric="
|
| 703 | #$(this-package-input "libfabric"))))
|
| 704 | ((#:phases phases
|
| 705 | '%standard-phases)
|
| 706 | phases)))
|
| 707 | (synopsis "Implementation of the Message Passing Interface (MPI) for OmniPath")))
|
| 708 |
|
| 709 | (define-public gotcha
|
| 710 | (package
|
| 711 | (name "gotcha")
|
| 712 | (version "1.0.8")
|
| 713 | (source
|
| 714 | (origin
|
| 715 | (method git-fetch)
|
| 716 | (uri (git-reference
|
| 717 | (url "https://github.com/LLNL/GOTCHA")
|
| 718 | (commit version)))
|
| 719 | (file-name (git-file-name name version))
|
| 720 | (sha256
|
| 721 | (base32 "172h70x7mpyik2rbqc4zynfi7kpjfcxpazcwnjnm3d9wsmlwb1z5"))))
|
| 722 | (build-system cmake-build-system)
|
| 723 | (native-inputs
|
| 724 | |
| 725 | |
| 726 | (list git
|
| 727 | check))
|
| 728 | (arguments
|
| 729 | (list #:configure-flags #~'("-DGOTCHA_ENABLE_TESTS=on"
|
| 730 | "-DDEPENDENCIES_PREINSTALLED=true")))
|
| 731 | (home-page "https://github.com/LLNL/GOTCHA")
|
| 732 | (synopsis "Wrapping function calls in shared libraries")
|
| 733 | (description
|
| 734 | "Gotcha is a library that wraps functions. Tools can use gotcha to
|
| 735 | install hooks into other libraries, for example putting a wrapper function
|
| 736 | around libc's malloc. It is similar to @code{LD_PRELOAD}, but operates via a
|
| 737 | programmable API.")
|
| 738 | |
| 739 | (license license:lgpl2.1)))
|
| 740 |
|
| 741 | (define (make-scorep mpi)
|
| 742 | (package
|
| 743 | (name (string-append "scorep-" (package-name mpi)))
|
| 744 | (version "9.0")
|
| 745 | (source (origin
|
| 746 | (method url-fetch)
|
| 747 | (uri (string-append
|
| 748 | "https://perftools.pages.jsc.fz-juelich.de/cicd/scorep/tags/"
|
| 749 | "scorep-" version "/scorep-" version ".tar.gz"))
|
| 750 | (sha256
|
| 751 | (base32
|
| 752 | "15q93rc8wblbzqgh99rqzyq6fdp88mi6yziww05c6cbgrjs5s2jx"))
|
| 753 | (modules '((guix build utils)))
|
| 754 | (snippet
|
| 755 | |
| 756 | '(begin
|
| 757 | (for-each delete-file-recursively
|
| 758 | '("vendor/otf2" "vendor/opari2"
|
| 759 | "vendor/cubelib" "vendor/cubew"))))))
|
| 760 | (build-system gnu-build-system)
|
| 761 | (inputs
|
| 762 | (list mpi
|
| 763 | papi
|
| 764 | opari2
|
| 765 | libunwind
|
| 766 | otf2
|
| 767 | cubelib
|
| 768 | cubew
|
| 769 | gotcha
|
| 770 | libbfd
|
| 771 | libiberty
|
| 772 | openmpi
|
| 773 | zlib))
|
| 774 | (native-inputs
|
| 775 | (list gfortran
|
| 776 | flex
|
| 777 | bison
|
| 778 | python
|
| 779 | doxygen
|
| 780 | which))
|
| 781 | (arguments
|
| 782 | (list
|
| 783 | #:configure-flags
|
| 784 | #~(list "--enable-shared" "--disable-static"
|
| 785 | "MPI_LIBS=-lmpi" "SHMEM_LIBS=-loshmem"
|
| 786 | (string-append "--with-cubelib="
|
| 787 | #$(this-package-input "cubelib"))
|
| 788 | (string-append "--with-cubew="
|
| 789 | #$(this-package-input "cubew"))
|
| 790 | (string-append "--with-libbfd="
|
| 791 | #$(this-package-input "libbfd"))
|
| 792 | (string-append "--with-otf2="
|
| 793 | #$(this-package-input "otf2"))
|
| 794 | (string-append "--with-opari2="
|
| 795 | #$(this-package-input "opari2")))
|
| 796 | #:parallel-tests? #f
|
| 797 | #:phases
|
| 798 | #~(modify-phases %standard-phases
|
| 799 | (add-after 'install 'licence
|
| 800 | (lambda* (#:key outputs #:allow-other-keys)
|
| 801 | (let ((doc (string-append (assoc-ref outputs "out")
|
| 802 | "/share/doc/scorep")))
|
| 803 | (install-file "COPYING" doc)))))))
|
| 804 | (home-page "https://www.vi-hps.org/projects/score-p/")
|
| 805 | (synopsis "Performance measurement infrastructure for parallel code")
|
| 806 | (description
|
| 807 | "The Score-P (Scalable Performance Measurement Infrastructure for
|
| 808 | Parallel Codes) measurement infrastructure is a scalable and easy-to-use tool
|
| 809 | suite for profiling, event trace recording, and online analysis of
|
| 810 | high-performance computing (HPC) applications.")
|
| 811 | (license license:cpl1.0)))
|
| 812 |
|
| 813 | (define-public scorep-openmpi (make-scorep openmpi))
|