* [gentoo-commits] proj/auto-numerical-bench:master commit in: numbench/
@ 2011-08-17 0:00 Andrea Arteaga
0 siblings, 0 replies; 21+ messages in thread
From: Andrea Arteaga @ 2011-08-17 0:00 UTC (permalink / raw
To: gentoo-commits
commit: 19ddea81510b2426162ee6e3a1ebac3ff96e61ed
Author: Andrea Arteaga <andyspiros <AT> gmail <DOT> com>
AuthorDate: Wed Aug 17 00:00:06 2011 +0000
Commit: Andrea Arteaga <andyspiros <AT> gmail <DOT> com>
CommitDate: Wed Aug 17 00:00:06 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/auto-numerical-bench.git;a=commit;h=19ddea81
Solved import issue.
---
numbench/main.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/numbench/main.py b/numbench/main.py
index f71de0b..586fb20 100755
--- a/numbench/main.py
+++ b/numbench/main.py
@@ -93,7 +93,7 @@ try:
# Normal run: import module
cfg.inputfile = os.path.abspath(sys.argv[2])
os.chdir(cfg.scriptdir)
- tmp = __import__(sys.argv[1], fromlist = ['Module'])
+ tmp = __import__('numbench.'+sys.argv[1], fromlist = ['Module'])
mod = tmp.Module(sys.argv[3:])
del tmp
cfg.makedirs()
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [gentoo-commits] proj/auto-numerical-bench:master commit in: numbench/
@ 2011-08-17 14:38 Andrea Arteaga
0 siblings, 0 replies; 21+ messages in thread
From: Andrea Arteaga @ 2011-08-17 14:38 UTC (permalink / raw
To: gentoo-commits
commit: 0ff848839497ddfd2b2c44f5a8d13fef821fdf9b
Author: Andrea Arteaga <andyspiros <AT> gmail <DOT> com>
AuthorDate: Wed Aug 17 10:11:22 2011 +0000
Commit: Andrea Arteaga <andyspiros <AT> gmail <DOT> com>
CommitDate: Wed Aug 17 10:11:22 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/auto-numerical-bench.git;a=commit;h=0ff84883
Added informations and solved bug within benchprint.
---
numbench/benchprint.py | 2 +-
numbench/main.py | 43 +++++++++++++++++++++++--------------------
2 files changed, 24 insertions(+), 21 deletions(-)
diff --git a/numbench/benchprint.py b/numbench/benchprint.py
index 9cca417..e0e5051 100644
--- a/numbench/benchprint.py
+++ b/numbench/benchprint.py
@@ -22,7 +22,7 @@ if needsinitialization:
# Print to logfile
bu.mkdir(dirname(self._logfile))
logfile = file(self._logfile, 'a')
- print >> logfile, str(arg)
+ print >> logfile, printstr
logfile.close()
# Print to terminal
diff --git a/numbench/main.py b/numbench/main.py
index 586fb20..3eb8da1 100755
--- a/numbench/main.py
+++ b/numbench/main.py
@@ -93,7 +93,7 @@ try:
# Normal run: import module
cfg.inputfile = os.path.abspath(sys.argv[2])
os.chdir(cfg.scriptdir)
- tmp = __import__('numbench.'+sys.argv[1], fromlist = ['Module'])
+ tmp = __import__(sys.argv[1], fromlist = ['Module'])
mod = tmp.Module(sys.argv[3:])
del tmp
cfg.makedirs()
@@ -144,31 +144,34 @@ input = file(cfg.inputfile).read()
cfg.tests = tests_from_input(input)
# Write summary
-print 80*'='
-print "The following tests will be run:"
-print "-------------------------------"
-print
+Print._level = 0
+Print(80*'=')
+Print("The following tests will be run:")
+Print("-------------------------------")
+Print()
for tname, ttest in cfg.tests.items():
- print "Test: " + tname
+ Print("Test: " + tname)
if ttest['descr'] is not None:
- print " - Description: " + ttest['descr']
- print " - Package: " + normalize_cpv(ttest['package'])
+ Print(" - Description: " + ttest['descr'])
+ Print(" - Package: " + normalize_cpv(ttest['package']))
if len(ttest['env']) != 0:
- print " - Environment: " + \
- ' '.join([n+'="'+v+'"' for n,v in ttest['env'].items()])
+ Print(" - Environment: " + \
+ ' '.join([n+'="'+v+'"' for n,v in ttest['env'].items()]))
if len(ttest['skip']) != 0:
- print " - Skip implementations: " + ' '.join(ttest['skip'])
+ Print(" - Skip implementations: " + ' '.join(ttest['skip']))
if len(ttest['changes']) != 0:
- print " - Dependency specifications:",
+ Print(" - Dependency specifications:",)
for c_0, c_1 in ttest['changes'].items():
- print c_0 + ':' + c_1,
- print
- print
-print 80*'='
-print
-print "The logs will be available in the directory " + cfg.logdir
-print "The results will be available in the directory " + cfg.reportdir
-print
+ Print(c_0 + ':' + c_1, '')
+ Print()
+ Print()
+Print(80*'=')
+Print()
+Print("The script is located in the directory" + cfg.scriptdir)
+Print("The BTL is located in the directory " + cfg.btldir)
+Print("The logs will be available in the directory " + cfg.logdir)
+Print("The results will be available in the directory " + cfg.reportdir)
+Print()
for tn,(name,test) in enumerate(cfg.tests.items(),1):
Print._level = 0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [gentoo-commits] proj/auto-numerical-bench:master commit in: numbench/
@ 2011-08-17 14:38 Andrea Arteaga
0 siblings, 0 replies; 21+ messages in thread
From: Andrea Arteaga @ 2011-08-17 14:38 UTC (permalink / raw
To: gentoo-commits
commit: 21af760fe7de8000f27d7f34b1188568957b3e12
Author: Andrea Arteaga <andyspiros <AT> gmail <DOT> com>
AuthorDate: Wed Aug 17 14:38:10 2011 +0000
Commit: Andrea Arteaga <andyspiros <AT> gmail <DOT> com>
CommitDate: Wed Aug 17 14:38:10 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/auto-numerical-bench.git;a=commit;h=21af760f
Added load average, childs killing, signal handler.
---
numbench/basemodule.py | 3 ++
numbench/benchchilds.py | 13 ++++++++++++
numbench/benchload.py | 44 +++++++++++++++++++++++++++++++++++++++++++
numbench/blas_accuracy.py | 2 +
numbench/btlbase.py | 19 ++++++++++++++---
numbench/lapack_accuracy.py | 2 +
numbench/main.py | 19 +++++++++++++++++-
numbench/metis.py | 2 +
numbench/testdescr.py | 8 +++++++
9 files changed, 107 insertions(+), 5 deletions(-)
diff --git a/numbench/basemodule.py b/numbench/basemodule.py
index c04b56c..332e528 100644
--- a/numbench/basemodule.py
+++ b/numbench/basemodule.py
@@ -10,6 +10,7 @@ from benchutils import mkdir, run_cmd
from benchprint import Print
import benchpkgconfig as pc
from testdescr import testdescr
+import benchload as load
try:
if not locals().has_key('initialized'):
@@ -219,6 +220,7 @@ class BaseTest:
return shlex.split(flags)
def run_test(self, changes={}):
+ load.start()
self.changes = changes
# Convenient renames and definition of report files
@@ -267,5 +269,6 @@ class BaseTest:
Print("Test successful")
# Return
+ load.stop()
return self._generateResults()
diff --git a/numbench/benchchilds.py b/numbench/benchchilds.py
new file mode 100644
index 0000000..87e9ac9
--- /dev/null
+++ b/numbench/benchchilds.py
@@ -0,0 +1,13 @@
+try:
+ copy = procs
+ del copy
+except:
+ procs = []
+
+def terminate():
+ for p in procs:
+ if p.poll() is None:
+ p.kill()
+
+def append(proc):
+ procs.append(proc)
\ No newline at end of file
diff --git a/numbench/benchload.py b/numbench/benchload.py
new file mode 100644
index 0000000..f226656
--- /dev/null
+++ b/numbench/benchload.py
@@ -0,0 +1,44 @@
+import sys, shlex, threading, time, subprocess as sp
+
+class PrintLoad(threading.Thread):
+
+ _active = False
+ _continue = True
+
+ def run(self):
+ while self._continue:
+ if self._active:
+ out = sp.check_output('uptime')
+ printstr = ' '.join(shlex.split(out)[-5:])
+ sys.stdout.flush()
+ sys.stdout.write(printstr + '\r')
+ sys.stdout.flush()
+ time.sleep(.5)
+
+ def setActive(self, active=True):
+ self._active = active
+
+ def stop(self):
+ self._continue = False
+
+
+
+def start():
+ printLoadThread.setActive(True)
+
+def stop():
+ printLoadThread.setActive(False)
+
+def close():
+ printLoadThread.stop()
+
+try:
+ needsinitialization = not initialized
+except:
+ needsinitialization = True
+
+if needsinitialization:
+ printLoadThread = PrintLoad()
+ printLoadThread.start()
+
+initialized = True
\ No newline at end of file
diff --git a/numbench/blas_accuracy.py b/numbench/blas_accuracy.py
index 021ac12..de90ffa 100644
--- a/numbench/blas_accuracy.py
+++ b/numbench/blas_accuracy.py
@@ -7,6 +7,7 @@ from benchprint import Print
from htmlreport import HTMLreport
import basemodule
import benchconfig as cfg
+import benchchilds
class Module(basemodule.BaseModule):
@@ -123,6 +124,7 @@ class BLAS_accuracyTest(basemodule.BaseTest):
logfile.write(80*'-' + '\n')
proc = sp.Popen(args, bufsize=1, stdout=sp.PIPE, stderr=sp.PIPE,
env=self.runenv, cwd=self.testdir)
+ benchchilds.append(proc)
# Interpret output
Print.down()
diff --git a/numbench/btlbase.py b/numbench/btlbase.py
index d64b1ed..d8b4f4a 100644
--- a/numbench/btlbase.py
+++ b/numbench/btlbase.py
@@ -7,6 +7,7 @@ from benchprint import Print
from htmlreport import HTMLreport
import basemodule
import benchconfig as cfg
+import benchchilds
from testdescr import testdescr
@@ -126,6 +127,7 @@ class BTLTest(basemodule.BaseTest):
logfile.write(80*'-' + '\n')
proc = sp.Popen(args, bufsize=1, stdout=sp.PIPE, stderr=sp.PIPE,
env=self.runenv, cwd=self.testdir)
+ benchchilds.append(proc)
# Interpret output
while True:
@@ -138,9 +140,11 @@ class BTLTest(basemodule.BaseTest):
testname = resfile[6:-5-len(self.libname)]
Print(resfile)
- # 100 different sizes for each operation test
+ # Many different sizes for each operation test
Print.down()
- for i in xrange(100):
+ cur = 0
+ tot = 1
+ while cur != tot:
outline = proc.stdout.readline()
# If the line is void, something gone wrong
if not outline:
@@ -148,8 +152,15 @@ class BTLTest(basemodule.BaseTest):
Print('Execution error')
return 1
logfile.write(outline)
- logfile.flush()
- Print(outline.strip())
+ logfile.flush()
+
+ # Interpret line
+ outline = outline.strip()
+ (cur, tot) = shlex.split(outline)[-1][1:-1].split('/')
+ cur = int(cur); tot = int(tot)
+ Print(outline)
+
+
Print.up()
logfile.close()
proc.wait()
diff --git a/numbench/lapack_accuracy.py b/numbench/lapack_accuracy.py
index f38709e..5e3d4c1 100644
--- a/numbench/lapack_accuracy.py
+++ b/numbench/lapack_accuracy.py
@@ -7,6 +7,7 @@ from benchprint import Print
from htmlreport import HTMLreport
import basemodule
import benchconfig as cfg
+import benchchilds
class Module(basemodule.BaseModule):
@@ -128,6 +129,7 @@ class LAPACK_accuracyTest(basemodule.BaseTest):
logfile.write(80*'-' + '\n')
proc = sp.Popen(args, bufsize=1, stdout=sp.PIPE, stderr=logfile,
env=self.runenv, cwd=self.testdir)
+ benchchilds.append(proc)
# Interpret output
Print.down()
diff --git a/numbench/main.py b/numbench/main.py
index 3eb8da1..5bdacd2 100755
--- a/numbench/main.py
+++ b/numbench/main.py
@@ -1,9 +1,22 @@
#! /usr/bin/env python2
-import os, sys, shlex, time
+import os, sys, signal, shlex, time
from os.path import join as pjoin
import subprocess as sp
+# Set the signal handler
+def close(*args):
+ load.close()
+ benchchilds.terminate()
+ Print._level = 0
+ Print()
+ Print(80*'-')
+ Print("INTERRUPT TRIGGERED")
+ Print("Exiting")
+ exit(0)
+signal.signal(signal.SIGINT, close)
+
+
def print_usage():
print "Usage: numbench [blas|cblas|lapack|scalapack|fftw|metis|" + \
"blas_accuracy|lapack_accuracy] file args"
@@ -65,6 +78,7 @@ def tests_from_input(input):
##########################
import benchconfig as cfg
+import benchchilds
# If no argument is given, print the help
if (len(sys.argv) < 2):
@@ -108,6 +122,7 @@ except IndexError:
from PortageUtils import *
from benchprint import Print
+import benchload as load
@@ -241,6 +256,8 @@ for tn,(name,test) in enumerate(cfg.tests.items(),1):
print
+load.close()
+
# Save the results (first re-order them)
results = {}
for (name,test) in cfg.tests.items():
diff --git a/numbench/metis.py b/numbench/metis.py
index f3ad768..8e6940f 100644
--- a/numbench/metis.py
+++ b/numbench/metis.py
@@ -6,6 +6,7 @@ import basemodule
import benchconfig as cfg
from benchutils import mkdir
from benchprint import Print
+import benchchilds
inputsdir = pjoin(cfg.testsdir, 'metis-input')
mkdir(inputsdir)
@@ -117,6 +118,7 @@ class MetisTest:
logname = pjoin(self.logdir, t + '_%i.log' % size)
cmd = [exe, inputfile, parts]
pr = sp.Popen(cmd, stdout=sp.PIPE, stderr=sp.STDOUT, env=env)
+ benchchilds.append(pr)
lines = pr.communicate()[0].split('\n')
# Interpret output
diff --git a/numbench/testdescr.py b/numbench/testdescr.py
index edadd06..1185c01 100644
--- a/numbench/testdescr.py
+++ b/numbench/testdescr.py
@@ -30,6 +30,14 @@ testdescr = {
'FFTW_1D_Backward_Measure': 'FFTW 1D Backward (Measure)',
'FFTW_1D_Forward_Estimate': 'FFTW 1D Forward (Estimate)',
'FFTW_1D_Backward_Estimate': 'FFTW 1D Backward (Estimate)',
+'FFTW_2D_Forward_Measure': 'FFTW 2D Forward (Measure)',
+'FFTW_2D_Backward_Measure': 'FFTW 2D Backward (Measure)',
+'FFTW_2D_Forward_Estimate': 'FFTW 2D Forward (Estimate)',
+'FFTW_2D_Backward_Estimate': 'FFTW 2D Backward (Estimate)',
+'FFTW_3D_Forward_Measure': 'FFTW 3D Forward (Measure)',
+'FFTW_3D_Backward_Measure': 'FFTW 3D Backward (Measure)',
+'FFTW_3D_Forward_Estimate': 'FFTW 3D Forward (Estimate)',
+'FFTW_3D_Backward_Estimate': 'FFTW 3D Backward (Estimate)',
# METIS
'pmetis-8': 'Graph partitioning using pmetis - 8 partitions',
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [gentoo-commits] proj/auto-numerical-bench:master commit in: numbench/
@ 2011-08-17 15:00 Andrea Arteaga
0 siblings, 0 replies; 21+ messages in thread
From: Andrea Arteaga @ 2011-08-17 15:00 UTC (permalink / raw
To: gentoo-commits
commit: 01ea31c89b51936a28a6163388f06b1ea44b2b91
Author: Andrea Arteaga <andyspiros <AT> gmail <DOT> com>
AuthorDate: Wed Aug 17 15:00:01 2011 +0000
Commit: Andrea Arteaga <andyspiros <AT> gmail <DOT> com>
CommitDate: Wed Aug 17 15:00:01 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/auto-numerical-bench.git;a=commit;h=01ea31c8
Updated fftw.
---
numbench/fftw.py | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/numbench/fftw.py b/numbench/fftw.py
index 1d97c02..e462716 100644
--- a/numbench/fftw.py
+++ b/numbench/fftw.py
@@ -8,7 +8,10 @@ class Module(btlbase.BTLBase):
"FFTW_1D_Backward_Measure", "FFTW_1D_Backward_Estimate",
"FFTW_2D_Forward_Measure", "FFTW_2D_Forward_Estimate",
- "FFTW_2D_Backward_Measure", "FFTW_2D_Backward_Estimate"
+ "FFTW_2D_Backward_Measure", "FFTW_2D_Backward_Estimate",
+
+ "FFTW_3D_Forward_Measure", "FFTW_3D_Forward_Estimate",
+ "FFTW_3D_Backward_Measure", "FFTW_3D_Backward_Estimate"
)
def _parse_args(self, args):
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [gentoo-commits] proj/auto-numerical-bench:master commit in: numbench/
@ 2011-08-17 16:21 Andrea Arteaga
0 siblings, 0 replies; 21+ messages in thread
From: Andrea Arteaga @ 2011-08-17 16:21 UTC (permalink / raw
To: gentoo-commits
commit: fb542b414ea5b4fe280bff5cb164006d9211c42a
Author: Andrea Arteaga <andyspiros <AT> gmail <DOT> com>
AuthorDate: Wed Aug 17 16:21:49 2011 +0000
Commit: Andrea Arteaga <andyspiros <AT> gmail <DOT> com>
CommitDate: Wed Aug 17 16:21:49 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/auto-numerical-bench.git;a=commit;h=fb542b41
Solved issue with module import.
---
numbench/main.py | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/numbench/main.py b/numbench/main.py
index 5bdacd2..21822d7 100755
--- a/numbench/main.py
+++ b/numbench/main.py
@@ -80,6 +80,7 @@ def tests_from_input(input):
import benchconfig as cfg
import benchchilds
+
# If no argument is given, print the help
if (len(sys.argv) < 2):
print_help()
@@ -98,16 +99,15 @@ try:
# Print module help
if (sys.argv[2] in ('-h', '--help')):
- os.chdir(cfg.scriptdir)
cfg.inputfile = ''
- tmp = __import__(cfg.modulename, fromlist = ['Module'])
+ tmp = __import__('numbench.'+cfg.modulename, fromlist = ['Module'])
tmp.Module.printHelp()
exit(0)
# Normal run: import module
cfg.inputfile = os.path.abspath(sys.argv[2])
os.chdir(cfg.scriptdir)
- tmp = __import__(sys.argv[1], fromlist = ['Module'])
+ tmp = __import__('numbench.'+cfg.modulename, fromlist = ['Module'])
mod = tmp.Module(sys.argv[3:])
del tmp
cfg.makedirs()
@@ -182,7 +182,8 @@ for tname, ttest in cfg.tests.items():
Print()
Print(80*'=')
Print()
-Print("The script is located in the directory" + cfg.scriptdir)
+Print("The script is located in the directory " + cfg.scriptdir)
+Print("The script is run from the directory " + os.path.realpath('.'))
Print("The BTL is located in the directory " + cfg.btldir)
Print("The logs will be available in the directory " + cfg.logdir)
Print("The results will be available in the directory " + cfg.reportdir)
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [gentoo-commits] proj/auto-numerical-bench:master commit in: numbench/
@ 2011-08-17 18:00 Andrea Arteaga
0 siblings, 0 replies; 21+ messages in thread
From: Andrea Arteaga @ 2011-08-17 18:00 UTC (permalink / raw
To: gentoo-commits
commit: d3abc094de5785700d6b8b553d1e6f13da674c91
Author: Andrea Arteaga <andyspiros <AT> gmail <DOT> com>
AuthorDate: Wed Aug 17 18:00:23 2011 +0000
Commit: Andrea Arteaga <andyspiros <AT> gmail <DOT> com>
CommitDate: Wed Aug 17 18:00:23 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/auto-numerical-bench.git;a=commit;h=d3abc094
Solved problem with Print.
---
numbench/benchprint.py | 8 ++++----
numbench/main.py | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/numbench/benchprint.py b/numbench/benchprint.py
index e0e5051..beb6fe8 100644
--- a/numbench/benchprint.py
+++ b/numbench/benchprint.py
@@ -14,20 +14,20 @@ if needsinitialization:
self._maxlevel = maxlevel
self._logfile = logfile
- def __call__(self, arg='\n'):
- printstr = str(arg)
+ def __call__(self, arg='', end='\n'):
+ printstr = str(arg) + end
if self._level > 0:
printstr = (self._level-1)*" " + "-- " + printstr
# Print to logfile
bu.mkdir(dirname(self._logfile))
logfile = file(self._logfile, 'a')
- print >> logfile, printstr
+ print >> logfile, printstr,
logfile.close()
# Print to terminal
if self._level <= self._maxlevel:
- print printstr
+ print printstr,
def up(self, n=1):
self._level = max(self._level-n, 0)
diff --git a/numbench/main.py b/numbench/main.py
index 21822d7..6150611 100755
--- a/numbench/main.py
+++ b/numbench/main.py
@@ -175,7 +175,7 @@ for tname, ttest in cfg.tests.items():
if len(ttest['skip']) != 0:
Print(" - Skip implementations: " + ' '.join(ttest['skip']))
if len(ttest['changes']) != 0:
- Print(" - Dependency specifications:",)
+ Print(" - Dependency substitutions:", '')
for c_0, c_1 in ttest['changes'].items():
Print(c_0 + ':' + c_1, '')
Print()
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [gentoo-commits] proj/auto-numerical-bench:master commit in: numbench/
@ 2011-08-18 19:47 Andrea Arteaga
0 siblings, 0 replies; 21+ messages in thread
From: Andrea Arteaga @ 2011-08-18 19:47 UTC (permalink / raw
To: gentoo-commits
commit: 2a69ca50b82901237b0732a33acfbd52fb2643a4
Author: Andrea Arteaga <andyspiros <AT> gmail <DOT> com>
AuthorDate: Thu Aug 18 19:46:57 2011 +0000
Commit: Andrea Arteaga <andyspiros <AT> gmail <DOT> com>
CommitDate: Thu Aug 18 19:46:57 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/auto-numerical-bench.git;a=commit;h=2a69ca50
Added @file feature. Masked FFTW 3D tests.
---
numbench/benchutils.py | 14 ++++++++++++--
numbench/fftw.py | 7 ++++---
numbench/main.py | 39 +++++++++++++++++++++++++++++++++++++--
3 files changed, 53 insertions(+), 7 deletions(-)
diff --git a/numbench/benchutils.py b/numbench/benchutils.py
index df12ee9..7f2542d 100644
--- a/numbench/benchutils.py
+++ b/numbench/benchutils.py
@@ -1,8 +1,18 @@
-import os, sys
+import os, sys, string, random
import subprocess as sp
+__all__ = ['mkdir', 'tmpfile', 'run_cmd']
+
def mkdir(dir):
if not os.path.exists(dir):
os.makedirs(dir)
-
+
+def tmpfile(dir="/var/tmp"):
+ """Returns the path of a free temporary file within the given directory."""
+ chars = string.letters + string.digits
+ while True:
+ fname = os.path.join(dir, random.sample(chars, 10))
+ if not os.path.exists(fname):
+ return fname
+
run_cmd = lambda c : sp.Popen(c, stdout=sp.PIPE).communicate()[0]
diff --git a/numbench/fftw.py b/numbench/fftw.py
index e462716..1596921 100644
--- a/numbench/fftw.py
+++ b/numbench/fftw.py
@@ -10,11 +10,12 @@ class Module(btlbase.BTLBase):
"FFTW_2D_Forward_Measure", "FFTW_2D_Forward_Estimate",
"FFTW_2D_Backward_Measure", "FFTW_2D_Backward_Estimate",
- "FFTW_3D_Forward_Measure", "FFTW_3D_Forward_Estimate",
- "FFTW_3D_Backward_Measure", "FFTW_3D_Backward_Estimate"
+ # Mask 3D tests while unstable
+# "FFTW_3D_Forward_Measure", "FFTW_3D_Forward_Estimate",
+# "FFTW_3D_Backward_Measure", "FFTW_3D_Backward_Estimate"
)
- def _parse_args(self, args):
+ def _parse_args(self, args):
# Parse arguments
tests = []
for i in args:
diff --git a/numbench/main.py b/numbench/main.py
index 6150611..58e5e58 100755
--- a/numbench/main.py
+++ b/numbench/main.py
@@ -1,6 +1,6 @@
#! /usr/bin/env python2
-import os, sys, signal, shlex, time
+import os, sys, signal, shlex, shutil, time
from os.path import join as pjoin
import subprocess as sp
@@ -39,6 +39,20 @@ def print_help():
print "More information about a module is available through the command:"
print " numbench module --help"
+def readEnvFile(fname):
+ """Reads a bash file with void environment and returns the environment
+ at the end of the execution."""
+ proc = sp.Popen('. '+fname+' &> /dev/null; env', \
+ shell=True, stdout=sp.PIPE, env={})
+ lines = proc.stdout.read().split('\n')[:-1]
+ env = dict([l.split('=', 1) for l in lines])
+
+ for k in ('SHLVL', 'PWD', '_'):
+ if env.has_key(k):
+ del env[k]
+ return env
+
+
def tests_from_input(input):
tests = {}
for line in input.split('\n'):
@@ -49,26 +63,46 @@ def tests_from_input(input):
if line[0] == '#':
continue
env = {}
- # TODO: add @file for env set based on external file
skip = []
change = {}
descr = None
+ fileenv = {}
+
+ # Interpret arguments
for var in spl[2:]:
+
+ # if begins with '-': skip implementation
if var[0] == '-':
skip.append(var[1:])
+
+ # if key:value, substitute pkg-config dependency
elif ':' in var and not '=' in var:
c_0, c_1 = var.split(':', 1)
change[c_0] = c_1
+
+ # if descr|text set description (for future use)
elif var[:6] == 'descr|':
descr = var[6:]
+
+ # if @file: read bash script and set env
+ elif var[0] == '@':
+ fileenv = readEnvFile(pjoin(cfg.curdir, var[1:]))
+
+ # Otherwise, assume key=value syntax
else:
e_0, e_1 = var.split('=', 1)
env[e_0] = e_1
+
+ # Set environment (argument overrides bash file)
+ env = dict( fileenv.items() + env.items() )
+
try:
+ # Insert test
avail = available_packages(spl[1])[-1]
tests[spl[0]] = {'package':avail , 'env':env, 'skip':skip, \
'changes':change, 'descr':descr}
except:
+ # Or trigger an non-fatal error
sys.stderr.write('Error: package ' + spl[1] + ' not found\n')
return tests
@@ -79,6 +113,7 @@ def tests_from_input(input):
import benchconfig as cfg
import benchchilds
+import benchutils as bu
# If no argument is given, print the help
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [gentoo-commits] proj/auto-numerical-bench:master commit in: numbench/
@ 2011-08-19 23:11 Andrea Arteaga
0 siblings, 0 replies; 21+ messages in thread
From: Andrea Arteaga @ 2011-08-19 23:11 UTC (permalink / raw
To: gentoo-commits
commit: eab48a80b9a8a80d3115d9ac13b68f55a938de84
Author: Andrea Arteaga <andyspiros <AT> gmail <DOT> com>
AuthorDate: Fri Aug 19 23:11:22 2011 +0000
Commit: Andrea Arteaga <andyspiros <AT> gmail <DOT> com>
CommitDate: Fri Aug 19 23:11:22 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/auto-numerical-bench.git;a=commit;h=eab48a80
Added purge. Added -N to BTL for samples num.
---
numbench/benchconfig.py | 11 +++++++++--
numbench/benchutils.py | 7 ++++++-
numbench/blasbase.py | 7 ++++---
numbench/btlbase.py | 9 ++++++++-
numbench/fftw.py | 6 ++++--
numbench/lapack.py | 8 +++++---
numbench/main.py | 18 +++++++++++++++++-
numbench/scalapack.py | 8 +++++---
8 files changed, 58 insertions(+), 16 deletions(-)
diff --git a/numbench/benchconfig.py b/numbench/benchconfig.py
index ede97ef..f5f30d4 100644
--- a/numbench/benchconfig.py
+++ b/numbench/benchconfig.py
@@ -44,8 +44,7 @@ if needsinitialization:
rootsdir = os.environ['HOME'] + "/.benchmarks/roots/"
pkgsdir = os.environ['HOME'] + "/.benchmarks/packages/"
reportdirb = os.environ['HOME'] + "/.benchmarks/reports/"
- logdirb = pjoin(os.environ['HOME'], ".benchmarks/log",
- modname + "_" + time.strftime('%Y-%m-%d'))
+ logdirb = pjoin(os.environ['HOME'], ".benchmarks/log/")
# Report directory
reportdirb += modname + "_" + time.strftime('%Y-%m-%d')
@@ -61,6 +60,7 @@ if needsinitialization:
del reportdirb
# Logs directory
+ logdirb += modname + "_" + time.strftime('%Y-%m-%d')
if os.path.exists(logdirb):
n = 1
while True:
@@ -79,6 +79,13 @@ def makedirs():
bu.mkdir(reportdir)
bu.mkdir(logdir)
+def purgedirs():
+ bu.rmdir(rootsdir)
+ bu.rmdir(testsdir)
+ bu.rmdir(pkgsdir)
+ bu.rmdir(pjoin(reportdir, '..'))
+ bu.rmdir(pjoin(logdir, '..'))
+
inizialized = True
diff --git a/numbench/benchutils.py b/numbench/benchutils.py
index 7f2542d..a15d9c3 100644
--- a/numbench/benchutils.py
+++ b/numbench/benchutils.py
@@ -1,4 +1,4 @@
-import os, sys, string, random
+import os, sys, shutil, string, random
import subprocess as sp
__all__ = ['mkdir', 'tmpfile', 'run_cmd']
@@ -6,6 +6,11 @@ __all__ = ['mkdir', 'tmpfile', 'run_cmd']
def mkdir(dir):
if not os.path.exists(dir):
os.makedirs(dir)
+
+def rmdir(dir):
+ if os.path.isdir(dir):
+ shutil.rmtree(dir, True)
+
def tmpfile(dir="/var/tmp"):
"""Returns the path of a free temporary file within the given directory."""
diff --git a/numbench/blasbase.py b/numbench/blasbase.py
index 2f2b84e..f7c1d33 100644
--- a/numbench/blasbase.py
+++ b/numbench/blasbase.py
@@ -18,7 +18,8 @@ class BLASBase(btlbase.BTLBase):
def _initialize(self):
pass
- def _parse_args(self, args):
+ def _parse_args(self, args):
+ passargs = []
# Parse arguments
tests = []
for i in args:
@@ -34,7 +35,7 @@ class BLASBase(btlbase.BTLBase):
if i in self.avail:
tests.append(i)
continue
- raise Exception("Argument not recognized: " + i)
+ passargs.append(i)
# Sort tests
self.tests = [i for i in self.avail if i in tests]
@@ -44,7 +45,7 @@ class BLASBase(btlbase.BTLBase):
self.tests = ['axpy', 'matrix_vector', \
'trisolve_vector', 'matrix_matrix']
- btlbase.BTLBase._parse_args(self, args)
+ btlbase.BTLBase._parse_args(self, passargs)
@staticmethod
def _testClass():
diff --git a/numbench/btlbase.py b/numbench/btlbase.py
index d8b4f4a..8e2e1e1 100644
--- a/numbench/btlbase.py
+++ b/numbench/btlbase.py
@@ -10,7 +10,6 @@ import benchconfig as cfg
import benchchilds
from testdescr import testdescr
-
class BTLBase(basemodule.BaseModule):
@classmethod
@@ -27,6 +26,12 @@ class BTLBase(basemodule.BaseModule):
# Generate list of dat (result) files, relative to the testdir
self.files = [pjoin('bench_%s_%s.dat' % (op, self.libname)) \
for op in self.tests]
+
+ for i in args:
+ if i[:2] == '-N':
+ BTLTest.N = i[2:]
+ continue
+ raise Exception("Argument not recognized: " + i)
def save_results(self, results):
basemodule.BaseModule.save_results(self, results, 'semilogx')
@@ -121,6 +126,8 @@ class BTLTest(basemodule.BaseTest):
# Open pipe
logfile = file(logfile, 'w')
args = preargs + [exe] + list(self.tests)
+ if self.N is not None:
+ args.append('-N' + self.N)
logfile.write(' '.join( \
[n + '="'+v+'"' for n,v in self.runenv.items()] ) + ' ')
logfile.write(' '.join(args) + '\n')
diff --git a/numbench/fftw.py b/numbench/fftw.py
index 1596921..829b89d 100644
--- a/numbench/fftw.py
+++ b/numbench/fftw.py
@@ -16,13 +16,15 @@ class Module(btlbase.BTLBase):
)
def _parse_args(self, args):
+ passargs = []
+
# Parse arguments
tests = []
for i in args:
if i in self.avail:
tests.append(i)
continue
- raise Exception("Argument not recognized: " + i)
+ passargs.append(i)
# Sort tests
self.tests = [i for i in self.avail if i in tests]
@@ -31,7 +33,7 @@ class Module(btlbase.BTLBase):
if len(self.tests) == 0:
self.tests = self.avail
- btlbase.BTLBase._parse_args(self, args)
+ btlbase.BTLBase._parse_args(self, passargs)
@staticmethod
def get_impls(root):
diff --git a/numbench/lapack.py b/numbench/lapack.py
index ae318fa..2f48150 100644
--- a/numbench/lapack.py
+++ b/numbench/lapack.py
@@ -11,14 +11,16 @@ class Module(btlbase.BTLBase):
def _initialize(self):
pass
- def _parse_args(self, args):
+ def _parse_args(self, args):
+ passargs = []
+
# Parse arguments
tests = []
for i in args:
if i in self.avail:
tests.append(i)
continue
- raise Exception("Argument not recognized: " + i)
+ passargs.append(i)
# Sort tests
self.tests = [i for i in self.avail if i in tests]
@@ -28,7 +30,7 @@ class Module(btlbase.BTLBase):
self.tests = ['lu_decomp', 'cholesky', 'qr_decomp', 'svd_decomp',\
'syev', 'stev']
- btlbase.BTLBase._parse_args(self, args)
+ btlbase.BTLBase._parse_args(self, passargs)
@staticmethod
def _testClass():
diff --git a/numbench/main.py b/numbench/main.py
index bab534f..f0fe489 100755
--- a/numbench/main.py
+++ b/numbench/main.py
@@ -26,6 +26,10 @@ def print_help():
print " numbench [ -h | --help ]"
print " numbench module [ -h | --help ]"
print
+ print "Options:"
+ print " [ -p | --purge ] - Remove old results, logs, tests and packages"
+ print " [ -h | --help ] - Display an help message"
+ print
print "Modules:"
print " blas - Test BLAS implementations"
print " cblas - Test CBLAS implementations"
@@ -142,11 +146,23 @@ try:
exit(0)
# Normal run: import module
+
+ # Catch command-line arguments
+ passargs = []
+ purge = False
+ for v in sys.argv[3:]:
+ if v in ('-p', '--purge'):
+ purge = True
+ else:
+ passargs.append(v)
+
cfg.inputfile = os.path.abspath(sys.argv[2])
os.chdir(cfg.scriptdir)
tmp = __import__('numbench.'+cfg.modulename, fromlist = ['Module'])
- mod = tmp.Module(sys.argv[3:])
+ mod = tmp.Module(passargs)
del tmp
+ if purge:
+ cfg.purgedirs()
cfg.makedirs()
except ImportError as e:
diff --git a/numbench/scalapack.py b/numbench/scalapack.py
index 54f79cb..827417a 100644
--- a/numbench/scalapack.py
+++ b/numbench/scalapack.py
@@ -8,7 +8,9 @@ class Module(btlbase.BTLBase):
self.avail = ['axpy', 'matrix_vector', 'lu_decomp', 'cholesky',
'qr_decomp', 'svd_decomp', 'symm_ev']
- def _parse_args(self, args):
+ def _parse_args(self, args):
+ passargs = []
+
# Parse arguments
tests = []
skip = 0
@@ -24,7 +26,7 @@ class Module(btlbase.BTLBase):
if a in self.avail:
tests.append(a)
continue
- raise Exception("Argument not recognized: " + a)
+ passargs.append(a)
# Sort tests
self.tests = [i for i in self.avail if i in tests]
@@ -33,7 +35,7 @@ class Module(btlbase.BTLBase):
if len(self.tests) == 0:
self.tests = self.avail
- btlbase.BTLBase._parse_args(self, args)
+ btlbase.BTLBase._parse_args(self, passargs)
@staticmethod
def _testClass():
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [gentoo-commits] proj/auto-numerical-bench:master commit in: numbench/
@ 2011-08-19 23:19 Andrea Arteaga
0 siblings, 0 replies; 21+ messages in thread
From: Andrea Arteaga @ 2011-08-19 23:19 UTC (permalink / raw
To: gentoo-commits
commit: facec2be06cd0eb883afd717238122eeac8bbecb
Author: Andrea Arteaga <andyspiros <AT> gmail <DOT> com>
AuthorDate: Fri Aug 19 23:18:54 2011 +0000
Commit: Andrea Arteaga <andyspiros <AT> gmail <DOT> com>
CommitDate: Fri Aug 19 23:18:54 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/auto-numerical-bench.git;a=commit;h=facec2be
Solved bug with PortageUtils.
---
numbench/PortageUtils.py | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/numbench/PortageUtils.py b/numbench/PortageUtils.py
index f06c53d..0aad4b1 100644
--- a/numbench/PortageUtils.py
+++ b/numbench/PortageUtils.py
@@ -66,7 +66,10 @@ def get_dependencies(package, env={}, split=False):
pkg = normalize_cpv(package)
cmd = ['emerge', '--ignore-default-opts', '='+pkg, '-poq']
proc = sp.Popen(cmd, stdout=sp.PIPE, stderr=sp.PIPE, env=env)
- lines = proc.communicate()[0].strip().split('\n')
+ output = proc.communicate()[0]
+ if proc.returncode != 0:
+ return []
+ lines = output.strip().split('\n')
if not lines[0]:
return []
if split:
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [gentoo-commits] proj/auto-numerical-bench:master commit in: numbench/
@ 2011-08-22 18:02 Andrea Arteaga
0 siblings, 0 replies; 21+ messages in thread
From: Andrea Arteaga @ 2011-08-22 18:02 UTC (permalink / raw
To: gentoo-commits
commit: 0511b4f53e6a86b9363c6cb672a63b71b0b57906
Author: Andrea Arteaga <andyspiros <AT> gmail <DOT> com>
AuthorDate: Mon Aug 22 17:57:43 2011 +0000
Commit: Andrea Arteaga <andyspiros <AT> gmail <DOT> com>
CommitDate: Mon Aug 22 17:57:43 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/auto-numerical-bench.git;a=commit;h=0511b4f5
Reintroduced fftw 3D actions.
---
numbench/fftw.py | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/numbench/fftw.py b/numbench/fftw.py
index 829b89d..8d583b5 100644
--- a/numbench/fftw.py
+++ b/numbench/fftw.py
@@ -10,9 +10,8 @@ class Module(btlbase.BTLBase):
"FFTW_2D_Forward_Measure", "FFTW_2D_Forward_Estimate",
"FFTW_2D_Backward_Measure", "FFTW_2D_Backward_Estimate",
- # Mask 3D tests while unstable
-# "FFTW_3D_Forward_Measure", "FFTW_3D_Forward_Estimate",
-# "FFTW_3D_Backward_Measure", "FFTW_3D_Backward_Estimate"
+ "FFTW_3D_Forward_Measure", "FFTW_3D_Forward_Estimate",
+ "FFTW_3D_Backward_Measure", "FFTW_3D_Backward_Estimate"
)
def _parse_args(self, args):
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [gentoo-commits] proj/auto-numerical-bench:master commit in: numbench/
@ 2011-12-27 0:13 Andrea Arteaga
0 siblings, 0 replies; 21+ messages in thread
From: Andrea Arteaga @ 2011-12-27 0:13 UTC (permalink / raw
To: gentoo-commits
commit: f4aec545e93de31072f883125276a405ce4e4514
Author: spiros <spiros <AT> spib <DOT> (none)>
AuthorDate: Tue Dec 27 00:13:00 2011 +0000
Commit: Andrea Arteaga <andyspiros <AT> gmail <DOT> com>
CommitDate: Tue Dec 27 00:13:00 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/auto-numerical-bench.git;a=commit;h=f4aec545
Removed buggy load printer thread.
---
numbench/benchload.py | 61 ----------------------------------------------
numbench/main.py | 65 +++++++++++++++++++++++-------------------------
2 files changed, 31 insertions(+), 95 deletions(-)
diff --git a/numbench/benchload.py b/numbench/benchload.py
deleted file mode 100644
index 8363862..0000000
--- a/numbench/benchload.py
+++ /dev/null
@@ -1,61 +0,0 @@
-#=====================================================
-# Copyright (C) 2011 Andrea Arteaga <andyspiros@gmail.com>
-#=====================================================
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-import sys, shlex, threading, time, subprocess as sp
-
-class PrintLoad(threading.Thread):
-
- _active = False
- _continue = True
-
- def run(self):
- while self._continue:
- if self._active:
- out = sp.check_output('uptime')
- printstr = ' '.join(shlex.split(out)[-5:])
- sys.stdout.flush()
- sys.stdout.write(printstr + '\r')
- sys.stdout.flush()
- time.sleep(.5)
-
- def setActive(self, active=True):
- self._active = active
-
- def stop(self):
- self._continue = False
-
-
-
-def start():
- printLoadThread.setActive(True)
-
-def stop():
- printLoadThread.setActive(False)
-
-def close():
- printLoadThread.stop()
-
-try:
- needsinitialization = not initialized
-except:
- needsinitialization = True
-
-if needsinitialization:
- printLoadThread = PrintLoad()
- printLoadThread.start()
-
-initialized = True
\ No newline at end of file
diff --git a/numbench/main.py b/numbench/main.py
index e0f5857..105a699 100755
--- a/numbench/main.py
+++ b/numbench/main.py
@@ -33,7 +33,7 @@ def close(*args):
Print("Exiting")
exit(0)
signal.signal(signal.SIGINT, close)
-
+
def print_usage():
print "Usage: numbench [blas|cblas|lapack|scalapack|fftw|metis|" + \
@@ -60,7 +60,7 @@ def print_help():
print
print "More information about a module is available through the command:"
print " numbench module --help"
-
+
def readEnvFile(fname):
"""Reads a bash file with void environment and returns the environment
at the end of the execution."""
@@ -68,13 +68,13 @@ def readEnvFile(fname):
shell=True, stdout=sp.PIPE, env={})
lines = proc.stdout.read().split('\n')[:-1]
env = dict([l.split('=', 1) for l in lines])
-
+
for k in ('SHLVL', 'PWD', '_'):
if env.has_key(k):
del env[k]
return env
-
-
+
+
def tests_from_input(input):
tests = {}
for line in input.split('\n'):
@@ -89,37 +89,37 @@ def tests_from_input(input):
change = {}
descr = None
fileenv = {}
-
+
# Interpret arguments
for var in spl[2:]:
-
+
# if begins with '-': skip implementation
if var[0] == '-':
skip.append(var[1:])
-
+
# if key:value, substitute pkg-config dependency
elif ':' in var and not '=' in var:
c_0, c_1 = var.split(':', 1)
change[c_0] = c_1
-
+
# if descr|text set description (for future use)
elif var[:6] == 'descr|':
descr = var[6:]
-
+
# if @file: read bash script and set env
elif var[0] == '@':
fileenvNew = readEnvFile(pjoin(cfg.curdir, var[1:]))
fileenv = dict( fileenv.items() + fileenvNew.items() )
del fileenvNew
-
+
# Otherwise, assume key=value syntax
else:
e_0, e_1 = var.split('=', 1)
env[e_0] = e_1
-
+
# Set environment (argument overrides bash file)
env = dict( fileenv.items() + env.items() )
-
+
try:
# Insert test
avail = available_packages(spl[1])[-1]
@@ -153,18 +153,18 @@ try:
if (sys.argv[1] in ('-h', '--help')):
print_help()
exit(0);
-
+
cfg.modulename = sys.argv[1]
-
+
# Print module help
if (sys.argv[2] in ('-h', '--help')):
cfg.inputfile = ''
tmp = __import__('numbench.'+cfg.modulename, fromlist = ['Module'])
tmp.Module.printHelp()
exit(0)
-
+
# Normal run: import module
-
+
# Catch command-line arguments
passargs = []
purge = False
@@ -173,7 +173,7 @@ try:
purge = True
else:
passargs.append(v)
-
+
cfg.inputfile = os.path.abspath(sys.argv[2])
os.chdir(cfg.scriptdir)
tmp = __import__('numbench.'+cfg.modulename, fromlist = ['Module'])
@@ -182,7 +182,7 @@ try:
if purge:
cfg.purgedirs()
cfg.makedirs()
-
+
except ImportError as e:
print e
print_usage()
@@ -190,10 +190,9 @@ except ImportError as e:
except IndexError:
print_usage()
exit(1)
-
+
from PortageUtils import *
from benchprint import Print
-import benchload as load
@@ -220,7 +219,7 @@ Every line contains a configuration and will be an entry in the tests
dictionary; the line has to contain:
- an identification string
- a package description, which can, but does not must to, contain a version
-- a list of environment variables separated by means of spaces
+- a list of environment variables separated by means of spaces
"""
if not os.path.exists(cfg.inputfile):
sys.stderr.write("File not found: " + cfg.inputfile)
@@ -263,12 +262,12 @@ Print()
for tn,(name,test) in enumerate(cfg.tests.items(),1):
Print._level = 0
Print("BEGIN TEST %i - %s" % (tn, name))
-
+
pkgdir = pjoin(cfg.pkgsdir, name)
root = pjoin(cfg.rootsdir, name)
tlogdir = pjoin(cfg.logdir, name)
os.path.exists(tlogdir) or os.makedirs(tlogdir)
-
+
# Emerge package
Print.down()
package = normalize_cpv(test['package'])
@@ -285,7 +284,7 @@ for tn,(name,test) in enumerate(cfg.tests.items(),1):
install_dependencies( \
test['package'], root=root, pkgdir=pkgdir, \
logdir=tlogdir)
-
+
# Emerge pacakge
Print("Emerging package %s" % package)
logfile = pjoin(tlogdir, 'emerge.log')
@@ -296,7 +295,7 @@ for tn,(name,test) in enumerate(cfg.tests.items(),1):
logfile=logfile
)
test['emergesuccess'] = True
-
+
except InstallException as e:
test['emergesuccess'] = False
Print("Package %s failed to emerge" % package)
@@ -305,11 +304,11 @@ for tn,(name,test) in enumerate(cfg.tests.items(),1):
print
continue
Print("Package emerged")
-
+
# Find implementations
impls = [i for i in mod.get_impls(root) if not i in test['skip']]
test['implementations'] = impls
-
+
# Test every implementation
test['results'] = {}
if len(impls) == 0:
@@ -317,20 +316,18 @@ for tn,(name,test) in enumerate(cfg.tests.items(),1):
for impl in impls:
Print("Testing " + impl)
Print.down()
-
+
# Run the test suite
testdir = os.path.join(cfg.testsdir, name, impl)
t = mod.getTest(root, impl, testdir, logdir=tlogdir)
test['results'][impl] = t.run_test(test['changes'])
Print.up()
-
+
Print.up()
print
-
-load.close()
-# Save the results (first re-order them)
+# Save the results (first re-order them)
results = {}
for (name,test) in cfg.tests.items():
if test.has_key('implementations'):
@@ -360,6 +357,6 @@ for name,test in cfg.tests.items():
Print.up()
except:
pass
-
+
Print.up()
Print()
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [gentoo-commits] proj/auto-numerical-bench:master commit in: numbench/
@ 2012-02-27 15:05 Andrea Arteaga
0 siblings, 0 replies; 21+ messages in thread
From: Andrea Arteaga @ 2012-02-27 15:05 UTC (permalink / raw
To: gentoo-commits
commit: 1eac5313477a1143d7b17ae6f130c6f099da4a69
Author: Andrea Arteaga <andyspiros <AT> gmail <DOT> com>
AuthorDate: Mon Feb 27 15:04:00 2012 +0000
Commit: Andrea Arteaga <andyspiros <AT> gmail <DOT> com>
CommitDate: Mon Feb 27 15:04:00 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/auto-numerical-bench.git;a=commit;h=1eac5313
Restore copy logs and input file.
---
numbench/report.py | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/numbench/report.py b/numbench/report.py
index c080b1f..ecb13b0 100644
--- a/numbench/report.py
+++ b/numbench/report.py
@@ -108,6 +108,10 @@ def saveReport():
fname = pjoin(cfg.reportdir, imgpath)
p.savePlot(fname)
html.addFig(testdescr[operation], image=imgpath)
+
+ # Copy logs and input file
+ copytree(cfg.logdir, pjoin(cfg.reportdir, 'log'))
+ fcopy(cfg.inputfile, pjoin(cfg.reportdir, basename(cfg.inputfile)));
# Close HTML file
html.close()
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [gentoo-commits] proj/auto-numerical-bench:master commit in: numbench/
@ 2012-02-28 19:20 Andrea Arteaga
0 siblings, 0 replies; 21+ messages in thread
From: Andrea Arteaga @ 2012-02-28 19:20 UTC (permalink / raw
To: gentoo-commits
commit: 4525e08adeca3c974d52a87edacfa3b2e6ab67c3
Author: Andrea Arteaga <andyspiros <AT> gmail <DOT> com>
AuthorDate: Tue Feb 28 19:19:01 2012 +0000
Commit: Andrea Arteaga <andyspiros <AT> gmail <DOT> com>
CommitDate: Tue Feb 28 19:19:01 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/auto-numerical-bench.git;a=commit;h=4525e08a
Bugs solved.
---
numbench/benchconfig.py | 2 +-
numbench/htmlreport.py | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/numbench/benchconfig.py b/numbench/benchconfig.py
index f4bed38..a3b40cf 100644
--- a/numbench/benchconfig.py
+++ b/numbench/benchconfig.py
@@ -49,7 +49,7 @@ if not locals().has_key('initialized'):
passargs = sys.argv[3:]
for i,a in enumerate(passargs):
if a in ('-d', '--directory'):
- basedir = passargs[i+1]
+ basedir = pjoin(curdir, passargs[i+1])
passargs = passargs[:i] + passargs[i+2:]
break
diff --git a/numbench/htmlreport.py b/numbench/htmlreport.py
index 39cf38f..a0d61b4 100644
--- a/numbench/htmlreport.py
+++ b/numbench/htmlreport.py
@@ -22,7 +22,7 @@ from xml.sax.saxutils import escape as xmlescape
import benchconfig as cfg
class HTMLreport:
- def __init__(self, fname, title="Benchmarks report", \
+ def __init__(self, fname, title='Benchmarks report', \
inputfile=pjoin(cfg.reportdir, basename(cfg.inputfile))):
self.fname = fname
self.content = """
@@ -60,7 +60,7 @@ h1, h2, .plot, .descr, .info {
<body>
<h1>
"""
- self.content += title + "</h1>"
+ self.content += title + '</h1>'
date = time.strftime('%Y-%m-%d, %I:%M %p')
self.content += '<p class="info">Generated on ' + date + '</p>'
@@ -106,7 +106,7 @@ h1, h2, .plot, .descr, .info {
self.content += '</div><hr />'
def close(self):
- self.content += "</body></html>"
+ self.content += '</body></html>'
f = file(self.fname, 'w')
f.write(self.content)
f.close()
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [gentoo-commits] proj/auto-numerical-bench:master commit in: numbench/
@ 2012-04-09 19:25 Andrea Arteaga
0 siblings, 0 replies; 21+ messages in thread
From: Andrea Arteaga @ 2012-04-09 19:25 UTC (permalink / raw
To: gentoo-commits
commit: c714fb08fdb4ec06d573bc9aa8647fa62fc182f1
Author: Andrea Arteaga <andyspiros <AT> gmail <DOT> com>
AuthorDate: Mon Apr 9 19:22:28 2012 +0000
Commit: Andrea Arteaga <andyspiros <AT> gmail <DOT> com>
CommitDate: Mon Apr 9 19:22:28 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/auto-numerical-bench.git;a=commit;h=c714fb08
Added -c / --clean switch.
---
numbench/benchconfig.py | 10 +++++++++-
numbench/main.py | 4 ++++
2 files changed, 13 insertions(+), 1 deletions(-)
diff --git a/numbench/benchconfig.py b/numbench/benchconfig.py
index c7ff33b..244ac63 100644
--- a/numbench/benchconfig.py
+++ b/numbench/benchconfig.py
@@ -50,11 +50,19 @@ if not locals().has_key('initialized'):
basedir = pjoin(curdir, passargs[i+1])
passargs = passargs[:i] + passargs[i+2:]
break
+
+ if a in ('-c', '--clean'):
+ clean = True
+ passargs = passargs[:i] + passargs[i+1:]
+
+ # Clean flag
+ if not locals().has_key('clean'):
+ clean = False
# Storage directories
if not locals().has_key('basedir'):
basedirb = pjoin(os.environ['HOME'], '.numbench') \
- + '/run_' + modulename + '_' + time.strftime('%Y-%m-%d')
+ + '/numbench_' + modulename + '_' + time.strftime('%Y-%m-%d')
if os.path.exists(basedirb):
n = 1
while True:
diff --git a/numbench/main.py b/numbench/main.py
index 6e9fb2c..acfe6d7 100644
--- a/numbench/main.py
+++ b/numbench/main.py
@@ -238,6 +238,10 @@ for tn,(name,test) in enumerate(cfg.tests.items(),1):
# Save the results
report.saveReport()
+# Clean up the directories
+if cfg.clean:
+ bu.rmdir(cfg.testsdir)
+ bu.rmdir(cfg.rootsdir)
# TODO: reintroduce the instructions feature (and remove "exit)
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [gentoo-commits] proj/auto-numerical-bench:master commit in: numbench/
@ 2012-08-04 20:24 Andrea Arteaga
0 siblings, 0 replies; 21+ messages in thread
From: Andrea Arteaga @ 2012-08-04 20:24 UTC (permalink / raw
To: gentoo-commits
commit: 8cb2ee3f99cf64cb3bea74d2bb0fca9e5710594d
Author: Andrea Arteaga <andyspiros <AT> gmail <DOT> com>
AuthorDate: Sat Aug 4 20:23:44 2012 +0000
Commit: Andrea Arteaga <andyspiros <AT> gmail <DOT> com>
CommitDate: Sat Aug 4 20:23:44 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/auto-numerical-bench.git;a=commit;h=8cb2ee3f
Allow different image formats (defaults svg). Rewritten arguments parser.
---
numbench/benchconfig.py | 28 ++++++++++++++++++++++------
numbench/main.py | 2 +-
numbench/report.py | 9 +++++----
3 files changed, 28 insertions(+), 11 deletions(-)
diff --git a/numbench/benchconfig.py b/numbench/benchconfig.py
index c0d8e8e..e7cc62a 100644
--- a/numbench/benchconfig.py
+++ b/numbench/benchconfig.py
@@ -44,20 +44,36 @@ if not locals().has_key('initialized'):
libdir = 'usr/' + libdir
# Parse arguments
- passargs = sys.argv[3:]
- for i,a in enumerate(passargs):
+ passargs = []
+ skipargs = 0
+ for i,a in enumerate(sys.argv[3:], 3):
+ if skipargs > 0:
+ skipargs -= 1
+ continue
+
if a in ('-d', '--directory'):
- basedir = pjoin(curdir, passargs[i+1])
- passargs = passargs[:i] + passargs[i+2:]
- break
+ basedir = pjoin(curdir, sys.argv[i+1])
+ skipargs += 1
+ continue
if a in ('-c', '--clean'):
clean = True
- passargs = passargs[:i] + passargs[i+1:]
+ continue
+
+ if a in ('-i', '--imageformat'):
+ imageformat = sys.argv[i+1]
+ skipargs += 1
+ continue
+
+ passargs.append(a)
# Clean flag
if not locals().has_key('clean'):
clean = False
+
+ # Image format
+ if not locals().has_key('imageformat'):
+ imageformat = 'svg'
# Storage directories
if not locals().has_key('basedir'):
diff --git a/numbench/main.py b/numbench/main.py
index acfe6d7..bbd9b1f 100644
--- a/numbench/main.py
+++ b/numbench/main.py
@@ -106,7 +106,7 @@ if not os.path.exists(cfg.inputfile):
cfg.tests = confinput.parseInput(cfg.inputfile)
# Import the module
-mod = loadModule(cfg.modulename).Module(sys.argv[3:])
+mod = loadModule(cfg.modulename).Module(cfg.passargs)
cfg.mod = mod
diff --git a/numbench/report.py b/numbench/report.py
index 679aa54..5f834db 100644
--- a/numbench/report.py
+++ b/numbench/report.py
@@ -48,8 +48,8 @@ class Plotter:
self.ylabel = conf.has_key('ylabel') and conf['ylabel'] or ''
# Initialize markers
- markers = ('-', '--', 'o', 'v', '^', 's', 'p', 'h', '*', '+', 'x', 'D')
- colors = ('k', 'r', 'g', 'b')
+ markers = ('-', '--', 'v', '^', 'o', 's', 'p', 'h', '*', '+', 'x', 'D')
+ colors = ('k', 'r', 'g', 'b', 'c')
self.linestyles = tuple([c+m for m in markers for c in colors])
self.curstyle = 0
@@ -67,7 +67,8 @@ class Plotter:
plt.xlabel(self.xlabel)
plt.ylabel(self.ylabel)
plt.grid(True)
- plt.savefig(fname, format='png', bbox_inches='tight', transparent=True)
+ plt.savefig(fname, format=cfg.imageformat, \
+ bbox_inches='tight', transparent=True)
@@ -104,7 +105,7 @@ def saveReport():
x,y = np.loadtxt(resultsFile, unpack=True)
p.addPlot(x, y, tid+'/'+impl)
- imgpath = pjoin('images', operation+'.png')
+ imgpath = pjoin('images', operation+'.'+cfg.imageformat)
fname = pjoin(cfg.reportdir, imgpath)
p.savePlot(fname)
html.addFig(testdescr[operation], image=imgpath)
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [gentoo-commits] proj/auto-numerical-bench:master commit in: numbench/
@ 2012-08-07 22:58 Andrea Arteaga
0 siblings, 0 replies; 21+ messages in thread
From: Andrea Arteaga @ 2012-08-07 22:58 UTC (permalink / raw
To: gentoo-commits
commit: 9422e49b0e4cf7950d3e8bf75a9e28372b8f6a6e
Author: Andrea Arteaga <andyspiros <AT> gmail <DOT> com>
AuthorDate: Wed Aug 8 10:53:50 2012 +0000
Commit: Andrea Arteaga <andyspiros <AT> gmail <DOT> com>
CommitDate: Wed Aug 8 10:53:50 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/auto-numerical-bench.git;a=commit;h=9422e49b
Solved two important issues.
* In benchconfig curdir was not set up, blocking --directory.
* In case of void "operations" tag, xmlinput crashed.
---
numbench/benchconfig.py | 2 ++
numbench/xmlinput.py | 12 +++++++++---
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/numbench/benchconfig.py b/numbench/benchconfig.py
index dc6e9b4..56ef304 100644
--- a/numbench/benchconfig.py
+++ b/numbench/benchconfig.py
@@ -56,6 +56,8 @@ def parseArguments():
clean = False
imageformat = 'svg'
+ # Directories have not yet been set up
+ curdir = os.path.abspath('.')
skipargs = 0
for i, a in enumerate(sys.argv[1:], 1):
diff --git a/numbench/xmlinput.py b/numbench/xmlinput.py
index 62f8289..87d9824 100644
--- a/numbench/xmlinput.py
+++ b/numbench/xmlinput.py
@@ -15,7 +15,11 @@ class Parser:
def getModuleArguments(self):
opTag = self._dom.getElementsByTagName('operations')[0]
- return shlex.split(opTag.firstChild.data)
+ try:
+ args = shlex.split(opTag.firstChild.data)
+ except AttributeError:
+ args = ()
+ return args
def getTestCases(self):
testNodes = self._dom.getElementsByTagName('case')
@@ -50,7 +54,8 @@ class Parser:
# Requirements
requires = {}
for i in t.getElementsByTagName('required'):
- requires[i.getAttribute('name').strip()] = i.firstChild.data.strip()
+ requires[i.getAttribute('name').strip()] = \
+ i.firstChild.data.strip()
# Environments
dependenv = self._getEnvFromNode(t, 'dependenv')
@@ -131,7 +136,8 @@ class Parser:
# Check number of envs
if len(envs) > 1:
- errstr = "Error: no more than one " + envName + " element is allowed!"
+ errstr = "Error: no more than one " + envName + " element " \
+ "is allowed!"
raise Exception(errstr)
elif len(envs) < 1:
return {}
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [gentoo-commits] proj/auto-numerical-bench:master commit in: numbench/
@ 2012-09-02 11:41 Andrea Arteaga
0 siblings, 0 replies; 21+ messages in thread
From: Andrea Arteaga @ 2012-09-02 11:41 UTC (permalink / raw
To: gentoo-commits
commit: 38b56aafe8323b6270875cf8b1f9435abc0693a1
Author: Andrea Arteaga <andyspiros <AT> gmail <DOT> com>
AuthorDate: Sun Sep 2 11:41:10 2012 +0000
Commit: Andrea Arteaga <andyspiros <AT> gmail <DOT> com>
CommitDate: Sun Sep 2 11:41:10 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/auto-numerical-bench.git;a=commit;h=38b56aaf
Better help message.
---
numbench/main.py | 33 +++++++++++++++------------------
1 files changed, 15 insertions(+), 18 deletions(-)
diff --git a/numbench/main.py b/numbench/main.py
index 0e98b41..cfeece5 100644
--- a/numbench/main.py
+++ b/numbench/main.py
@@ -34,23 +34,20 @@ signal.signal(signal.SIGINT, close)
def print_help():
- print "Usage: numbench conffile [options]"
- print " numbench [ -h | --help ]"
-# print " numbench module [ -h | --help ]"
- print
- print "Options:"
- print " [ -h | --help ] - Displays an help message."
- print
- print " [ -d | --directory] dir - Stores the data in the given directory."
- print " If not given, a directory in ~/.numbench is chosen."
- print
- print " [ -c | --clean] - Removes the temporary data."
- print
- print " [ -i | --imageformat] format - Selects the given format for the"
- print " resulting images. Available are png, svg, eps, ps, pdf."
- print " Default is svg."
- print
-
+ print """\
+Usage: numbench conffile [options]
+ numbench [ -h | --help ]
+
+Options:
+ - h, - -help Displays an help message.
+ - d, - -directory < dir > Stores the data in the given directory. If
+ not given, a directory in ~/.numbench
+ is chosen.
+ - c, - -clean Removes the temporary data at the end.
+ - i, - -imageformat < format > Selects the given format for the resulting
+ images. Available are png, svg, eps, ps,
+ pdf. Default is svg.
+"""
modnames = modules.getModulesNames()
print "Modules:"
@@ -90,7 +87,7 @@ cfg.parseArguments()
# Start configuration parser
if not os.path.exists(cfg.inputfile):
- sys.stderr.write("File not found: " + cfg.inputfile)
+ print "File not found: %s\n\n" % cfg.inputfile
print_help()
exit(1)
parser = Parser(cfg.inputfile)
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [gentoo-commits] proj/auto-numerical-bench:master commit in: numbench/
@ 2012-09-17 8:08 Andrea Arteaga
0 siblings, 0 replies; 21+ messages in thread
From: Andrea Arteaga @ 2012-09-17 8:08 UTC (permalink / raw
To: gentoo-commits
commit: 139ea90d85595777e8aa73b930c9b977771595e8
Author: Andrea Arteaga <andyspiros <AT> gmail <DOT> com>
AuthorDate: Tue Sep 4 12:08:56 2012 +0000
Commit: Andrea Arteaga <andyspiros <AT> gmail <DOT> com>
CommitDate: Tue Sep 4 12:08:56 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/auto-numerical-bench.git;a=commit;h=139ea90d
Solve bug with void result.
---
numbench/report.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/numbench/report.py b/numbench/report.py
index f325eb0..6a0f584 100644
--- a/numbench/report.py
+++ b/numbench/report.py
@@ -92,7 +92,7 @@ def saveReport():
for tid, test in cfg.tests.items():
- longlabel = len(test.get('implementations')) > 1
+ longlabel = len(test.get('implementations', [])) > 1
for impl in test.get('implementations', []):
# Add line to the plot
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [gentoo-commits] proj/auto-numerical-bench:master commit in: numbench/
@ 2012-09-17 8:08 Andrea Arteaga
0 siblings, 0 replies; 21+ messages in thread
From: Andrea Arteaga @ 2012-09-17 8:08 UTC (permalink / raw
To: gentoo-commits
commit: a56f09edb1f63eef3eee28179be94fdfcdf6e523
Author: Andrea Arteaga <andyspiros <AT> gmail <DOT> com>
AuthorDate: Mon Sep 3 21:37:10 2012 +0000
Commit: Andrea Arteaga <andyspiros <AT> gmail <DOT> com>
CommitDate: Mon Sep 3 21:37:10 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/auto-numerical-bench.git;a=commit;h=a56f09ed
Correct axis.
---
numbench/report.py | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/numbench/report.py b/numbench/report.py
index 29bcd99..d5b3dad 100644
--- a/numbench/report.py
+++ b/numbench/report.py
@@ -42,7 +42,7 @@ class Plotter:
self.curstyle = 0
# Open figure
- self.figure = plt.figure(figsize=(12, 9), dpi=300)
+ plt.figure(figsize=(12, 9), dpi=300)
def addPlot(self, X, label):
@@ -55,7 +55,7 @@ class Plotter:
plt.errorbar(x, y, e, fmt=style, label=label, hold=True)
def savePlot(self, fname):
- axes = self.figure.get_axes()
+ axes = plt.axes()
axes.set_xscale(self.conf.get('xscale', 'linear'))
axes.set_yscale(self.conf.get('yscale', 'linear'))
plt.legend(loc='best', prop={'size':'x-small'})
@@ -91,6 +91,9 @@ def saveReport():
p = Plotter(cfg.module.reportConf())
for tid, test in cfg.tests.items():
+
+ print "RESULTS: ", test['results']
+
longlabel = len(test.get('implementations')) > 1
for impl in test.get('implementations', []):
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [gentoo-commits] proj/auto-numerical-bench:master commit in: numbench/
@ 2012-09-17 8:08 Andrea Arteaga
0 siblings, 0 replies; 21+ messages in thread
From: Andrea Arteaga @ 2012-09-17 8:08 UTC (permalink / raw
To: gentoo-commits
commit: ecc2c32d4b10e39acd94a4c4a6abccbef73b639c
Author: Andrea Arteaga <andyspiros <AT> gmail <DOT> com>
AuthorDate: Mon Sep 3 21:46:28 2012 +0000
Commit: Andrea Arteaga <andyspiros <AT> gmail <DOT> com>
CommitDate: Mon Sep 3 21:46:28 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/auto-numerical-bench.git;a=commit;h=ecc2c32d
Removed useless print in report.
---
numbench/report.py | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/numbench/report.py b/numbench/report.py
index d5b3dad..f325eb0 100644
--- a/numbench/report.py
+++ b/numbench/report.py
@@ -92,8 +92,6 @@ def saveReport():
for tid, test in cfg.tests.items():
- print "RESULTS: ", test['results']
-
longlabel = len(test.get('implementations')) > 1
for impl in test.get('implementations', []):
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [gentoo-commits] proj/auto-numerical-bench:master commit in: numbench/
@ 2012-09-27 11:19 Andrea Arteaga
0 siblings, 0 replies; 21+ messages in thread
From: Andrea Arteaga @ 2012-09-27 11:19 UTC (permalink / raw
To: gentoo-commits
commit: 9cab8166f1276536155f96fb66b8d362ab1d85aa
Author: Andrea Arteaga <andyspiros <AT> gmail <DOT> com>
AuthorDate: Thu Sep 27 11:18:48 2012 +0000
Commit: Andrea Arteaga <andyspiros <AT> gmail <DOT> com>
CommitDate: Thu Sep 27 11:18:48 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/auto-numerical-bench.git;a=commit;h=9cab8166
Added initial support for copying the reports at the end (working for
local copy).
---
numbench/benchconfig.py | 8 +++++++-
numbench/main.py | 16 +++++++++++-----
2 files changed, 18 insertions(+), 6 deletions(-)
diff --git a/numbench/benchconfig.py b/numbench/benchconfig.py
index 56ef304..ffdedba 100644
--- a/numbench/benchconfig.py
+++ b/numbench/benchconfig.py
@@ -38,6 +38,7 @@ rootsdir = None
pkgsdir = None
reportdir = None
logdir = None
+copyreport = None
# Module
module = None
@@ -50,7 +51,7 @@ tests = None
def parseArguments():
- global arguments, inputfile, clean, imageformat, basedir
+ global arguments, inputfile, clean, imageformat, basedir, copyreport
arguments = []
clean = False
@@ -82,6 +83,11 @@ def parseArguments():
imageformat = sys.argv[i + 1]
skipargs += 1
continue
+
+ if a in ('-r', '--copy-report'):
+ copyreport = sys.argv[i + 1]
+ skipargs += 1
+ continue
arguments.append(a)
diff --git a/numbench/main.py b/numbench/main.py
index cfeece5..cd0d3d7 100644
--- a/numbench/main.py
+++ b/numbench/main.py
@@ -39,14 +39,16 @@ Usage: numbench conffile [options]
numbench [ -h | --help ]
Options:
- - h, - -help Displays an help message.
- - d, - -directory < dir > Stores the data in the given directory. If
+ -h, --help Displays an help message.
+ -d, --directory <dir> Store the data in the given directory. If
not given, a directory in ~/.numbench
is chosen.
- - c, - -clean Removes the temporary data at the end.
- - i, - -imageformat < format > Selects the given format for the resulting
+ -c, --clean Remove the temporary data at the end.
+ -i, --imageformat <format> Select the given format for the resulting
images. Available are png, svg, eps, ps,
pdf. Default is svg.
+ -r, --copy-report <URI> Transfer the report directory to the given
+ path. Local paths are currently supported.
"""
modnames = modules.getModulesNames()
@@ -71,7 +73,7 @@ if len(sys.argv) < 2 or sys.argv[1] in ('-h', '--help'):
## BEGIN THE TRUE SCRIPT
# Import the packages
-import re
+import re, shutil
from fnmatch import fnmatch
from os.path import join as pjoin
@@ -251,6 +253,10 @@ report.saveReport()
if cfg.clean:
bu.rmdir(cfg.testsdir)
bu.rmdir(cfg.rootsdir)
+
+# Copy results
+if cfg.copyreport:
+ shutil.copytree(cfg.reportdir, cfg.copyreport, True)
# TODO: reintroduce the instructions feature (and remove "exit)
^ permalink raw reply related [flat|nested] 21+ messages in thread
end of thread, other threads:[~2012-09-27 11:19 UTC | newest]
Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-02 11:41 [gentoo-commits] proj/auto-numerical-bench:master commit in: numbench/ Andrea Arteaga
-- strict thread matches above, loose matches on Subject: below --
2012-09-27 11:19 Andrea Arteaga
2012-09-17 8:08 Andrea Arteaga
2012-09-17 8:08 Andrea Arteaga
2012-09-17 8:08 Andrea Arteaga
2012-08-07 22:58 Andrea Arteaga
2012-08-04 20:24 Andrea Arteaga
2012-04-09 19:25 Andrea Arteaga
2012-02-28 19:20 Andrea Arteaga
2012-02-27 15:05 Andrea Arteaga
2011-12-27 0:13 Andrea Arteaga
2011-08-22 18:02 Andrea Arteaga
2011-08-19 23:19 Andrea Arteaga
2011-08-19 23:11 Andrea Arteaga
2011-08-18 19:47 Andrea Arteaga
2011-08-17 18:00 Andrea Arteaga
2011-08-17 16:21 Andrea Arteaga
2011-08-17 15:00 Andrea Arteaga
2011-08-17 14:38 Andrea Arteaga
2011-08-17 14:38 Andrea Arteaga
2011-08-17 0:00 Andrea Arteaga
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox