all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#27905] changes for openmpi
@ 2017-08-01 12:54 Dave Love
  2017-08-21 15:12 ` Ludovic Courtès
  0 siblings, 1 reply; 10+ messages in thread
From: Dave Love @ 2017-08-01 12:54 UTC (permalink / raw)
  To: 27905

[-- Attachment #1: Type: text/plain, Size: 1688 bytes --]

Here's a series with suggestions for openmpi.  I hope the log messages
are sufficiently explanatory, otherwise I can comment.  The hwloc and
valgrind changes are in line with what I'm used to using with RHEL and
Debian packaging.  (I know you won't particularly want to follow them,
but they make sense from the point of view of a user.)

I think the last one will need to be used for gfortran-specific
variants, as suggested on -devel.  That will take the closure back up
somewhat, but what I get now is:

  store item                                                       total    self
  /gnu/store/la6mj9kh7fwws233955wyp80x39ag88w-openmpi-1.10.7         134.1     9.7   7.2%
  /gnu/store/b8ni7680lh6j8z26dam7ki9z6f9y6pnz-hwloc-1.11.7-nogui      89.9     2.9   2.1%
  /gnu/store/h7mx27bl0wynlz8vjszzykqqldccfwm5-ncurses-6.0             74.3     5.7   4.2%
  /gnu/store/w1mrskd2ddgvkr727r9241g8dlkf0rlf-gfortran-5.4.0-lib      73.0    34.5  25.7%
  /gnu/store/lsidb1rk8z24c516pqw99anm57cpm8r1-numactl-2.0.11          68.9     0.3   0.2%
  /gnu/store/4vdik5cc02yh2hypwnwi6n6799j6srgn-libpciaccess-0.13.5     68.7     0.1   0.1%
  /gnu/store/dhc2iy059hi91fk55dcv79z09kp6500y-gcc-5.4.0-lib           68.6    30.1  22.4%
  /gnu/store/k7029k5va68lkapbzcycdzj7m5bjb4b8-bash-4.4.12             50.9     5.4   4.1%
  /gnu/store/hvyk1qyph1hihfmym1w271ygp84adb0v-readline-7.0            45.5     1.3   1.0%
  /gnu/store/q1x4v3x8v2g59d244hl7k0i1n4h83c9a-ncurses-6.0             44.2     5.7   4.2%
  /gnu/store/rmjlycdgiq8pfy5hfi42qhw3k7p6kdav-glibc-2.25              38.5    37.1  27.7%
  /gnu/store/02426nwiy32cscm4h83729vn5ws1gs2i-bash-static-4.4.12       1.4     1.4   1.1%
  total: 134.1 MiB


[-- Attachment #2: 0002-gnu-Add-openmpi-thread-multiple-and-modify-openmpi-a.patch --]
[-- Type: text/x-diff, Size: 1781 bytes --]

From 9f6330bcc336eae6aedc78f56c1ebbbf30ae0b2d Mon Sep 17 00:00:00 2001
From: Dave Love <fx@gnu.org>
Date: Mon, 31 Jul 2017 14:54:29 +0100
Subject: [PATCH 2/8] gnu: Add openmpi-thread-multiple and modify openmpi
 accordingly.

thread-multiple support hurts performance even if it's not used.

* gnu/packages/mpi.scm (openmpi)[arguments]: Don't enable thread-multiple.
---
 gnu/packages/mpi.scm | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/mpi.scm b/gnu/packages/mpi.scm
index 968eb8870..aa0b78237 100644
--- a/gnu/packages/mpi.scm
+++ b/gnu/packages/mpi.scm
@@ -133,7 +133,6 @@ bind processes, and much more.")
     (arguments
      `(#:configure-flags `("--enable-static"
 
-                           "--enable-mpi-thread-multiple"
                            "--enable-builtin-atomics"
 
                            "--enable-mpi-ext=all"
@@ -183,2 +182,18 @@ software vendors, application developers and computer science researchers.")
     ;; See file://LICENSE
     (license bsd-2)))
+
+(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 (string-append (package-description openmpi)
+                                "\
+
+This version has an implementation of `MPI_Init_thread' that provides
+‘MPI_THREAD_MULTIPLE’.  This won't work correctly with all transports (e.g.
+openib), and the performance is generally worse than the vanilla openmpi
+package, which only provides ‘MPI_THREAD_FUNNELED’."))))

-- 
2.11.0


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0003-gnu-openmpi-Remove-static-output.patch --]
[-- Type: text/x-diff, Size: 2533 bytes --]

From aab1baa5b90088c7d72366c669e47e273bbd9084 Mon Sep 17 00:00:00 2001
From: Dave Love <fx@gnu.org>
Date: Mon, 31 Jul 2017 14:57:21 +0100
Subject: [PATCH 3/8] gnu: openmpi: Remove "static" output.

--enable-static removes dynamically-loaded MCA components.

* gnu/packages/mpi.scm (openmpi)[outputs]: Remove field.
[arguments]: Don't configure with --enable-static; remove
'move-static-libraries' phase.
---
 gnu/packages/mpi.scm | 19 +------------------
 1 file changed, 1 insertion(+), 18 deletions(-)

diff --git a/gnu/packages/mpi.scm b/gnu/packages/mpi.scm
index aa0b78237..e166d23d8 100644
--- a/gnu/packages/mpi.scm
+++ b/gnu/packages/mpi.scm
@@ -122,7 +122,6 @@ bind processes, and much more.")
        (base32
         "142s1vny9gllkq336yafxayjgcirj2jv0ddabj879jgya7hyr2d0"))))
     (build-system gnu-build-system)
-    (outputs '("out" "static"))
     (inputs
      `(("hwloc" ,hwloc "lib")
        ("gfortran" ,gfortran)
@@ -131,9 +130,7 @@ bind processes, and much more.")
      `(("pkg-config" ,pkg-config)
        ("perl" ,perl)))
     (arguments
-     `(#:configure-flags `("--enable-static"
-
-                           "--enable-builtin-atomics"
+     `(#:configure-flags `("--enable-builtin-atomics"
 
                            "--enable-mpi-ext=all"
                            "--with-devel-headers"
@@ -155,20 +152,6 @@ bind processes, and much more.")
                     (lambda* (#:key outputs #:allow-other-keys)
                       (let ((out (assoc-ref outputs "out")))
                         (for-each delete-file (find-files out "config.log"))
-                        #t)))
-                  (add-after 'install 'move-static-libraries
-                    (lambda* (#:key outputs #:allow-other-keys)
-                      ;; Move 19 MiB of static libraries to 'static'.
-                      (let* ((out    (assoc-ref outputs "out"))
-                             (static (assoc-ref outputs "static"))
-                             (lib    (string-append out "/lib"))
-                             (slib   (string-append static "/lib")))
-                        (mkdir-p slib)
-                        (for-each (lambda (file)
-                                    (rename-file
-                                     file
-                                     (string-append slib "/" (basename file))))
-                                  (find-files lib "\\.a$"))
                         #t))))))
     (home-page "http://www.open-mpi.org")
     (synopsis "MPI-3 implementation")
-- 
2.11.0


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #4: 0004-gnu-hwloc-Replace-lib-output-with-nogui-containing-a.patch --]
[-- Type: text/x-diff, Size: 5082 bytes --]

From 67a59e734dd451d1e64d450dcebeb23d60996f3e Mon Sep 17 00:00:00 2001
From: Dave Love <dave.love@manchester.ac.uk>
Date: Mon, 31 Jul 2017 14:58:39 +0100
Subject: [PATCH] gnu: hwloc: Replace "lib" output with "nogui", containing 
 all but lstopo.

A compute node typically wants the non-GUI programs available, which still
have a small closure.

* mpi.scm (hwloc)[outputs]: Replace lib with nogui.
(hwloc)[arguments]: Change configure --prefix; use "nogui" output,
not "lib"; populate "all" output.
(openmpi)[inputs]: Use hwloc-nogui.
---
 gnu/packages/mpi.scm      | 44 ++++++++++++++++++++++++++++++--------------
 gnu/packages/parallel.scm |  2 +-
 2 files changed, 31 insertions(+), 15 deletions(-)

diff --git a/gnu/packages/mpi.scm b/gnu/packages/mpi.scm
index 385f9985a..66ffd7bdd 100644
--- a/gnu/packages/mpi.scm
+++ b/gnu/packages/mpi.scm
@@ -39,6 +39,7 @@
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages valgrind))
 
+;; Fixme: Replace hwloc-dump-hwdata.service with shepherd equivalent
 (define-public hwloc
   (package
     (name "hwloc")
@@ -53,7 +54,7 @@
                 "0acph1mf7588hfx8ds26ncr6nw5fd9x92adm11fwin7f93i10sdb"))))
     (build-system gnu-build-system)
     (outputs '("out"           ;'lstopo' & co., depends on Cairo, libx11, etc.
-               "lib"           ;small closure
+               "nogui"         ;small closure
                "debug"))
     (inputs
      `(("libx11" ,libx11)
@@ -71,27 +72,42 @@
     (native-inputs
      `(("pkg-config" ,pkg-config)))
     (arguments
-     `(#:configure-flags '("--localstatedir=/var")
+     `(#:configure-flags (list "--localstatedir=/var"
+                               (string-append "--prefix="
+                                              (assoc-ref %outputs "nogui")))
        #:phases
        (modify-phases %standard-phases
          (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))
+             (let ((out  (assoc-ref outputs "out"))
+                   (numa (assoc-ref inputs "numactl"))
+                   (nogui (assoc-ref outputs "nogui")))
+               (substitute* (map (lambda (f) (string-append nogui "/" f))
                                  '("lib/pkgconfig/hwloc.pc" "lib/libhwloc.la"))
                  (("-lnuma" lib)
                   (string-append "-L" numa "/lib " lib))))))
-         (add-after 'install 'avoid-circular-references
+         (add-after 'install 'move-lstopo
            (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))))))
+             (let* ((out (assoc-ref outputs "out"))
+                    (nogui (assoc-ref outputs "nogui"))
+                    (binout (string-append out "/bin"))
+                    (appsout (string-append out "/share/applications"))
+                    (man1out (string-append out "/share/man/man1")))
+               (mkdir-p binout)
+               (mkdir-p appsout)
+               (mkdir-p man1out)
+               (and
+                (delete-file (string-append nogui "/share/man/man1/lstopo.1"))
+                (copy-file
+                 (string-append nogui "/share/man/man1/lstopo-no-graphics.1")
+                 (string-append man1out "/lstopo.1"))
+                (zero?
+                 (system (format #f "mv ~a/bin/lstopo ~a" nogui binout)))
+                (zero?
+                 (system
+                  (format #f "mv ~a/share/applications/lstopo.desktop ~a"
+                          nogui appsout))))))))))
     (home-page "https://www.open-mpi.org/projects/hwloc/")
     (synopsis "Abstraction of hardware architectures")
     (description
@@ -123,7 +139,7 @@ bind processes, and much more.")
         "142s1vny9gllkq336yafxayjgcirj2jv0ddabj879jgya7hyr2d0"))))
     (build-system gnu-build-system)
     (inputs
-     `(("hwloc" ,hwloc "lib")
+     `(("hwloc" ,hwloc "nogui")
        ("gfortran" ,gfortran)
        ("valgrind" ,valgrind)))
     (native-inputs
diff --git a/gnu/packages/parallel.scm b/gnu/packages/parallel.scm
index 179fa7ed3..c320dfa62 100644
--- a/gnu/packages/parallel.scm
+++ b/gnu/packages/parallel.scm
@@ -113,7 +113,7 @@ and they are executed on lists of files, hosts, users or other items.")
    ;; in particular mysql and gtk+.
    (inputs `(("expect" ,expect)
              ("freeipmi" ,freeipmi)
-             ("hwloc" ,hwloc "lib")
+             ("hwloc" ,hwloc "nogui")
              ("json-c" ,json-c)
              ("linux-pam" , linux-pam)
              ("munge" ,munge)
-- 
2.11.0


[-- Attachment #5: 0005-gnu-valgrind-Add-doc-and-openmpi-outputs.patch --]
[-- Type: text/x-diff, Size: 4741 bytes --]

From 1772aa47c3bc71521340d7f569d4d906ab7f53e9 Mon Sep 17 00:00:00 2001
From: Dave Love <dave.love@manchester.ac.uk>
Date: Mon, 31 Jul 2017 15:01:59 +0100
Subject: [PATCH] gnu: valgrind: Add "doc" and "openmpi" outputs.

Also don't configure openmpi with valgrind; rely on the wrapper
library from the valgrind package, like Fedora and Debian.

* gnu/packages/valgrind.scm (valgrind)[outputs]: New field.
[arguments]: Add install-doc and install-openmpi phases.
[description]: Mention openmpi output.
* gnu/packages/mpi.scm (openmpi)[arguments]: Don't configure with
valgrind.
---
 gnu/packages/mpi.scm      |  9 ++-------
 gnu/packages/valgrind.scm | 25 +++++++++++++++++++++++--
 2 files changed, 25 insertions(+), 9 deletions(-)

diff --git a/gnu/packages/mpi.scm b/gnu/packages/mpi.scm
index 64d1f497b..f3fc83b26 100644
--- a/gnu/packages/mpi.scm
+++ b/gnu/packages/mpi.scm
@@ -36,8 +36,7 @@
   #:use-module (gnu packages xml)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages ncurses)
-  #:use-module (gnu packages pkg-config)
-  #:use-module (gnu packages valgrind))
+  #:use-module (gnu packages pkg-config))
 
 ;; Fixme: Replace hwloc-dump-hwdata.service with shepherd equivalent
 (define-public hwloc
@@ -140,8 +139,7 @@ bind processes, and much more.")
     (build-system gnu-build-system)
     (inputs
      `(("hwloc" ,hwloc "nogui")
-       ("gfortran" ,gfortran)
-       ("valgrind" ,valgrind)))
+       ("gfortran" ,gfortran)))
     (native-inputs
      `(("pkg-config" ,pkg-config)
        ("perl" ,perl)))
@@ -150,10 +148,7 @@ bind processes, and much more.")
 
                            "--enable-mpi-ext=all"
                            "--with-devel-headers"
-                           "--enable-memchecker"
                            "--with-sge"
-                           ,(string-append "--with-valgrind="
-                                           (assoc-ref %build-inputs "valgrind"))
                            ,(string-append "--with-hwloc="
                                            (assoc-ref %build-inputs "hwloc")))
        #:phases (modify-phases %standard-phases
diff --git a/gnu/packages/valgrind.scm b/gnu/packages/valgrind.scm
index 5f2bef16d..9bfba4761 100644
--- a/gnu/packages/valgrind.scm
+++ b/gnu/packages/valgrind.scm
@@ -3,6 +3,7 @@
 ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
 ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2017 Dave Love <fx@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -26,6 +27,7 @@
   #:use-module (guix licenses)
   #:use-module (gnu packages gdb)
   #:use-module (gnu packages perl)
+  #:use-module (gnu packages mpi)
   #:use-module (gnu packages))
 
 (define-public valgrind
@@ -53,17 +55,36 @@
                  (("obj:/lib") "obj:*/lib")
                  (("obj:/usr/X11R6/lib") "obj:*/lib")
                  (("obj:/usr/lib") "obj:*/lib"))
-               #t))))))
+               #t)))
+         (add-after 'install 'install-doc
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((orig (format #f "~a/share/doc" (assoc-ref outputs "out")))
+                   (dest (format #f "~a/share" (assoc-ref outputs "doc"))))
+               (mkdir-p dest)
+               (zero? (system* "mv" orig dest)))))
+         (add-after 'install 'install-openmpi
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((dest (format #f "~a/lib/valgrind"
+                                 (assoc-ref outputs "openmpi"))))
+               (mkdir-p dest)
+               (zero?
+                (system (format #f "mv ~a/lib/valgrind/libmpiwrap* ~a"
+                                (assoc-ref outputs "out") dest)))))))))
     (inputs `(;; GDB is needed to provide a sane default for `--db-command'.
               ("gdb" ,gdb)))
     (native-inputs `(("perl" ,perl)))
+    (outputs '("doc"                    ;16 MB
+               "openmpi" "out"))
     (home-page "http://www.valgrind.org/")
     (synopsis "Debugging and profiling tool suite")
     (description
      "Valgrind is an instrumentation framework for building dynamic analysis
 tools.  There are Valgrind tools that can automatically detect many memory
 management and threading bugs, and profile your programs in detail.  You can
-also use Valgrind to build new tools.")
+also use Valgrind to build new tools.
+
+The openmpi output contains a wrapper library for openmpi, as described
+in the documenation.")
     (license gpl2+)
 
     ;; Building VEX on mips64el-linux fails with "opcode not supported on this
-- 
2.11.0


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #6: 0006-gnu-openmpi-Modify-configuration-to-reduce-closure.patch --]
[-- Type: text/x-diff, Size: 1314 bytes --]

From a8bd87987f82e3f0f7f44a8c6d487a397ce6eda6 Mon Sep 17 00:00:00 2001
From: Dave Love <fx@gnu.org>
Date: Mon, 31 Jul 2017 15:03:46 +0100
Subject: [PATCH 6/8] gnu: openmpi: Modify configuration to reduce closure.

devel-headers are only for building MCA components, produce a large
closure and aren't normally packaged.  Only the affinity component of
mpi-ext is useful.

* mpi.scm (openmpi)[arguments]: Don't configure
--with-devel-headers and --enable-mpi-ext=all.
---
 gnu/packages/mpi.scm | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/mpi.scm b/gnu/packages/mpi.scm
index f3fc83b26..bbc81e45a 100644
--- a/gnu/packages/mpi.scm
+++ b/gnu/packages/mpi.scm
@@ -144,10 +144,9 @@ bind processes, and much more.")
      `(("pkg-config" ,pkg-config)
        ("perl" ,perl)))
     (arguments
-     `(#:configure-flags `("--enable-builtin-atomics"
+     `(#:configure-flags `("--enable-builtin-atomics" ;why?
 
-                           "--enable-mpi-ext=all"
-                           "--with-devel-headers"
+                           "--enable-mpi-ext=affinity" ;cr doesn't work
                            "--with-sge"
                            ,(string-append "--with-hwloc="
                                            (assoc-ref %build-inputs "hwloc")))
-- 
2.11.0


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #7: 0007-gnu-openmpi-Configure-without-vampirtrace.patch --]
[-- Type: text/x-diff, Size: 994 bytes --]

From 8a0668951bc352aadc3cce5c12c9e4d9e2e7b6c6 Mon Sep 17 00:00:00 2001
From: Dave Love <fx@gnu.org>
Date: Mon, 31 Jul 2017 15:04:44 +0100
Subject: [PATCH 7/8] gnu: openmpi: Configure without vampirtrace.

VT is obsoleted by scorep (not currently packaged) and disabling it reduces
the closure considerably.

* mpi.scm (openmpi)[arguments]: Configure without vampirtrace.
---
 gnu/packages/mpi.scm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gnu/packages/mpi.scm b/gnu/packages/mpi.scm
index bbc81e45a..abda1cc43 100644
--- a/gnu/packages/mpi.scm
+++ b/gnu/packages/mpi.scm
@@ -148,6 +148,7 @@ bind processes, and much more.")
 
                            "--enable-mpi-ext=affinity" ;cr doesn't work
                            "--with-sge"
+                           "--disable-vt"
                            ,(string-append "--with-hwloc="
                                            (assoc-ref %build-inputs "hwloc")))
        #:phases (modify-phases %standard-phases
-- 
2.11.0


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #8: 0008-gnu-openmpi-Remove-references-to-compiler-pathnames-.patch --]
[-- Type: text/x-diff, Size: 1768 bytes --]

From ec65c9d847c30d51bf83b49b397bc1ca20b7ca11 Mon Sep 17 00:00:00 2001
From: Dave Love <dave.love@manchester.ac.uk>
Date: Mon, 31 Jul 2017 17:15:19 +0100
Subject: [PATCH 8/8] gnu: openmpi: Remove references to compiler pathnames in
 "_info" programs.

This reduces the closure greatly, but note that the Fortran .mod files are
gfortran version-specific, so there should probably be development packages
for each incompatible version.  (The runtime is supposed to be more-or-less
version-independent unless the libgfortran soname changes.)  There may still
be a case for a separate runtime output.

* gnu/packages/mpi.scm (openmpi)[arguments]: Add "remove-absolute" phase.
---
 gnu/packages/mpi.scm | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/gnu/packages/mpi.scm b/gnu/packages/mpi.scm
index abda1cc43..ffae04415 100644
--- a/gnu/packages/mpi.scm
+++ b/gnu/packages/mpi.scm
@@ -152,6 +152,14 @@ bind processes, and much more.")
                            ,(string-append "--with-hwloc="
                                            (assoc-ref %build-inputs "hwloc")))
        #:phases (modify-phases %standard-phases
+                  (add-before 'build 'remove-absolute
+                    ;; Remove compilers (OPAL_FC_ABSOLUTE etc.) from closure.
+                    (lambda _
+                      (substitute* '("orte/tools/orte-info/param.c"
+                                     "oshmem/tools/oshmem_info/param.c"
+                                     "ompi/tools/ompi_info/param.c")
+                        (("_ABSOLUTE") ""))
+                      #t))
                   (add-before 'build 'scrub-timestamps ;reproducibility
                     (lambda _
                       (substitute* '("ompi/tools/ompi_info/param.c"
-- 
2.11.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2017-09-12  7:01 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-01 12:54 [bug#27905] changes for openmpi Dave Love
2017-08-21 15:12 ` Ludovic Courtès
2017-08-23 13:00   ` Dave Love
2017-08-31  7:58     ` Ludovic Courtès
2017-09-01 11:24       ` Dave Love
2017-09-01 11:06   ` Dave Love
2017-09-04 15:10     ` Ludovic Courtès
2017-09-07 16:14       ` Dave Love
2017-09-11 20:24         ` Dave Love
2017-09-12  7:00           ` bug#27905: " Ludovic Courtès

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.