hiepacs.scm 35.5 KB
Newer Older
Ludovic Courtès's avatar
Ludovic Courtès committed
1
2
3
;;; This module extends GNU Guix and is licensed under the same terms, those
;;; of the GNU GPL version 3 or (at your option) any later version.
;;;
4
;;; Copyright © 2017, 2019 Inria
Ludovic Courtès's avatar
Ludovic Courtès committed
5
6
7

(define-module (inria hiepacs)
  #:use-module (guix)
Ludovic Courtès's avatar
Ludovic Courtès committed
8
  #:use-module (guix git-download)
MARAIT Gilles's avatar
MARAIT Gilles committed
9
  #:use-module (guix hg-download)
Ludovic Courtès's avatar
Ludovic Courtès committed
10
11
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix build-system cmake)
12
  #:use-module (guix build-system gnu)
Ludovic Courtès's avatar
Ludovic Courtès committed
13
  #:use-module (gnu packages)
14
15
  #:use-module (gnu packages bison)
  #:use-module (gnu packages flex)
Ludovic Courtès's avatar
Ludovic Courtès committed
16
17
18
19
  #:use-module (gnu packages gcc)
  #:use-module (gnu packages maths)
  #:use-module (gnu packages mpi)
  #:use-module (gnu packages pkg-config)
20
  #:use-module (gnu packages python)
Ludovic Courtès's avatar
Ludovic Courtès committed
21
  #:use-module (gnu packages python-xyz)
22
  #:use-module (gnu packages ssh)
23
24
  #:use-module (gnu packages perl)
  #:use-module (inria mpi)
PRUVOST Florent's avatar
PRUVOST Florent committed
25
  #:use-module (inria storm)
GUILBAUD Adrien's avatar
GUILBAUD Adrien committed
26
  #:use-module (inria tadaam)
27
  #:use-module (inria eztrace)
28
  #:use-module (inria simgrid)
PRUVOST Florent's avatar
PRUVOST Florent committed
29
30
  #:use-module (guix utils)
  #:use-module (srfi srfi-1))
Ludovic Courtès's avatar
Ludovic Courtès committed
31

