public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Andrea Arteaga" <andyspiros@gmail.com>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/auto-numerical-bench:master commit in: /
Date: Mon, 15 Aug 2011 21:57:42 +0000 (UTC)	[thread overview]
Message-ID: <aa13341c53fb1fb13dda9bcabaa8e78f23c57a65.spiros@gentoo> (raw)

commit:     aa13341c53fb1fb13dda9bcabaa8e78f23c57a65
Author:     Andrea Arteaga <andyspiros <AT> gmail <DOT> com>
AuthorDate: Mon Aug 15 21:57:04 2011 +0000
Commit:     Andrea Arteaga <andyspiros <AT> gmail <DOT> com>
CommitDate: Mon Aug 15 21:57:04 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/auto-numerical-bench.git;a=commit;h=aa13341c

Added instructions and more samples.

---
 basemodule.py     |    4 +++
 benchprint.py     |    2 +-
 fftw.py           |    4 +++
 main.py           |   60 ++++++++++++++++++++++++++++++-----------------------
 metis.py          |    3 ++
 metistests.in     |    2 +
 scalapacktests.in |    2 +
 7 files changed, 50 insertions(+), 27 deletions(-)

diff --git a/basemodule.py b/basemodule.py
index 6185774..7eda37f 100644
--- a/basemodule.py
+++ b/basemodule.py
@@ -69,6 +69,10 @@ class BaseModule:
             return []
         else:
             return [i.split()[0] for i in output.split('\n')] 
+        
+    # Alternatives-2 version
+    def instructionsFor(self, impl):
+        Print("# eselect " + self.libname + " set " + impl)
            
     def getTest(self, root, impl, testdir, logdir):
         TestClass = self._testClass()

diff --git a/benchprint.py b/benchprint.py
index b37acbc..0836bbe 100644
--- a/benchprint.py
+++ b/benchprint.py
@@ -14,7 +14,7 @@ if needsinitialization:
             self._maxlevel = maxlevel
             self._logfile = logfile
         
-        def __call__(self, arg):
+        def __call__(self, arg='\n'):
             if self._level > self._maxlevel:
                 return
                 

diff --git a/fftw.py b/fftw.py
index dd2b6e8..1d97c02 100644
--- a/fftw.py
+++ b/fftw.py
@@ -32,6 +32,10 @@ class Module(btlbase.BTLBase):
     @staticmethod
     def get_impls(root):
         return ['fftw', 'fftw_threads']
+        
+    def instructionsFor(self, impl):
+        Print("Use command 'pkg-config --cflags --libs " + impl + \
+              "' when compiling")
     
     @staticmethod
     def _testClass():

diff --git a/main.py b/main.py
index 4be9802..539e4ff 100755
--- a/main.py
+++ b/main.py
@@ -114,15 +114,11 @@ def tests_from_input(input):
             else:
                 e_0, e_1 = var.split('=', 1)
                 env[e_0] = e_1
-        avail = available_packages(spl[1])
-        if len(avail) > 1:
-            for n,p in enumerate(avail):
-                tests[spl[0]+"_%02i"%n] = {'package':p , 'env':env, \
-                  'skip':skip, 'changes':change, 'descr':descr}
-        elif len(avail) == 1:
-            tests[spl[0]] = {'package':avail[0] , 'env':env, 'skip':skip, \
+        try:
+            avail = available_packages(spl[1])[-1]
+            tests[spl[0]] = {'package':avail , 'env':env, 'skip':skip, \
               'changes':change, 'descr':descr}
-        else:
+        except:
             sys.stderr.write('Error: package ' + spl[1] + ' not found\n')
     return tests
 
@@ -237,8 +233,11 @@ for tn,(name,test) in enumerate(cfg.tests.items(),1):
     Print.down()
     package = normalize_cpv(test['package'])
     archive = pjoin(pkgdir, package+".tbz2")
+    test['pkgdir'] = pkgdir
+    test['archive'] = archive
     if os.path.exists(archive):
         Print("Package already emerged - skipping")
+        test['emergesuccess'] = True
     else:
         try:
             # Emerge dependencies
@@ -256,26 +255,10 @@ for tn,(name,test) in enumerate(cfg.tests.items(),1):
               test['package'], env=test['env'], root=root, pkgdir=pkgdir, \
               logfile=logfile
               )
