mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 21:38:07 -05:00
superlu-dist: Upgrade to 6.1.0.
* gnu/packages/patches/superlu-dist-awpm-grid.patch: New file. * gnu/packages/maths.scm (superlu-dist)[source]: Upgrade to 6.0.0. Remove extraneous 'use-modules' in snippet. [build-system]: Change to cmake-build-system. [propagated-inputs]: Replace pt-scotch with pt-scotch32 to match integer sizes. Add "parmetis" input, from pt-scotch32. Move lapack to ... [inputs]: ...here. Add openblas and combinatorial-blas. [arguments]: Replace 'configure' phase with #:configure-flags. Add 'set-c++-standard' and 'omp-setup' phases. Remove 'create-install-directories, 'check', and 'install' phases, which are now handled by cmake. * gnu/local.mk (dist_patch_DATA): Add patch.
This commit is contained in:
parent
fd3733432b
commit
6161141e91
3 changed files with 79 additions and 79 deletions
|
@ -1238,6 +1238,7 @@ dist_patch_DATA = \
|
|||
%D%/packages/patches/soundtouch-CVE-2018-1000223.patch \
|
||||
%D%/packages/patches/steghide-fixes.patch \
|
||||
%D%/packages/patches/streamlink-update-test.patch \
|
||||
%D%/packages/patches/superlu-dist-awpm-grid.patch \
|
||||
%D%/packages/patches/superlu-dist-scotchmetis.patch \
|
||||
%D%/packages/patches/swig-guile-gc.patch \
|
||||
%D%/packages/patches/swish-e-search.patch \
|
||||
|
|
|
@ -2298,20 +2298,18 @@ (define-public superlu
|
|||
(define-public superlu-dist
|
||||
(package
|
||||
(name "superlu-dist")
|
||||
(version "5.3.0")
|
||||
(version "6.1.0")
|
||||
(source
|
||||
(origin
|
||||
(method url-fetch)
|
||||
(uri (string-append "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/"
|
||||
"superlu_dist_" version ".tar.gz"))
|
||||
(sha256
|
||||
(base32 "0ja5ihqivkda1wd58y4lmzvmwssm9g91f70c5q0fzwhng6580h6y"))
|
||||
(base32 "0pqgcgh1yxhfzs99fas3mggajzd5wca3nbyp878rziy74gfk03dl"))
|
||||
(modules '((guix build utils)))
|
||||
(snippet
|
||||
;; Replace the non-free implementation of MC64 with a stub
|
||||
'(begin
|
||||
(use-modules (ice-9 regex)
|
||||
(ice-9 rdelim))
|
||||
(call-with-output-file "SRC/mc64ad_dist.c"
|
||||
(lambda (port)
|
||||
(display "
|
||||
|
@ -2327,92 +2325,57 @@ (define-public superlu-dist
|
|||
abort ();
|
||||
}\n" port)))
|
||||
(substitute* "SRC/util.c" ;adjust default algorithm
|
||||
(("RowPerm[[:blank:]]*=[[:blank:]]*LargeDiag")
|
||||
"RowPerm = NOROWPERM"))
|
||||
(("RowPerm[[:blank:]]*=[[:blank:]]*LargeDiag_MC64;")
|
||||
;; TODO: set to "LargeDiag_AWPM" once combinatorial-blas has
|
||||
;; general (i.e. non-square) processor-grid support.
|
||||
"RowPerm = NOROWPERM;"))
|
||||
#t))
|
||||
(patches (search-patches "superlu-dist-scotchmetis.patch"))))
|
||||
(build-system gnu-build-system)
|
||||
(patches (search-patches "superlu-dist-scotchmetis.patch"
|
||||
"superlu-dist-awpm-grid.patch"))))
|
||||
(build-system cmake-build-system)
|
||||
(native-inputs
|
||||
`(("tcsh" ,tcsh)))
|
||||
(inputs
|
||||
`(("gfortran" ,gfortran)))
|
||||
`(("gfortran" ,gfortran)
|
||||
("blas" ,openblas)
|
||||
("lapack" ,lapack)
|
||||
("combblas" ,combinatorial-blas)))
|
||||
(propagated-inputs
|
||||
`(("openmpi" ,openmpi) ;headers include MPI heades
|
||||
("lapack" ,lapack) ;required to link with output library
|
||||
("pt-scotch" ,pt-scotch))) ;same
|
||||
`(("mpi" ,openmpi) ;headers include MPI heades
|
||||
("parmetis" ,pt-scotch32 "metis")
|
||||
("pt-scotch" ,pt-scotch32)))
|
||||
(arguments
|
||||
`(#:parallel-build? #f ;race conditions using ar
|
||||
`(#:parallel-tests? #f ;tests use MPI and OpenMP
|
||||
#:configure-flags (list "-DBUILD_SHARED_LIBS:BOOL=YES"
|
||||
"-DTPL_ENABLE_COMBBLASLIB=YES"
|
||||
"-DTPL_BLAS_LIBRARIES=-lopenblas"
|
||||
"-DTPL_LAPACK_LIBRARIES=-llapack"
|
||||
(string-append "-DTPL_PARMETIS_LIBRARIES="
|
||||
(string-join
|
||||
'("ptscotchparmetis" "ptscotch" "ptscotcherr"
|
||||
"scotchmetis" "scotch" "scotcherr")
|
||||
";"))
|
||||
(string-append "-DTPL_PARMETIS_INCLUDE_DIRS="
|
||||
(assoc-ref %build-inputs "parmetis")
|
||||
"/include")
|
||||
"-DTPL_ENABLE_COMBBLASLIB=ON"
|
||||
(string-append "-DTPL_COMBBLAS_INCLUDE_DIRS="
|
||||
(assoc-ref %build-inputs "combblas")
|
||||
"/include/CombBLAS;"
|
||||
(assoc-ref %build-inputs "combblas")
|
||||
"/include/BipartiteMatchings")
|
||||
"-DTPL_COMBBLAS_LIBRARIES=CombBLAS")
|
||||
#:phases
|
||||
(modify-phases %standard-phases
|
||||
(replace 'configure
|
||||
(lambda* (#:key inputs outputs #:allow-other-keys)
|
||||
(call-with-output-file "make.inc"
|
||||
(lambda (port)
|
||||
(format port "
|
||||
PLAT =
|
||||
DSuperLUroot = ~a
|
||||
DSUPERLULIB = ~a/lib/libsuperlu_dist.a
|
||||
BLASDEF = -DUSE_VENDOR_BLAS
|
||||
BLASLIB = -L~a/lib -lblas
|
||||
PARMETISLIB = -L~a/lib \
|
||||
-lptscotchparmetis -lptscotch -lptscotcherr -lptscotcherrexit \
|
||||
-lscotch -lscotcherr -lscotcherrexit
|
||||
METISLIB = -L~:*~a/lib \
|
||||
-lscotchmetis -lscotch -lscotcherr -lscotcherrexit
|
||||
LIBS = $(DSUPERLULIB) $(PARMETISLIB) $(METISLIB) $(BLASLIB)
|
||||
ARCH = ar
|
||||
ARCHFLAGS = cr
|
||||
RANLIB = ranlib
|
||||
CC = mpicc
|
||||
PIC = -fPIC
|
||||
CFLAGS = -O3 -g -DPRNTlevel=0 $(PIC)
|
||||
NOOPTS = -O0 -g $(PIC)
|
||||
FORTRAN = mpifort
|
||||
FFLAGS = -O2 -g $(PIC)
|
||||
LOADER = $(CC)
|
||||
CDEFS = -DAdd_"
|
||||
(getcwd)
|
||||
(assoc-ref outputs "out")
|
||||
(assoc-ref inputs "lapack")
|
||||
(assoc-ref inputs "pt-scotch"))))
|
||||
#t))
|
||||
(add-after 'unpack 'remove-broken-symlinks
|
||||
(add-before 'configure 'set-c++-standard
|
||||
(lambda _
|
||||
(for-each delete-file
|
||||
(find-files "MAKE_INC" "\\.#make\\..*"))
|
||||
#t))
|
||||
(add-before 'build 'create-install-directories
|
||||
(lambda* (#:key outputs #:allow-other-keys)
|
||||
(for-each
|
||||
(lambda (dir)
|
||||
(mkdir-p (string-append (assoc-ref outputs "out")
|
||||
"/" dir)))
|
||||
'("lib" "include"))
|
||||
#t))
|
||||
(substitute* "CMakeLists.txt"
|
||||
;; AWPM headers require C++14
|
||||
(("CMAKE_CXX_STANDARD 11") "CMAKE_CXX_STANDARD 14"))))
|
||||
(add-before 'check 'mpi-setup
|
||||
,%openmpi-setup)
|
||||
(replace 'check
|
||||
(lambda _
|
||||
(with-directory-excursion "EXAMPLE"
|
||||
(invoke "mpirun" "-n" "2"
|
||||
"./pddrive" "-r" "1" "-c" "2" "g20.rua")
|
||||
(invoke "mpirun" "-n" "2"
|
||||
"./pzdrive" "-r" "1" "-c" "2" "cg20.cua"))
|
||||
#t))
|
||||
(replace 'install
|
||||
(lambda* (#:key outputs #:allow-other-keys)
|
||||
;; Library is placed in lib during the build phase. Copy over
|
||||
;; headers to include.
|
||||
(let* ((out (assoc-ref outputs "out"))
|
||||
(incdir (string-append out "/include")))
|
||||
(for-each (lambda (file)
|
||||
(let ((base (basename file)))
|
||||
(format #t "installing `~a' to `~a'~%"
|
||||
base incdir)
|
||||
(copy-file file
|
||||
(string-append incdir "/" base))))
|
||||
(find-files "SRC" ".*\\.h$")))
|
||||
#t)))))
|
||||
(add-before 'check 'omp-setup
|
||||
(lambda _ (setenv "OMP_NUM_THREADS" "1") #t)))))
|
||||
(home-page (package-home-page superlu))
|
||||
(synopsis "Parallel supernodal direct solver")
|
||||
(description
|
||||
|
|
36
gnu/packages/patches/superlu-dist-awpm-grid.patch
Normal file
36
gnu/packages/patches/superlu-dist-awpm-grid.patch
Normal file
|
@ -0,0 +1,36 @@
|
|||
Create the CombBLAS::SpParMat with the MPI_Comm from the input 'gridinfo_t'.
|
||||
This prevents a warning/error from CombBLAS about using MPI_COMM_WORLD.
|
||||
|
||||
--- a/SRC/AWPM_CombBLAS.hpp
|
||||
+++ b/SRC/AWPM_CombBLAS.hpp
|
||||
@@ -52,7 +52,7 @@
|
||||
{
|
||||
printf("AWPM only supports square process grid. Retuning without a permutation.\n");
|
||||
}
|
||||
- combblas::SpParMat < int_t, double, combblas::SpDCCols<int_t,double> > Adcsc;
|
||||
+ combblas::SpParMat < int_t, double, combblas::SpDCCols<int_t,double> > Adcsc(grid->comm);
|
||||
std::vector< std::vector < std::tuple<int_t,int_t,double> > > data(procs);
|
||||
|
||||
/* ------------------------------------------------------------
|
||||
@@ -100,11 +100,10 @@
|
||||
combblas::AWPM(Adcsc, mateRow2Col, mateCol2Row,true);
|
||||
|
||||
// now gather the matching vector
|
||||
- MPI_Comm World = mateRow2Col.getcommgrid()->GetWorld();
|
||||
int * rdispls = new int[procs];
|
||||
int sendcnt = mateRow2Col.LocArrSize();
|
||||
int * recvcnt = new int[procs];
|
||||
- MPI_Allgather(&sendcnt, 1, MPI_INT, recvcnt, 1, MPI_INT, World);
|
||||
+ MPI_Allgather(&sendcnt, 1, MPI_INT, recvcnt, 1, MPI_INT, grid->comm);
|
||||
rdispls[0] = 0;
|
||||
for(int i=0; i<procs-1; ++i)
|
||||
{
|
||||
@@ -112,7 +111,7 @@
|
||||
}
|
||||
int_t *senddata = (int_t *)mateRow2Col.GetLocArr();
|
||||
|
||||
- MPI_Allgatherv(senddata, sendcnt, combblas::MPIType<int_t>(), ScalePermstruct->perm_r, recvcnt, rdispls, combblas::MPIType<int_t>(), World);
|
||||
+ MPI_Allgatherv(senddata, sendcnt, combblas::MPIType<int_t>(), ScalePermstruct->perm_r, recvcnt, rdispls, combblas::MPIType<int_t>(), grid->comm);
|
||||
|
||||
delete[] rdispls;
|
||||
delete[] recvcnt;
|
Loading…
Reference in a new issue