32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
(define-public parsec
  (package
    (name "parsec")
    (version "210d9d2b8cb292b64c01a597047581f27cf8cb54")
    (home-page "https://bitbucket.org/mfaverge/parsec.git")
    (synopsis "Runtime system based on dynamic task generation mechanism")
    (description
     "PaRSEC is a generic framework for architecture aware scheduling
and management of micro-tasks on distributed many-core heterogeneous
architectures.")
    (license license:bsd-2)
    (source (origin
              (method git-fetch)
              (uri (git-reference
                    (url home-page)
                    (commit "210d9d2b8cb292b64c01a597047581f27cf8cb54")
                    (recursive? #t)))
              (file-name (string-append name "-" version "-checkout"))
              (sha256
               (base32
                "1yfny4ra9v3nxal1mbi0jqpivc0qamrx7m270qqnxjjp95vvky4z"))))
    (build-system cmake-build-system)
    (arguments
     '(#:configure-flags '("-DBUILD_SHARED_LIBS=ON"
                           "-DPARSEC_GPU_WITH_CUDA=OFF"
                           "-DPARSEC_DIST_WITH_MPI=OFF")
       #:tests? #f))
    (inputs `(("hwloc" ,hwloc)
              ("bison" ,bison)
              ("flex" ,flex)))
    (native-inputs `(("gfortran" ,gfortran)
                     ("python" ,python-2)))))

(define-public quark
  (package
    (name "quark")
    (version "db4aef9a66a00487d849cf8591927dcebe18ef2f")
    (home-page "https://github.com/ecrc/quark")
    (synopsis "QUeuing And Runtime for Kernels")
    (description
     "QUARK (QUeuing And Runtime for Kernels) provides a library that
enables the dynamic execution of tasks with data dependencies in a
multi-core, multi-socket, shared-memory environment.  QUARK infers
data dependencies and precedence constraints between tasks from the
way that the data is used, and then executes the tasks in an
asynchronous, dynamic fashion in order to achieve a high utilization
of the available resources.")
    (license license:bsd-2)
    (source (origin
              (method git-fetch)
              (uri (git-reference
                    (url home-page)
                    (commit "db4aef9a66a00487d849cf8591927dcebe18ef2f")))
              (file-name (string-append name "-" version "-checkout"))
              (sha256
               (base32
                "1bwh8247d70lmbr13h5cb8fpr6m0k9vcaim4bq7j8mynfclb6r77"))))
    (build-system cmake-build-system)
    (arguments
     '(#:configure-flags '("-DBUILD_SHARED_LIBS=ON")
       #:phases
       (modify-phases %standard-phases
        (add-after 'unpack 'patch-makefile
                    (lambda _
                      (substitute* "CMakeLists.txt"
                        (("DESTINATION quark")  "DESTINATION include"))
                      #t)))
       ;; No target for tests
       #:tests? #f))
    (inputs `(("hwloc" ,hwloc)))
    (native-inputs `(("gfortran" ,gfortran)))))

Ludovic Courtès's avatar
Ludovic Courtès committed
104
105
106
(define-public chameleon
  (package
    (name "chameleon")
107
    (version "0.9.2")
108
    (home-page "https://gitlab.inria.fr/solverstack/chameleon")
PRUVOST Florent's avatar
PRUVOST Florent committed
109
110
111
112
113
114
115
116
117
118
    (synopsis "Dense linear algebra solver")
    (description
     "Chameleon is a dense linear algebra solver relying on sequential
task-based algorithms where sub-tasks of the overall algorithms are submitted
to a run-time system.  Such a system is a layer between the application and
the hardware which handles the scheduling and the effective execution of
tasks on the processing units.  A run-time system such as StarPU is able to
manage automatically data transfers between not shared memory
area (CPUs-GPUs, distributed nodes).")
    (license license:cecill-c)
Ludovic Courtès's avatar
Ludovic Courtès committed
119
    (source (origin
120
121
122
123
124
125
126
              (method git-fetch)
              (uri (git-reference
                    (url home-page)
                    (commit "d2b4cab3a6b860f068979ecc2a532a3249060ba8")
                    ;; We need the submodule in 'CMakeModules/morse_cmake'.
                    (recursive? #t)))
              (file-name (string-append name "-" version "-checkout"))
Ludovic Courtès's avatar
Ludovic Courtès committed
127
128
              (sha256
               (base32
129
                "03sjykh24ms4h2vzylkxcc6v7nshl3w0dhyyrv9grzckmxvmvzij"))))
Ludovic Courtès's avatar
Ludovic Courtès committed
130
    (build-system cmake-build-system)
131
    (outputs '("debug" "out"))
Ludovic Courtès's avatar
Ludovic Courtès committed
132
    (arguments
133
134
     '(#:configure-flags '("-DBUILD_SHARED_LIBS=ON"
                           "-DCHAMELEON_USE_MPI=ON")
Ludovic Courtès's avatar
Ludovic Courtès committed
135

136
137
138
       ;; FIXME: Test too long for gitlab-runner CI
       #:tests? #f

Ludovic Courtès's avatar
Ludovic Courtès committed
139
140
141
142
143
144
145
       #:phases  (modify-phases %standard-phases
                   (add-before 'check 'set-home
                     (lambda _
                       ;; Some of the tests use StarPU, which expects $HOME
                       ;; to be writable.
                       (setenv "HOME" (getcwd))
                       #t)))))
146
147
148
    (inputs `(("lapack" ,openblas)))
    (propagated-inputs `(("starpu" ,starpu)
                         ("mpi" ,openmpi)))
Ludovic Courtès's avatar
Ludovic Courtès committed
149
150
    (native-inputs `(("pkg-config" ,pkg-config)
                     ("gfortran" ,gfortran)
PRUVOST Florent's avatar
PRUVOST Florent committed
151
152
                     ("python" ,python-2)))))

153
154
155
156
157
158
159
160
161
162
(define-public chameleon+fxt
  (package
   (inherit chameleon)
   (name "chameleon-fxt")
   (arguments
    (substitute-keyword-arguments (package-arguments chameleon)
                                  ((#:configure-flags flags '())
                                   `(cons "-DCHAMELEON_ENABLE_TRACING=ON" ,flags))))
   (propagated-inputs `(("fxt" ,fxt)
                        ("starpu" ,starpu+fxt)
163
164
165
166
167
168
169
170
171
172
173
174
175
176
                        ,@(delete `("starpu" ,starpu) (package-inputs chameleon))))))

(define-public chameleon+simgrid
  (package
   (inherit chameleon)
   (name "chameleon-simgrid")
   (arguments
    (substitute-keyword-arguments (package-arguments chameleon)
                                  ((#:configure-flags flags '())
                                   `(cons "-DCHAMELEON_SIMULATION=ON" (delete "-DCHAMELEON_USE_MPI=ON" ,flags)))))
   (inputs `(("simgrid" ,simgrid)))
   (propagated-inputs `(("starpu" ,starpu+simgrid)
                        ,@(delete `("starpu" ,starpu) (package-inputs chameleon))
                        ,@(delete `("mpi" ,openmpi) (package-inputs chameleon))))))
177

178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
(define-public chameleon+openmp
  (package
   (inherit chameleon)
   (name "chameleon-openmp")
   (arguments
    (substitute-keyword-arguments (package-arguments chameleon)
                                  ((#:configure-flags flags '())
                                   `(cons "-DCHAMELEON_SCHED=OPENMP" (delete "-DCHAMELEON_USE_MPI=ON" ,flags)))))
   (propagated-inputs `(,@(delete `("starpu" ,starpu) (package-inputs chameleon))
                        ,@(delete `("mpi" ,openmpi) (package-inputs chameleon))))))

(define-public chameleon+quark
  (package
   (inherit chameleon)
   (name "chameleon-quark")
   (arguments
    (substitute-keyword-arguments (package-arguments chameleon)
                                  ((#:configure-flags flags '())
                                   `(cons "-DCHAMELEON_SCHED=QUARK" (delete "-DCHAMELEON_USE_MPI=ON" ,flags)))))
   (propagated-inputs `(("quark" ,quark)
             ,@(delete `("starpu" ,starpu) (package-inputs chameleon))
             ,@(delete `("mpi" ,openmpi) (package-inputs chameleon))))))

(define-public chameleon+parsec
  (package
   (inherit chameleon)
   (name "chameleon-parsec")
   (arguments
    (substitute-keyword-arguments (package-arguments chameleon)
                                  ((#:configure-flags flags '())
                                   `(cons "-DCHAMELEON_SCHED=PARSEC" (delete "-DCHAMELEON_USE_MPI=ON" ,flags)))))
   (propagated-inputs `(("parsec" ,parsec)
             ,@(delete `("starpu" ,starpu) (package-inputs chameleon))
             ,@(delete `("mpi" ,openmpi) (package-inputs chameleon))))))

Ludovic Courtès's avatar
Ludovic Courtès committed
213
214
215
(define-public maphys
  (package
    (name "maphys")
MARAIT Gilles's avatar
MARAIT Gilles committed
216
    (version "0.9.8.2")
217
    (home-page "https://gitlab.inria.fr/solverstack/maphys/maphys")
Ludovic Courtès's avatar
Ludovic Courtès committed
218
219
220
221
    (source (origin
              (method git-fetch)
              (uri (git-reference
                    (url home-page)
222
223
                    (commit "c11405a13fd32e7bba58fb5468ec0f0a22e5878a")
                    ;;(commit version)
Ludovic Courtès's avatar
Ludovic Courtès committed
224
225
226
227
228
                    ;; We need the submodule in 'cmake_modules/morse'.
                    (recursive? #t)))
              (file-name (string-append name "-" version "-checkout"))
              (sha256
               (base32
229
                "1bcg9qsn4z9861lgf5g6y6d46q427swr4d6jdx7lmmqmlpfzgxy7"))))
Ludovic Courtès's avatar
Ludovic Courtès committed
230
231
    (build-system cmake-build-system)
    (arguments
232

MARAIT Gilles's avatar
MARAIT Gilles committed
233
234
     '(#:configure-flags '("-DBUILD_SHARED_LIBS=ON"
                           "-DMAPHYS_BUILD_TESTS=ON"
235
                           "-DMAPHYS_SDS_MUMPS=ON"
236
                           "-DMAPHYS_SDS_PASTIX=ON"
237
                           "-DCMAKE_EXE_LINKER_FLAGS=-lstdc++"
238
                           "-DMAPHYS_ITE_FABULOUS=ON"
239
240
                           "-DMAPHYS_ORDERING_PADDLE=ON"
                           )
241
242

       #:phases (modify-phases %standard-phases
243
244
245
                               ;; Without this variable, pkg-config removes paths in already in CFLAGS
                               ;; However, gfortran does not check CPATH to find fortran modules
                               ;; and and the module fabulous_mod cannot be found
246
247
                               (add-before 'configure 'fix-pkg-config-env
                                           (lambda _ (setenv "PKG_CONFIG_ALLOW_SYSTEM_CFLAGS" "1") #t))
248
249
                               ;; Allow tests with more MPI processes than available CPU cores,
                               ;; which is not allowed by default by OpenMPI
250
251
252
                               (add-before 'check 'prepare-test-environment
                                           (lambda _
                                             (setenv "OMPI_MCA_rmaps_base_oversubscribe" "1") #t)))))
253

254
    (inputs `(("hwloc" ,hwloc "lib")
Ludovic Courtès's avatar
Ludovic Courtès committed
255
              ("openmpi" ,openmpi)
256
              ("ssh" ,openssh)
Ludovic Courtès's avatar
Ludovic Courtès committed
257
258
259
              ("scalapack" ,scalapack)
              ("openblas" ,openblas)
              ("lapack" ,lapack)
MARAIT Gilles's avatar
MARAIT Gilles committed
260
              ("scotch" ,pt-scotch)
261
              ("mumps" ,mumps-openmpi)
MARAIT Gilles's avatar
MARAIT Gilles committed
262
              ("pastix" ,pastix)
263
              ("fabulous" ,fabulous)
264
              ("paddle", paddle)
Ludovic Courtès's avatar
Ludovic Courtès committed
265
266
267
              ("metis" ,metis)))
    (native-inputs `(("gforgran" ,gfortran)
                     ("pkg-config" ,pkg-config)))
268
    (synopsis "Sparse matrix hybrid solver")
Ludovic Courtès's avatar
Ludovic Courtès committed
269
270
    (description
     "MaPHyS (Massively Parallel Hybrid Solver) is a parallel linear solver
271
that couples direct and iterative approaches. The underlying idea is to
Ludovic Courtès's avatar
Ludovic Courtès committed
272
apply to general unstructured linear systems domain decomposition ideas
273
developed for the solution of linear systems arising from PDEs. The
Ludovic Courtès's avatar
Ludovic Courtès committed
274
275
interface problem, associated with the so called Schur complement system, is
solved using a block preconditioner with overlap between the blocks that is
276
referred to as Algebraic Additive Schwarz.To cope with the possible lack of
Ludovic Courtès's avatar
Ludovic Courtès committed
277
278
279
280
281
coarse grid mechanism that enables one to keep constant the number of
iterations when the number of blocks is increased, the solver exploits two
levels of parallelism (between the blocks and within the treatment of the
blocks).  This enables it to exploit a large number of processors with a
moderate number of blocks which ensures a reasonable convergence behavior.")
MARAIT Gilles's avatar
MARAIT Gilles committed
282
    (license license:cecill-c)))
Ludovic Courtès's avatar
Ludovic Courtès committed
283

284
285
286
287
288
289
290
291
292
(define-public paddle
  (package
    (name "paddle")
    (version "0.3.3")
    (home-page "https://gitlab.inria.fr/solverstack/paddle")
    (source (origin
              (method git-fetch)
              (uri (git-reference
                    (url home-page)
MARAIT Gilles's avatar
MARAIT Gilles committed
293
294
                    ;;(commit version)
                    (commit "c6d5e18c4662503b416052473adad8254e1a564e")
295
296
297
298
299
                    ;; We need the submodule in 'cmake_modules/morse'.
                    (recursive? #t)))
              (file-name (string-append name "-" version "-checkout"))
              (sha256
               (base32
MARAIT Gilles's avatar
MARAIT Gilles committed
300
                "1gdyi4nf2hyrw0kfv2i4yfgdz5c4nxws2b72iks245ryx3z3akkj"))))
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
    (build-system cmake-build-system)
    (arguments
     '(#:configure-flags '("-DBUILD_SHARED_LIBS=ON"
                           "-DPADDLE_BUILD_TESTS=ON"
                           "-DPADDLE_ORDERING_PARMETIS=OFF")
       #:phases (modify-phases %standard-phases
                                (add-before 'configure 'change-directory
                                            (lambda _ (chdir "src") #t))
                                (add-before 'check 'prepare-test-environment
                                            (lambda _
                                              ;; Allow tests with more MPI processes than available CPU cores,
                                              ;; which is not allowed by default by OpenMPI
                                              (setenv "OMPI_MCA_rmaps_base_oversubscribe" "1") #t)))))
    (inputs `(("openmpi" ,openmpi)
              ("ssh" ,openssh)
MARAIT Gilles's avatar
MARAIT Gilles committed
316
              ("scotch" ,pt-scotch)))
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
    (native-inputs `(("gforgran" ,gfortran)
                     ("pkg-config" ,pkg-config)))
    (synopsis "Parallel Algebraic Domain Decomposition for Linear systEms")
    (description
     "This  software’s goal is  to propose  a parallel
  algebraic strategy to decompose a  sparse linear system Ax=b, enabling
  its resolution by a domain decomposition solver.  Up to now, Paddle is
  implemented for the MaPHyS linear solver.")
    (license license:cecill-c)))

(define-public fabulous
  (package
    (name "fabulous")
    (version "1.0")
    (home-page "https://gitlab.inria.fr/solverstack/fabulous")
    (source (origin
              (method git-fetch)
              (uri (git-reference
                    (url home-page)
336
                    (commit "00b34553587ed22806ee46f56fc671769b65dbdf")
337
338
339
340
341
                    ;; We need the submodule in 'cmake_modules/morse'.
                    (recursive? #t)))
              (file-name (string-append name "-" version "-checkout"))
              (sha256
               (base32
342
343
                "08596i9fxfr4var6js1m9dijfr8fymwppl3irkmrfc5yby44v6qf"
                ))))
344
345
346
347
348
349
350
351
352
    (build-system cmake-build-system)
    (arguments
     '(#:configure-flags '("-DFABULOUS_BUILD_C_API=ON"
                           "-DFABULOUS_BUILD_Fortran_API=ON"
                           "-DCMAKE_EXE_LINKER_FLAGS=-lstdc++"
                           "-DFABULOUS_LAPACKE_NANCHECK=OFF"
                           "-DFABULOUS_USE_CHAMELEON=OFF"
                           "-DBUILD_SHARED_LIBS=ON"
                           "-DFABULOUS_BUILD_EXAMPLES=ON"
353
                           "-DFABULOUS_BUILD_TESTS=OFF")
354
355
356
357
358
359
360
361
362
363
                         #:tests? #f))
     (inputs `(("openblas" ,openblas)
               ("lapack" ,lapack)))
     (native-inputs `(("gforgran" ,gfortran)
                      ("pkg-config" ,pkg-config)))
     (synopsis "Fast Accurate Block Linear krylOv Solver")
     (description
      "Library implementing Block-GMres with Inexact Breakdown and Deflated Restarting")
     (license license:cecill-c)))

MARAIT Gilles's avatar
MARAIT Gilles committed
364
365
366
367
368
(define-public maphys++
  (package
   (name "maphys++")
   (version "0.1")
   (home-page "https://gitlab.inria.fr/solverstack/maphys/maphyspp.git")
369
   (synopsis "Sparse matrix hybrid solver")
MARAIT Gilles's avatar
MARAIT Gilles committed
370
371
   (description
    "MaPHyS (Massively Parallel Hybrid Solver) is a parallel linear solver
372
that couples direct and iterative approaches. The underlying idea is to
MARAIT Gilles's avatar
MARAIT Gilles committed
373
apply to general unstructured linear systems domain decomposition ideas
374
375
376
developed for the solution of linear systems arising from PDEs.
This new implementation in C++ offers a wide range of hybrid methods to
solve massive sparse systems efficiently.")
MARAIT Gilles's avatar
MARAIT Gilles committed
377
378
379
380
381
   (license license:cecill-c)
   (source (origin
            (method git-fetch)
            (uri (git-reference
                  (url home-page)
382
                  (commit "f0b91e98efab1324323d5bdf0f0163bc0695d45a")
MARAIT Gilles's avatar
MARAIT Gilles committed
383
384
385
386
387
388
                  ;; We need the submodule in 'cmake_modules/morse_cmake'.
                  (recursive? #t)))
            (file-name (string-append name "-" version "-checkout"))
            (sha256
             (base32
              "03sjykh24ms4h2vzylkxcc6v7nshl3w0dhyyrv9grzckmxvmvzij"))))
MARAIT Gilles's avatar
MARAIT Gilles committed
389
390
391
392
393
394
395
396
397
398
399
400
401
402
   (arguments
    '(#:configure-flags '("-DMAPHYS_COMPILE_EXAMPLES=ON"
                          "-DMAPHYS_COMPILE_TESTS=ON"
                          "-DMAPHYS_USE_ARMADILLO=OFF"
                          "-DMAPHYS_USE_EIGEN=OFF"
                          "-DMAPHYS_USE_FABULOUS=OFF"
                          "-DMAPHYS_DEV_TANGLE=OFF"
                          "-DMAPHYS_USE_PASTIX=ON")
                        #:phases (modify-phases %standard-phases
                                                (add-before 'configure 'fixgcc7
                                                            (lambda _
                                                              (unsetenv "C_INCLUDE_PATH")
                                                              (unsetenv "CPLUS_INCLUDE_PATH"))))
      ))
MARAIT Gilles's avatar
MARAIT Gilles committed
403
404
   (build-system cmake-build-system)
   (inputs `(("lapack" ,openblas)
MARAIT Gilles's avatar
MARAIT Gilles committed
405
             ("blaspp" ,blaspp)
MARAIT Gilles's avatar
MARAIT Gilles committed
406
             ("pastix" ,pastix)))
407
408
   (propagated-inputs `(("mpi" ,openmpi)
                        ("ssh" ,openssh)))
MARAIT Gilles's avatar
MARAIT Gilles committed
409
410
411
   (native-inputs `(("gcc" ,gcc-7)
                    ("gcc-lib" ,gcc-7 "lib")
                    ("pkg-config" ,pkg-config)))))
MARAIT Gilles's avatar
MARAIT Gilles committed
412
413
414
415
416

(define-public blaspp
  (package
    (name "blaspp")
    (version "0.1")
MARAIT Gilles's avatar
MARAIT Gilles committed
417
    (home-page "https://bitbucket.org/icl/blaspp")
MARAIT Gilles's avatar
MARAIT Gilles committed
418
419
    (synopsis "C++ API for the Basic Linear Algebra Subroutines")
    (description
MARAIT Gilles's avatar
MARAIT Gilles committed
420
421
422
423
424
425
426
     "The Basic Linear Algebra Subprograms (BLAS) have been around for many
decades and serve as the de facto standard for performance-portable and
numerically robust implementation of essential linear algebra functionality.The
objective of BLAS++ is to provide a convenient, performance oriented API for
development in the C++ language, that, for the most part, preserves established
conventions, while, at the same time, takes advantages of modern C++ features,
such as: namespaces, templates, exceptions, etc.")
MARAIT Gilles's avatar
MARAIT Gilles committed
427
    (source (origin
MARAIT Gilles's avatar
MARAIT Gilles committed
428
429
430
             (method hg-fetch)
             (uri (hg-reference
                   (url home-page)
431
                   (changeset "7859f573d9d04dfd38176fb7612edfa6d6d3ac0b")))
MARAIT Gilles's avatar
MARAIT Gilles committed
432
433
434
             (patches (search-patches "inria/patches/blaspp-installation-directories.patch"))
             (sha256
              (base32
MARAIT Gilles's avatar
MARAIT Gilles committed
435
               "0cgk9dxrc6h3bwdpfsgh3l5qlabg7rkvv76mvvsmjdlsk7v0dqss"))))
MARAIT Gilles's avatar
MARAIT Gilles committed
436
    (arguments
MARAIT Gilles's avatar
MARAIT Gilles committed
437
438
     '(#:configure-flags '("-DBLASPP_BUILD_TESTS=OFF")
                         #:tests? #f))
MARAIT Gilles's avatar
MARAIT Gilles committed
439
     ;;'(#:configure-flags '("-DBLASPP_BUILD_TESTS=ON")
MARAIT Gilles's avatar
MARAIT Gilles committed
440
    (build-system cmake-build-system)
MARAIT Gilles's avatar
MARAIT Gilles committed
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
    (inputs `(("openblas" ,openblas))) ;; technically only blas
    (native-inputs `(("gfortran" ,gfortran)))
    (license #f)))

(define-public lapackpp
  (package
    (name "lapackpp")
    (version "0.1")
    (home-page "https://bitbucket.org/icl/lapackpp")
    (synopsis "C++ API for the Linear Algebra PACKage")
    (description
     "The Linear Algebra PACKage (LAPACK) is a standard software library for
numerical linear algebra. The objective of LAPACK++ is to provide a convenient,
performance oriented API for development in the C++ language, that, for the most
part, preserves established conventions, while, at the same time, takes
advantages of modern C++ features, such as: namespaces, templates, exceptions,
etc.")
    (source (origin
             (method hg-fetch)
             (uri (hg-reference
                   (url home-page)
                   (changeset "154d3c06b02c1b16b36b862bd46421e19f5f17a6")))
             ;;(patches (search-patches "inria/patches/lapackpp-installation-directories.patch"))
             (sha256
              (base32
               "1n5j0myczh3ca7hndv0ziz6kd62ax59qac4njiy2q8kdvcmlmrh0"))))
    (arguments
     '(#:configure-flags '("-DBUILD_LAPACKPP_TESTS=OFF")
       #:tests? #f))
    (build-system cmake-build-system)
    (inputs `(("openblas" ,openblas) ;; technically only lapack
              ("blaspp" ,blaspp)))
MARAIT Gilles's avatar
MARAIT Gilles committed
473
    (native-inputs `(("gfortran" ,gfortran)))
MARAIT Gilles's avatar
MARAIT Gilles committed
474
    (license #f)))
MARAIT Gilles's avatar
MARAIT Gilles committed
475

476
(define-public pastix-6
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
  (package
    (name "pastix")
    (version "6.0.2")
    (home-page "https://gitlab.inria.fr/solverstack/pastix")
    (source (origin
              (method git-fetch)
              (uri (git-reference
                    (url home-page)
                    (commit (string-append "v" version))

                    ;; We need the submodule in 'cmake_modules/morse'.
                    (recursive? #t)))
              (file-name (git-file-name name version))
              (sha256
               (base32
                "05nl8y20xlmp3l0smzsapgf6yrhzf68kb50cwxxfka33zprgnf11"))))
    (build-system cmake-build-system)
    (arguments
     '(#:configure-flags '("-DBUILD_SHARED_LIBS=ON"
MARAIT Gilles's avatar
MARAIT Gilles committed
496
                           "-DPASTIX_WITH_MPI=ON"
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
                           "-DPASTIX_WITH_STARPU=ON")

       #:phases (modify-phases %standard-phases
                  (add-before 'check 'prepare-test-environment
                    (lambda _
                      ;; StarPU expects $HOME to be writable.
                      (setenv "HOME" (getcwd))

                      ;; The Python-driven tests want to dlopen PaSTiX
                      ;; libraries (via ctypes) so we need to help them.
                      (let* ((libraries   (find-files "." "\\.so$"))
                             (directories (map (compose canonicalize-path
                                                        dirname)
                                               libraries)))
                        (setenv "LD_LIBRARY_PATH"
                                (string-join directories ":"))

                        ;; 'ctypes.util.find_library' tries to link with
                        ;; -lpastix.
                        (setenv "LIBRARY_PATH"
                                (string-append (getenv "LIBRARY_PATH") ":"
                                               (getenv "LD_LIBRARY_PATH")))

                        ;; Allow the 'python_simple' test to find spm.py.
                        (setenv "PYTHONPATH"
                                (string-append (getcwd) "/../source"
                                               "/spm/wrappers/python/spm:"
                                               (getenv "PYTHONPATH")))
                        #t))))

       ;; XXX: The 'python_simple' test fails with:
       ;;   ValueError: Attempted relative import in non-package
       #:tests? #f))
    (native-inputs
     `(("pkg-config" ,pkg-config)
       ("gfortran" ,gfortran)))
    (inputs
     `(("gfortran:lib" ,gfortran "lib")           ;for 'gcc … -lgfortran'
       ("openblas" ,openblas)
       ("lapack" ,lapack)         ;must be built with '-DLAPACKE_WITH_TMG=ON'

       ;; The following are optional dependencies.
       ("metis" ,metis)
540
       ("starpu" ,starpu)
541
542
543
544
545
546
547
548
549
550

       ;; Python bindings and Python tests.
       ;;
       ;; XXX: The "Generate precision dependencies" CMake machinery uses the
       ;; "import imp", which is deprecated in Python 3 and leads to failures
       ;; down the road.  Thus, stick to Python 2 for now.
       ("python2" ,python-2)

       ("python-numpy" ,python2-numpy)
       ("python-scipy" ,python2-scipy)))
MARAIT Gilles's avatar
MARAIT Gilles committed
551
552
    (propagated-inputs `(("hwloc" ,hwloc "lib")
                         ("scotch" ,scotch)))
553
554
555
    (synopsis "Sparse matrix direct solver")
    (description
     "PaStiX (Parallel Sparse matriX package) is a scientific library that
Ludovic Courtès's avatar
Ludovic Courtès committed
556
557
558
559
560
561
provides a high performance parallel solver for very large sparse linear
systems based on direct methods.  Numerical algorithms are implemented in
single or double precision (real or complex) using LLt, LDLt and LU with
static pivoting (for non symmetric matrices having a symmetric pattern).
This solver also provides some low-rank compression methods to reduce the
memory footprint and/or the time-to-solution.")
562
    (license license:cecill)))
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856

(define-public pastix-5
  (package
  (inherit pastix-6)
  (name "pastix")
  (version "5.2.3")
  (source (origin
            (method url-fetch)
            (uri (string-append "https://gforge.inria.fr/frs/download.php/file/36212/pastix_5.2.3.tar.bz2"))
            (sha256
             (base32
              "0iqyxr5lzjpavmxzrjj4kwayq62nip3ssjcm80d20zk0n3k7h6b4"))))
  (build-system gnu-build-system)
  (arguments
   '(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
     #:phases
     (modify-phases %standard-phases
                    (add-after 'unpack 'goto-src-dir
                             (lambda _
                               (chdir "src") #t))
                    (replace 'configure
                             (lambda _
                               (call-with-output-file "config.in"
                                 (lambda (port)
                                   (format port "
HOSTARCH    = i686_pc_linux
VERSIONBIT  = _32bit
EXEEXT      =
OBJEXT      = .o
LIBEXT      = .a
CCPROG      = gcc -Wall
CFPROG      = gfortran
CF90PROG    = gfortran -ffree-form
CXXPROG     = g++

MCFPROG     = mpif90
CF90CCPOPT  = -ffree-form -x f95-cpp-input
# Compilation options for optimization (make expor)
CCFOPT      = -O3
# Compilation options for debug (make | make debug)
CCFDEB      = -g3
CXXOPT      = -O3
NVCCOPT     = -O3

LKFOPT      =
MKPROG      = make
MPCCPROG    = mpicc -Wall
MPCXXPROG   = mpic++ -Wall
CPP         = cpp
ARFLAGS     = ruv
ARPROG      = ar
EXTRALIB    = -lgfortran -lm -lrt
CTAGSPROG   = ctags

VERSIONMPI  = _mpi
VERSIONSMP  = _smp
VERSIONSCH  = _static
VERSIONINT  = _int
VERSIONPRC  = _simple
VERSIONFLT  = _real
VERSIONORD  = _scotch

###################################################################
#                  SETTING INSTALL DIRECTORIES                    #
###################################################################
# ROOT          = /path/to/install/directory
# INCLUDEDIR    = ${ROOT}/include
# LIBDIR        = ${ROOT}/lib
# BINDIR        = ${ROOT}/bin
# PYTHON_PREFIX = ${ROOT}

###################################################################
#                  SHARED LIBRARY GENERATION                      #
###################################################################
#SHARED=1
#SOEXT=.so
#SHARED_FLAGS =  -shared -Wl,-soname,__SO_NAME__
#CCFDEB       := ${CCFDEB} -fPIC
#CCFOPT       := ${CCFOPT} -fPIC
#CFPROG       := ${CFPROG} -fPIC

###################################################################
#                          INTEGER TYPE                           #
###################################################################
# Uncomment the following lines for integer type support (Only 1)

#VERSIONINT  = _long
#CCTYPES     = -DFORCE_LONG -DINTSIZELONG
#---------------------------
VERSIONINT  = _int32
CCTYPES     = -DINTSIZE32
#---------------------------
#VERSIONINT  = _int64
#CCTYPES     = -DINTSSIZE64

###################################################################
#                           FLOAT TYPE                            #
###################################################################
CCTYPESFLT  =
# Uncomment the following lines for double precision support
VERSIONPRC  = _double
CCTYPESFLT := $(CCTYPESFLT) -DPREC_DOUBLE

# Uncomment the following lines for float=complex support
VERSIONFLT  = _complex
CCTYPESFLT := $(CCTYPESFLT) -DTYPE_COMPLEX

###################################################################
#                          FORTRAN MANGLING                       #
###################################################################
#CCTYPES    := $(CCTYPES) -DPASTIX_FM_NOCHANGE

###################################################################
#                          MPI/THREADS                            #
###################################################################

# Uncomment the following lines for sequential (NOMPI) version
#VERSIONMPI  = _nompi
#CCTYPES    := $(CCTYPES) -DFORCE_NOMPI
#MPCCPROG    = $(CCPROG)
#MCFPROG     = $(CFPROG)
#MPCXXPROG   = $(CXXPROG)

# Uncomment the following lines for non-threaded (NOSMP) version
#VERSIONSMP  = _nosmp
#CCTYPES    := $(CCTYPES) -DFORCE_NOSMP

# Uncomment the following line to enable a progression thread,
#  then use IPARM_THREAD_COMM_MODE
#CCPASTIX   := $(CCPASTIX) -DPASTIX_THREAD_COMM

# Uncomment the following line if your MPI doesn't support MPI_THREAD_MULTIPLE,
# level then use IPARM_THREAD_COMM_MODE
#CCPASTIX   := $(CCPASTIX) -DPASTIX_FUNNELED

# Uncomment the following line if your MPI doesn't support MPI_Datatype
# correctly
#CCPASTIX   := $(CCPASTIX) -DNO_MPI_TYPE

# Uncomment the following line if you want to use semaphore barrier
# instead of MPI barrier (with IPARM_AUTOSPLIT_COMM)
#CCPASTIX    := $(CCPASTIX) -DWITH_SEM_BARRIER

# Uncomment the following lines to enable StarPU.
#CCPASTIX   := $(CCPASTIX) `pkg-config libstarpu --cflags` -DWITH_STARPU
#EXTRALIB   := $(EXTRALIB) `pkg-config libstarpu --libs`
# Uncomment the correct 2 lines
#CCPASTIX   := $(CCPASTIX) -DCUDA_SM_VERSION=11
#NVCCOPT    := $(NVCCOPT) -maxrregcount 32 -arch sm_11
#CCPASTIX   := $(CCPASTIX) -DCUDA_SM_VERSION=13
#NVCCOPT    := $(NVCCOPT) -maxrregcount 32 -arch sm_13
CCPASTIX   := $(CCPASTIX) -DCUDA_SM_VERSION=20
NVCCOPT    := $(NVCCOPT) -arch sm_20

# Uncomment the following line to enable StarPU profiling
# ( IPARM_VERBOSE > API_VERBOSE_NO ).
#CCPASTIX   := $(CCPASTIX) -DSTARPU_PROFILING

# Uncomment the following line to enable CUDA (StarPU)
#CCPASTIX   := $(CCPASTIX) -DWITH_CUDA

###################################################################
#                          Options                                #
###################################################################

# Show memory usage statistics
#CCPASTIX   := $(CCPASTIX) -DMEMORY_USAGE

# Show memory usage statistics in solver
#CCPASTIX   := $(CCPASTIX) -DSTATS_SOPALIN

# Uncomment following line for dynamic thread scheduling support
#CCPASTIX   := $(CCPASTIX) -DPASTIX_DYNSCHED

# Uncomment the following lines for Out-of-core
#CCPASTIX   := $(CCPASTIX) -DOOC -DOOC_NOCOEFINIT -DOOC_DETECT_DEADLOCKS

###################################################################
#                      GRAPH PARTITIONING                         #
###################################################################

# Uncomment the following lines for using metis ordering
#VERSIONORD  = _metis
#METIS_HOME  = ${HOME}/metis-4.0
#CCPASTIX   := $(CCPASTIX) -DMETIS -I$(METIS_HOME)/Lib
#EXTRALIB   := $(EXTRALIB) -L$(METIS_HOME) -lmetis

# Scotch always needed to compile
SCOTCH_HOME ?= ${HOME}/scotch_5.1/
SCOTCH_INC ?= $(SCOTCH_HOME)/include
SCOTCH_LIB ?= $(SCOTCH_HOME)/lib
# Uncomment on of this blocks
#scotch
#CCPASTIX   := $(CCPASTIX) -I$(SCOTCH_INC) -DWITH_SCOTCH
#EXTRALIB   := $(EXTRALIB) -L$(SCOTCH_LIB) -lscotch -lscotcherrexit
#ptscotch
CCPASTIX   := $(CCPASTIX) -I$(SCOTCH_INC) -DDISTRIBUTED -DWITH_SCOTCH
#if scotch >= 6.0
EXTRALIB   := $(EXTRALIB) -L$(SCOTCH_LIB) -lptscotch -lscotch -lptscotcherrexit
#else
#EXTRALIB   := $(EXTRALIB) -L$(SCOTCH_LIB) -lptscotch -lptscotcherrexit

###################################################################
#                Portable Hardware Locality                       #
###################################################################
# By default PaStiX uses hwloc to bind threads,
# comment this lines if you don't want it (not recommended)
HWLOC_HOME ?= /opt/hwloc/
HWLOC_INC  ?= $(HWLOC_HOME)/include
HWLOC_LIB  ?= $(HWLOC_HOME)/lib
CCPASTIX   := $(CCPASTIX) -I$(HWLOC_INC) -DWITH_HWLOC
EXTRALIB   := $(EXTRALIB) -L$(HWLOC_LIB) -lhwloc

###################################################################
#                             MARCEL                              #
###################################################################

# Uncomment following lines for marcel thread support
#VERSIONSMP := $(VERSIONSMP)_marcel
#CCPASTIX   := $(CCPASTIX) `pm2-config --cflags` -I${PM2_ROOT}/marcel/include/pthread
#EXTRALIB   := $(EXTRALIB) `pm2-config --libs`
# ---- Thread Posix ------
EXTRALIB   := $(EXTRALIB) -lpthread

# Uncomment following line for bubblesched framework support
# (need marcel support)
#VERSIONSCH  = _dyn
#CCPASTIX   := $(CCPASTIX) -DPASTIX_BUBBLESCHED

###################################################################
#                              BLAS                               #
###################################################################

# Choose Blas library (Only 1)
# Do not forget to set BLAS_HOME if it is not in your environnement
# BLAS_HOME=/path/to/blas
#----  Blas    ----
BLASLIB  = -lblas
#---- Gotoblas ----
#BLASLIB  = -L${BLAS_HOME} -lgoto
#----  MKL     ----
#Uncomment the correct line
#BLASLIB  = -L$(BLAS_HOME) -lmkl_intel_lp64 -lmkl_sequential -lmkl_core
#BLASLIB  = -L$(BLAS_HOME) -lmkl_intel -lmkl_sequential -lmkl_core
#----  Acml    ----
#BLASLIB  = -L$(BLAS_HOME) -lacml

###################################################################
#                             MURGE                               #
###################################################################
# Uncomment if you need MURGE interface to be thread safe
# CCPASTIX   := $(CCPASTIX) -DMURGE_THREADSAFE
# Uncomment this to have more timings inside MURGE
# CCPASTIX   := $(CCPASTIX) -DMURGE_TIME

###################################################################
#                          DO NOT TOUCH                           #
###################################################################

FOPT      := $(CCFOPT)
FDEB      := $(CCFDEB)
CCHEAD    := $(CCPROG) $(CCTYPES) $(CCFOPT)
CCFOPT    := $(CCFOPT) $(CCTYPES) $(CCPASTIX)
CCFDEB    := $(CCFDEB) $(CCTYPES) $(CCPASTIX)
NVCCOPT   := $(NVCCOPT) $(CCTYPES) $(CCPASTIX)

###################################################################
#                        MURGE COMPATIBILITY                      #
###################################################################

MAKE     = $(MKPROG)
CC       = $(MPCCPROG)
CFLAGS   = $(CCFOPT) $(CCTYPESFLT)
FC       = $(MCFPROG)
FFLAGS   = $(CCFOPT)
LDFLAGS  = $(EXTRALIB) $(BLASLIB)
CTAGS    = $(CTAGSPROG)
"
                                   ))) #t))
                    (replace 'check
                             (lambda _
                               (invoke "make" "examples")
                               (invoke "./example/bin/simple" "-lap" "100"))))))
  (native-inputs `(("perl" ,perl)
                   ,@(package-native-inputs pastix-6)))
  (propagated-inputs `(("openmpi" ,openmpi-with-mpi1-compat)
                       ("openssh" ,openssh)
                       ("scotch32" ,scotch32)
                       ("pt-scotch" ,pt-scotch)
                       ,@(package-propagated-inputs pastix-6)
                       ,@(alist-delete "scotch"
                                       (package-propagated-inputs pastix-6))))))

(define-public pastix pastix-6)
AGULLO Emmanuel's avatar
AGULLO Emmanuel committed
857
858
859
860
861
862
863
864
865
866
867
868
869
870

(define-public pastix-nopython-notest
  (package
   (inherit pastix)
   (name "pastix-nopython-notest")
   (arguments
    (substitute-keyword-arguments (package-arguments chameleon)
                                  ((#:configure-flags flags '())
                                   `(cons "-DPASTIX_BUILD_TESTING=OFF" ,flags))))
   (inputs `(
             ,@(delete `("python2" ,python-2) (package-inputs pastix))
             ,@(delete `("python2-numpy" ,python2-numpy) (package-inputs pastix))
             ,@(delete `("python2-scipy" ,python2-scipy) (package-inputs pastix))
             ))))