all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#32641] [PATCH] mpi: Factorize openmpi setup build phase.
@ 2018-09-05 13:43 ericbavier
  2018-09-07  8:26 ` Ludovic Courtès
  0 siblings, 1 reply; 3+ messages in thread
From: ericbavier @ 2018-09-05 13:43 UTC (permalink / raw)
  To: 32641; +Cc: Eric Bavier

From: Eric Bavier <bavier@cray.com>

* gnu/packages/mpi.scm (%openmpi-setup): New variable.
* gnu/packages/maths.scm (scalapack, slepc-openmpi, mumps-openmpi)
(superlu-dist, p4est, petsc-openmpi, hypre-openmpi, elemental)
(sundials-openmpi)[arguments]: Use it in #:phases.
---
 gnu/packages/maths.scm | 92 +++++++++---------------------------------
 gnu/packages/mpi.scm   | 14 ++++++-
 2 files changed, 32 insertions(+), 74 deletions(-)

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index d2b9df01a..9ec418e82 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -569,14 +569,8 @@ problems in numerical linear algebra.")
     (arguments
      `(#:configure-flags `("-DBUILD_SHARED_LIBS:BOOL=YES")
        #:phases (modify-phases %standard-phases
-                  (add-before 'check 'set-test-environment
-                    (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 "cat"))
-                      #t)))))
+                  (add-before 'check 'mpi-setup
+		    ,%openmpi-setup))))
     (home-page "http://www.netlib.org/scalapack/")
     (synopsis "Library for scalable numerical linear algebra")
     (description
@@ -1707,14 +1701,8 @@ scientific applications modeled by partial differential equations.")
            ,@(delete "--with-mpi=0" ,cf)))
        ((#:phases phases)
         `(modify-phases ,phases
-           (add-before 'check 'set-test-environment
-             (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 "cat"))
-               #t))))))
+           (add-before 'check 'mpi-setup
+             ,%openmpi-setup)))))
     (synopsis "Library to solve PDEs (with MPI support)")))

 (define-public petsc-complex-openmpi
@@ -1845,14 +1833,8 @@ arising after the discretization of partial differential equations.")
      (substitute-keyword-arguments (package-arguments slepc)
        ((#:phases phases '%standard-phases)
         `(modify-phases ,phases
-           (add-before 'check 'set-test-environment
-             (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 "cat"))
-               #t))))))
+           (add-before 'check 'mpi-setup
+	     ,%openmpi-setup)))))
     (inputs
      `(("mpi" ,openmpi)
        ("arpack" ,arpack-ng-openmpi)
@@ -2022,14 +2004,8 @@ sparse system of linear equations A x = b using Guassian elimination.")
      (substitute-keyword-arguments (package-arguments mumps)
        ((#:phases phases)
         `(modify-phases ,phases
-           (add-before 'check 'set-test-environment
-             (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 "cat"))
-               #t))
+           (add-before 'check 'mpi-setup
+	     ,%openmpi-setup)
            (replace 'check
              (lambda _
                ((assoc-ref ,phases 'check)
@@ -2275,13 +2251,10 @@ CDEFS       = -DAdd_"
                                         "/" dir)))
               '("lib" "include"))
              #t))
+	 (add-before 'check 'mpi-setup
+	   ,%openmpi-setup)
          (replace 'check
            (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 "cat"))
              (with-directory-excursion "EXAMPLE"
                (invoke "mpirun" "-n" "2"
                        "./pddrive" "-r" "1" "-c" "2" "g20.rua")
@@ -2374,15 +2347,8 @@ YACC = bison -pscotchyy -y -b y
                           ;; "SCOTCH_PTHREAD_NUMBER=2"
                           "restrict=__restrict"))))
             #t))
-         (add-after
-          'build 'build-esmumps
+         (add-after 'build 'build-esmumps
           (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 "cat"))
-
             (invoke "make"
                     (format #f "-j~a" (parallel-job-count))
                     "esmumps")))
@@ -2565,14 +2531,8 @@ schemes.")
                                            (assoc-ref %build-inputs "lapack")
                                            " -llapack"))
        #:phases (modify-phases %standard-phases
