guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

06/45: reppar: More on StarPU and Chameleon.


From: Ludovic Courtès
Subject: 06/45: reppar: More on StarPU and Chameleon.
Date: Tue, 09 Jun 2015 12:36:59 +0000

civodul pushed a commit to branch master
in repository maintenance.

commit 8cd7f55cb60af98f19f55b8dca370cadba45ce08
Author: Ludovic Courtès <address@hidden>
Date:   Fri May 29 17:26:34 2015 +0200

    reppar: More on StarPU and Chameleon.
---
 doc/reppar-2015/code/starpu.scm      |   89 ++++++++++++++++++++++-----------
 doc/reppar-2015/reproducible-hpc.skb |   42 +++++++++++++++-
 2 files changed, 99 insertions(+), 32 deletions(-)

diff --git a/doc/reppar-2015/code/starpu.scm b/doc/reppar-2015/code/starpu.scm
index 854c28f..346b02b 100644
--- a/doc/reppar-2015/code/starpu.scm
+++ b/doc/reppar-2015/code/starpu.scm
@@ -52,9 +52,9 @@
               ,@(package-inputs starpu)))))
 ;!end-starpu-variants
 
-(define (package-with-different-input original label replacement)
+(define (override-input original label replacement)
   ;; Return a variant of ORIGINAL where inputs corresponding
-  ;; to LABEL are replaced with REPLACEMENT.
+  ;; to LABEL are replaced by REPLACEMENT, recursively.
   (package (inherit original)
     (inputs (map (lambda (input)
                    (match input
@@ -62,34 +62,63 @@
                       (if (string=? input-label label)
                           `(,label ,replacement)
                           `(,label
-                            ,(package-with-different-input
-                              package label replacement))))))
+                            ,(override-input package
+                                             label replacement))))))
                  (package-inputs original)))))
 
-(define chameleon
+'(begin                                        ;incomplete code follows
+;;!begin-chameleon
+   (define (make-chameleon name starpu)
+     (package
+       (name name)
+       (version "0.9")
+       ;; [other fields omitted]
+       (inputs `(("starpu" ,starpu)
+                 ("blas" ,atlas)
+                 ("lapack" ,lapack)
+                 ("gfortran" ,gfortran-4.8)
+                 ("python" ,python-2)))))
+
+   (define chameleon
+     (make-chameleon "chameleon" starpu))
+
+   (define chameleon/starpu-simgrid
+     (make-chameleon "chameleon-simgrid" starpu-with-simgrid))
+;;!end-chameleon
+   )
+
+
+
+(define real-chameleon
   (package
-    (name "chameleon")
-    (version "0.9")
-    (source (origin
-             (method url-fetch)
-             (uri (string-append
-                   "https://project.inria.fr/chameleon/files/2015/02/";
-                   "chameleon-" version ".tar_.gz"))
-             (sha256
-              (base32
-               "0zglkqazx5r5r60w881x3ksws96f304k24d0h3ixml1rrrnxrgl1"))
-             (file-name (string-append name "-" version
-                                       ".tar.gz"))))
-    (build-system cmake-build-system)
-    (arguments
-     '(#:configure-flags '("-DMORSE_VERBOSE_FIND_PACKAGE=ON"
-                           "-DBLAS_VERBOSE=ON")))
-    (inputs `(("starpu" ,starpu)
-              ("blas" ,atlas)
-              ("lapack" ,lapack)))
-    (native-inputs `(("gfortran" ,gfortran-4.8)
-                     ("python" ,python-2)))
-    (home-page "https://project.inria.fr/chameleon/";)
-    (synopsis "Dense linear algebra solver")
-    (description "Blah...")
-    (license #f)))
+   (name "chameleon")
+   (version "0.9")
+   (source (origin
+            (method url-fetch)
+            (uri (string-append
+                  "https://project.inria.fr/chameleon/files/2015/02/";
+                  "chameleon-" version ".tar_.gz"))
+            (sha256
+             (base32
+              "0zglkqazx5r5r60w881x3ksws96f304k24d0h3ixml1rrrnxrgl1"))
+            (file-name (string-append name "-" version
+                                      ".tar.gz"))))
+   (build-system cmake-build-system)
+   (arguments
+    '(#:configure-flags (list "-DMORSE_VERBOSE_FIND_PACKAGE=ON"
+                              ;; "-DBLAS_VERBOSE=ON"
+                              "-DBLA_VENDOR=ATLAS"
+                              "-DLAPACK_VERBOSE=ON"
+                              (string-append "-DLAPACK_DIR="
+                                             (assoc-ref
+                                              %build-inputs
+                                              "lapack")))))
+   (inputs `(("starpu" ,starpu)
+             ("blas" ,atlas)
+             ("lapack" ,lapack)))
+   (native-inputs `(("gfortran" ,gfortran-4.8)
+                    ("python" ,python-2)))
+   (home-page "https://project.inria.fr/chameleon/";)
+   (synopsis "Dense linear algebra solver")
+   (description "Blah...")
+   (license #f)))
diff --git a/doc/reppar-2015/reproducible-hpc.skb 
b/doc/reppar-2015/reproducible-hpc.skb
index caf35fc..16d81e3 100644
--- a/doc/reppar-2015/reproducible-hpc.skb
+++ b/doc/reppar-2015/reproducible-hpc.skb
@@ -460,8 +460,46 @@ defined to refer precisely to the inputs specified in the 
recipe.  This
 amounts to creating a profile on the fly, containing only the tools and
 libraries necessary when developing StarPU.  This is notably useful when
 dealing with build systems that support optional dependencies.])
-         (p (bold [TODO: something about rewriting the Chameleon DAG]))
-         )
+         
+         (figure
+            :legend [Defining a function that returns a package object
+for the Chameleon solver.]
+            :ident "fig-chameleon"
+
+            (prog :line #f :mark #f
+               (source :language scheme :file "code/starpu.scm"
+                  :start ";;!begin-chameleon"
+                  :stop ";;!end-chameleon")))
+
+         (p [Now that we have several StarPU variants, we allow direct
+and indirect uses to select the variant that they want.  A simple way to
+do that is to write, say, a ,(tt [make-chameleon]) function that takes a
+,(tt [starpu]) parameter and uses it as its input.  As ,(numref :text
+[Figure] :ident "fig-chameleon") shows, we can then call that function
+to create the relevant variants of Chameleon.  To allow users to refer
+to one or the other variant at the command line, we use different
+values for the ,(tt [name]) field.])
+         
+         (figure
+            :legend [Rewriting a package DAG by changing a specific input.]
+            :ident "fig-override"
+            
+            (prog :line #f :mark #f
+               (source :language scheme :file "code/starpu.scm"
+                  :definition 'override-input)))
+
+         (p [This approach is reasonable when there is a small number of
+variants, but it does not scale to more complex DAGs.  As an example,
+StarPU can be built with MPI support, in which case Chameleon also needs
+to be explicitly linked against the same MPI implementation.  Users may
+want to replace all occurrences of an MPI implementation in the DAG
+rooted at Chameleon with a different implementation.  One way to do that
+is by writing a function that recursively adjusts the package labeled
+,(tt ["mpi"]) in the ,(tt [inputs]) field of packages.  This is what the
+,(tt [override-input]) function in ,(numref :text [Figure] :ident
+"fig-override") does.])
+         (p [No matter how complex the transformations are, a package
+object unambiguously represents a reproducible build process.]))
 
       (section :title [Going Further]  ;active papers
          :ident "active"))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]