summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Arteaga <andyspiros@gmail.com>2011-08-15 23:57:04 +0200
committerAndrea Arteaga <andyspiros@gmail.com>2011-08-15 23:57:04 +0200
commitaa13341c53fb1fb13dda9bcabaa8e78f23c57a65 (patch)
treefbe5396d190541094cccdfb246b2252a90065690
parentSolved bug in benchprint (diff)
downloadauto-numerical-bench-aa13341c53fb1fb13dda9bcabaa8e78f23c57a65.tar.gz
auto-numerical-bench-aa13341c53fb1fb13dda9bcabaa8e78f23c57a65.tar.bz2
auto-numerical-bench-aa13341c53fb1fb13dda9bcabaa8e78f23c57a65.zip
Added instructions and more samples.
-rw-r--r--basemodule.py4
-rw-r--r--benchprint.py2
-rw-r--r--fftw.py4
-rwxr-xr-xmain.py60
-rw-r--r--metis.py3
-rw-r--r--metistests.in2
-rw-r--r--scalapacktests.in2
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