mpi: Factorize openmpi setup build phase.
* 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, arpack-ng-openmpi)[arguments]: Use it in #:phases.
This commit is contained in:
parent
5882078e8c
commit
bbe46a4af5
@ -511,14 +511,8 @@ large scale eigenvalue problems.")
|
|||||||
''("--enable-mpi"))
|
''("--enable-mpi"))
|
||||||
((#:phases phases '%standard-phases)
|
((#:phases phases '%standard-phases)
|
||||||
`(modify-phases ,phases
|
`(modify-phases ,phases
|
||||||
(add-before 'check 'set-test-environment
|
(add-before 'check 'mpi-setup
|
||||||
(lambda _
|
,%openmpi-setup)))))
|
||||||
;; 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))))))
|
|
||||||
(synopsis "Fortran subroutines for solving eigenvalue problems with MPI")))
|
(synopsis "Fortran subroutines for solving eigenvalue problems with MPI")))
|
||||||
|
|
||||||
(define-public lapack
|
(define-public lapack
|
||||||
@ -579,14 +573,8 @@ problems in numerical linear algebra.")
|
|||||||
(arguments
|
(arguments
|
||||||
`(#:configure-flags `("-DBUILD_SHARED_LIBS:BOOL=YES")
|
`(#:configure-flags `("-DBUILD_SHARED_LIBS:BOOL=YES")
|
||||||
#:phases (modify-phases %standard-phases
|
#:phases (modify-phases %standard-phases
|
||||||
(add-before 'check 'set-test-environment
|
(add-before 'check 'mpi-setup
|
||||||
(lambda _
|
,%openmpi-setup))))
|
||||||
;; 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)))))
|
|
||||||
(home-page "http://www.netlib.org/scalapack/")
|
(home-page "http://www.netlib.org/scalapack/")
|
||||||
(synopsis "Library for scalable numerical linear algebra")
|
(synopsis "Library for scalable numerical linear algebra")
|
||||||
(description
|
(description
|
||||||
@ -1717,14 +1705,8 @@ scientific applications modeled by partial differential equations.")
|
|||||||
,@(delete "--with-mpi=0" ,cf)))
|
,@(delete "--with-mpi=0" ,cf)))
|
||||||
((#:phases phases)
|
((#:phases phases)
|
||||||
`(modify-phases ,phases
|
`(modify-phases ,phases
|
||||||
(add-before 'check 'set-test-environment
|
(add-before 'check 'mpi-setup
|
||||||
(lambda _
|
,%openmpi-setup)))))
|
||||||
;; 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))))))
|
|
||||||
(synopsis "Library to solve PDEs (with MPI support)")))
|
(synopsis "Library to solve PDEs (with MPI support)")))
|
||||||
|
|
||||||
(define-public petsc-complex-openmpi
|
(define-public petsc-complex-openmpi
|
||||||
@ -1855,14 +1837,8 @@ arising after the discretization of partial differential equations.")
|
|||||||
(substitute-keyword-arguments (package-arguments slepc)
|
(substitute-keyword-arguments (package-arguments slepc)
|
||||||
((#:phases phases '%standard-phases)
|
((#:phases phases '%standard-phases)
|
||||||
`(modify-phases ,phases
|
`(modify-phases ,phases
|
||||||
(add-before 'check 'set-test-environment
|
(add-before 'check 'mpi-setup
|
||||||
(lambda _
|
,%openmpi-setup)))))
|
||||||
;; 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))))))
|
|
||||||
(inputs
|
(inputs
|
||||||
`(("mpi" ,openmpi)
|
`(("mpi" ,openmpi)
|
||||||
("arpack" ,arpack-ng-openmpi)
|
("arpack" ,arpack-ng-openmpi)
|
||||||
@ -2032,14 +2008,8 @@ sparse system of linear equations A x = b using Guassian elimination.")
|
|||||||
(substitute-keyword-arguments (package-arguments mumps)
|
(substitute-keyword-arguments (package-arguments mumps)
|
||||||
((#:phases phases)
|
((#:phases phases)
|
||||||
`(modify-phases ,phases
|
`(modify-phases ,phases
|
||||||
(add-before 'check 'set-test-environment
|
(add-before 'check 'mpi-setup
|
||||||
(lambda _
|
,%openmpi-setup)
|
||||||
;; 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))
|
|
||||||
(replace 'check
|
(replace 'check
|
||||||
(lambda _
|
(lambda _
|
||||||
((assoc-ref ,phases 'check)
|
((assoc-ref ,phases 'check)
|
||||||
@ -2285,13 +2255,10 @@ CDEFS = -DAdd_"
|
|||||||
"/" dir)))
|
"/" dir)))
|
||||||
'("lib" "include"))
|
'("lib" "include"))
|
||||||
#t))
|
#t))
|
||||||
|
(add-before 'check 'mpi-setup
|
||||||
|
,%openmpi-setup)
|
||||||
(replace 'check
|
(replace 'check
|
||||||
(lambda _
|
(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"
|
(with-directory-excursion "EXAMPLE"
|
||||||
(invoke "mpirun" "-n" "2"
|
(invoke "mpirun" "-n" "2"
|
||||||
"./pddrive" "-r" "1" "-c" "2" "g20.rua")
|
"./pddrive" "-r" "1" "-c" "2" "g20.rua")
|
||||||
@ -2384,15 +2351,8 @@ YACC = bison -pscotchyy -y -b y
|
|||||||
;; "SCOTCH_PTHREAD_NUMBER=2"
|
;; "SCOTCH_PTHREAD_NUMBER=2"
|
||||||
"restrict=__restrict"))))
|
"restrict=__restrict"))))
|
||||||
#t))
|
#t))
|
||||||
(add-after
|
(add-after 'build 'build-esmumps
|
||||||
'build 'build-esmumps
|
|
||||||
(lambda _
|
(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"
|
(invoke "make"
|
||||||
(format #f "-j~a" (parallel-job-count))
|
(format #f "-j~a" (parallel-job-count))
|
||||||
"esmumps")))
|
"esmumps")))
|
||||||
@ -2575,14 +2535,8 @@ schemes.")
|
|||||||
(assoc-ref %build-inputs "lapack")
|
(assoc-ref %build-inputs "lapack")
|
||||||
" -llapack"))
|
" -llapack"))
|
||||||
#:phases (modify-phases %standard-phases
|
#:phases (modify-phases %standard-phases
|
||||||
(add-before 'check 'set-test-environment
|
(add-before 'check 'mpi-setup
|
||||||
(lambda _
|
,%openmpi-setup))))
|
||||||
;; 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)))))
|
|
||||||
(home-page "http://www.p4est.org")
|
(home-page "http://www.p4est.org")
|
||||||
(synopsis "Adaptive mesh refinement on forests of octrees")
|
(synopsis "Adaptive mesh refinement on forests of octrees")
|
||||||
(description
|
(description
|
||||||
@ -3649,14 +3603,8 @@ problems.")
|
|||||||
,@(delete "--without-MPI" ,flags)))
|
,@(delete "--without-MPI" ,flags)))
|
||||||
((#:phases phases)
|
((#:phases phases)
|
||||||
`(modify-phases ,phases
|
`(modify-phases ,phases
|
||||||
(add-before 'check 'set-test-environment
|
(add-before 'check 'mpi-setup
|
||||||
(lambda _
|
,%openmpi-setup)))))
|
||||||
;; 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))))))
|
|
||||||
(synopsis "Parallel solvers and preconditioners for linear equations")
|
(synopsis "Parallel solvers and preconditioners for linear equations")
|
||||||
(description
|
(description
|
||||||
"HYPRE is a software library of high performance preconditioners and
|
"HYPRE is a software library of high performance preconditioners and
|
||||||
@ -3939,6 +3887,8 @@ exclusion algorithms are typical examples of such systems.")
|
|||||||
"-DCMAKE_INSTALL_LIBDIR=lib"
|
"-DCMAKE_INSTALL_LIBDIR=lib"
|
||||||
"-DGFORTRAN_LIB=gfortran")
|
"-DGFORTRAN_LIB=gfortran")
|
||||||
#:phases (modify-phases %standard-phases
|
#:phases (modify-phases %standard-phases
|
||||||
|
(add-before 'check 'mpi-setup
|
||||||
|
,%openmpi-setup)
|
||||||
(add-before 'check 'setup-tests
|
(add-before 'check 'setup-tests
|
||||||
(lambda _
|
(lambda _
|
||||||
;; Parallelism is done at the MPI layer.
|
;; Parallelism is done at the MPI layer.
|
||||||
@ -4123,16 +4073,6 @@ easily be incorporated into existing simulation codes.")
|
|||||||
,flags))
|
,flags))
|
||||||
((#:phases phases '%standard-phases)
|
((#:phases phases '%standard-phases)
|
||||||
`(modify-phases ,phases
|
`(modify-phases ,phases
|
||||||
(add-before 'check 'set-test-environment
|
(add-before 'check 'mpi-setup
|
||||||
(lambda _
|
,%openmpi-setup)))))
|
||||||
;; 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))))))
|
|
||||||
(synopsis "SUNDIALS with OpenMPI support")))
|
(synopsis "SUNDIALS with OpenMPI support")))
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
;;; GNU Guix --- Functional package management for GNU
|
;;; 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, 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
|
||||||
;;; Copyright © 2014 Ian Denhardt <ian@zenhack.net>
|
;;; Copyright © 2014 Ian Denhardt <ian@zenhack.net>
|
||||||
;;; Copyright © 2016 Andreas Enge <andreas@enge.fr>
|
;;; 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
|
work correctly with all transports (such as @code{openib}), and the
|
||||||
performance is generally worse than the vanilla @code{openmpi} package, which
|
performance is generally worse than the vanilla @code{openmpi} package, which
|
||||||
only provides @code{MPI_THREAD_FUNNELED}.")))
|
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))
|
||||||
|
Loading…
Reference in New Issue
Block a user