-                  (add-before 'check 'set-test-environment
-                    (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 "cat"))
-                      #t)))))
+                  (add-before 'check 'mpi-setup
+		    ,%openmpi-setup))))
     (home-page "http://www.p4est.org")
     (synopsis "Adaptive mesh refinement on forests of octrees")
     (description
@@ -3639,14 +3599,8 @@ problems.")
            ,@(delete "--without-MPI" ,flags)))
        ((#:phases phases)
         `(modify-phases ,phases
-           (add-before 'check 'set-test-environment
-             (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 "cat"))
-               #t))))))
+           (add-before 'check 'mpi-setup
+	     ,%openmpi-setup)))))
     (synopsis "Parallel solvers and preconditioners for linear equations")
     (description
      "HYPRE is a software library of high performance preconditioners and
@@ -3929,6 +3883,8 @@ exclusion algorithms are typical examples of such systems.")
                            "-DCMAKE_INSTALL_LIBDIR=lib"
                            "-DGFORTRAN_LIB=gfortran")
        #:phases (modify-phases %standard-phases
+		  (add-before 'check 'mpi-setup
+		    ,%openmpi-setup)
                   (add-before 'check 'setup-tests
                     (lambda _
                       ;; Parallelism is done at the MPI layer.
@@ -4113,16 +4069,6 @@ easily be incorporated into existing simulation codes.")
                 ,flags))
        ((#:phases phases '%standard-phases)
         `(modify-phases ,phases
-           (add-before 'check 'set-test-environment
-             (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 "cat"))
-               ;; Allow oversubscription in case there are less
-               ;; physical cores available in the build environment
-               ;; than SUNDIALS wants while testing.
-               (setenv "OMPI_MCA_rmaps_base_oversubscribe" "yes")
-               #t))))))
+           (add-before 'check 'mpi-setup
+	     ,%openmpi-setup)))))
     (synopsis "SUNDIALS with OpenMPI support")))
diff --git a/gnu/packages/mpi.scm b/gnu/packages/mpi.scm
index f34b08e4c..7dfec16fc 100644
--- a/gnu/packages/mpi.scm
+++ b/gnu/packages/mpi.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2014, 2015 Eric Bavier <bavier@member.fsf.org>
+;;; Copyright © 2014, 2015, 2018 Eric Bavier <bavier@member.fsf.org>
 ;;; Copyright © 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2014 Ian Denhardt <ian@zenhack.net>
 ;;; Copyright © 2016 Andreas Enge <andreas@enge.fr>
@@ -250,3 +250,15 @@ software vendors, application developers and computer science researchers.")
 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}.")))
+
+;;; 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))
--
2.17.1

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

* [bug#32641] [PATCH] mpi: Factorize openmpi setup build phase.
  2018-09-05 13:43 [bug#32641] [PATCH] mpi: Factorize openmpi setup build phase ericbavier
@ 2018-09-07  8:26 ` Ludovic Courtès
  2018-09-13 17:14   ` bug#32641: " Ludovic Courtès
  0 siblings, 1 reply; 3+ messages in thread
From: Ludovic Courtès @ 2018-09-07  8:26 UTC (permalink / raw)
  To: ericbavier; +Cc: Eric Bavier, 32641

Hi Eric,

ericbavier@centurylink.net skribis:

> From: Eric Bavier <bavier@cray.com>
>
> * gnu/packages/mpi.scm (%openmpi-setup): New variable.
> * gnu/packages/maths.scm (scalapack, slepc-openmpi, mumps-openmpi)
> (superlu-dist, p4est, petsc-openmpi, hypre-openmpi, elemental)
> (sundials-openmpi)[arguments]: Use it in #:phases.

Good idea, go for it!

Thanks,
Ludo’.

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

* bug#32641: [PATCH] mpi: Factorize openmpi setup build phase.
  2018-09-07  8:26 ` Ludovic Courtès
@ 2018-09-13 17:14   ` Ludovic Courtès
  0 siblings, 0 replies; 3+ messages in thread
From: Ludovic Courtès @ 2018-09-13 17:14 UTC (permalink / raw)
  To: ericbavier; +Cc: Eric Bavier, 32641-done

This was pushed as bbe46a4af5972b3b5b434fe5d99ec9a0078b0ab8, closing.

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

end of thread, other threads:[~2018-09-13 17:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-05 13:43 [bug#32641] [PATCH] mpi: Factorize openmpi setup build phase ericbavier
2018-09-07  8:26 ` Ludovic Courtès
2018-09-13 17:14   ` bug#32641: " 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.