-#            archives.append(archive)
-            
-            # Unpack the archive onto the given root directory
-#            Print("Unpacking packages")
-#            logfile = pjoin(tlogdir, 'tar.log')
-#            Print("(Run 'tail -f " + logfile + "' on another terminal" \
-#              + " to see the progress)")
-#            logfile = file(logfile, 'w')
-#            tarcmds = [['tar', 'xvjf', a, '-C', root] for a in archives]
-#            os.path.exists(root) or os.makedirs(root)
-#            tarcmd = ['tar', 'xjf', archive, '-C', root]
-#            for c in tarcmds:
-#                logfile.write(' '.join(c) + '\n' + 80*'-' + '\n')
-#                tarp = sp.Popen(c, stdout=sp.PIPE, stderr=sp.STDOUT)
-#                logfile.write(tarp.communicate()[0])
-#                logfile.write('\n\n' + 80*'#' + '\n\n')
-#                if tarp.returncode != 0:
-#                    raise InstallException(tarcmd, logfile.name)
+            test['emergesuccess'] = True
                 
         except InstallException as e:
+            test['emergesuccess'] = False
             Print("Package %s failed to emerge" % package)
             Print("Error log: " + e.logfile)
             Print.up()
@@ -319,3 +302,28 @@ for (name,test) in cfg.tests.items():
             results[(name, impl)] = test['results'][impl]
 
 mod.save_results(results)
+
+
+Print._level = 0
+Print()
+# Print instructions
+for name,test in cfg.tests.items():
+    if not test['emergesuccess']:
+        continue
+    printstr = "Instructions for " + name + ":"
+    Print(printstr)
+    Print(len(printstr)*'-')
+    Print.down()
+    Print("# PKGDIR=" + test['pkgdir'] + " emerge -K '=" + \
+          normalize_cpv(test['package']) + "'")
+    try:
+        for impl in test['implementations']:
+            Print("Implementation " + impl + ":")
+            Print.down()
+            mod.instructionsFor(impl)
+            Print.up()
+    except:
+        pass
+        
+    Print.up()
+    Print()

diff --git a/metis.py b/metis.py
index c65d8a8..f3ad768 100644
--- a/metis.py
+++ b/metis.py
@@ -40,6 +40,9 @@ class Module(basemodule.BaseModule):
     @staticmethod
     def get_impls(*args, **kwargs):
         return ('metis',)
+        
+    def instructionsFor(self, impl):
+        Print("Nothing to do")
     
     def save_results(self, results):
         basemodule.BaseModule.save_results(self, results, 'loglog', 'Seconds')

diff --git a/metistests.in b/metistests.in
new file mode 100644
index 0000000..76de6bb
--- /dev/null
+++ b/metistests.in
@@ -0,0 +1,2 @@
+metis sci-libs/metis-4.0.1-r1 CFLAGS="-march=native"
+metis-O3 sci-libs/metis-4.0.1-r1 CFLAGS="-march=native -O3"
\ No newline at end of file

diff --git a/scalapacktests.in b/scalapacktests.in
new file mode 100644
index 0000000..e32c0fb
--- /dev/null
+++ b/scalapacktests.in
@@ -0,0 +1,2 @@
+reference sci-libs/scalapack-1.8.0 FFLAGS="-march=native"
+reference-O3 sci-libs/scalapack-1.8.0 FFLAGS="-march=native -O3"
\ No newline at end of file



             reply	other threads:[~2011-08-15 21:57 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-15 21:57 Andrea Arteaga [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-09-02 11:41 [gentoo-commits] proj/auto-numerical-bench:master commit in: / Andrea Arteaga
2012-08-11 18:00 Andrea Arteaga
2012-08-04  1:11 Andrea Arteaga
2012-04-09 22:58 Andrea Arteaga
2012-03-05 15:48 Andrea Arteaga
2012-02-28 19:20 Andrea Arteaga
2012-02-24 17:22 Andrea Arteaga
2011-08-22 18:15 Andrea Arteaga
2011-08-16 23:38 Andrea Arteaga
2011-08-14 12:59 Andrea Arteaga
2011-08-14 12:35 Andrea Arteaga
2011-08-12 22:56 Andrea Arteaga
2011-08-09  0:00 Andrea Arteaga
2011-08-09  0:00 Andrea Arteaga
2011-07-17  0:21 Andrea Arteaga
2011-07-13 21:48 Andrea Arteaga
2011-06-15 23:25 Andrea Arteaga
2011-06-15 12:56 Andrea Arteaga
2011-06-13 23:53 Andrea Arteaga
2011-06-13 14:12 Andrea Arteaga
2011-06-10  1:02 Andrea Arteaga
2011-06-10  0:52 Andrea Arteaga
2011-06-06 20:05 Andrea Arteaga

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aa13341c53fb1fb13dda9bcabaa8e78f23c57a65.spiros@gentoo \
    --to=andyspiros@gmail.com \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox