summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Arteaga <andyspiros@gmail.com>2012-02-22 19:56:45 +0100
committerAndrea Arteaga <andyspiros@gmail.com>2012-02-22 19:56:45 +0100
commit4773bae3dcb27e3e18ff8dece305f3d65a29ac71 (patch)
tree3bed967d3310fe8c985b0ef33383563588c985c1 /numbench
parentAdded wildcards and regexp support for skip. Fixed a few bugs. (diff)
downloadauto-numerical-bench-4773bae3dcb27e3e18ff8dece305f3d65a29ac71.tar.gz
auto-numerical-bench-4773bae3dcb27e3e18ff8dece305f3d65a29ac71.tar.bz2
auto-numerical-bench-4773bae3dcb27e3e18ff8dece305f3d65a29ac71.zip
Better results, error handling, sample configuration file.
Diffstat (limited to 'numbench')
-rw-r--r--numbench/confinput/xmlinput.py2
-rw-r--r--numbench/htmlreport.py9
-rw-r--r--numbench/main.py3
-rw-r--r--numbench/report.py9
-rw-r--r--numbench/utils/btl.py2
5 files changed, 19 insertions, 6 deletions
diff --git a/numbench/confinput/xmlinput.py b/numbench/confinput/xmlinput.py
index 2a145a9..4743730 100644
--- a/numbench/confinput/xmlinput.py
+++ b/numbench/confinput/xmlinput.py
@@ -105,7 +105,7 @@ def parseConf(fname):
skip = []
skipre = []
for s in t.getElementsByTagName('skip'):
- if not s.hasAtribute('type') or s.getAttribute('type') == 'glob':
+ if not s.hasAttribute('type') or s.getAttribute('type') == 'glob':
skip.append(s.firstChild.data)
elif s.getAttribute('type') == 'regexp':
skipre.append(s.firstChild.data)
diff --git a/numbench/htmlreport.py b/numbench/htmlreport.py
index 33c19fa..1880934 100644
--- a/numbench/htmlreport.py
+++ b/numbench/htmlreport.py
@@ -63,7 +63,8 @@ h1, h2, .plot, .descr, .info {
self.content += title + "</h1>"
date = time.strftime('%Y-%m-%d, %I:%M %p')
self.content += '<p class="info">Generated on ' + date + '</p>'
-
+
+ # Information regarding the CPU
cpuinfo = file('/proc/cpuinfo', 'r').readlines()
cpu = None
for l in cpuinfo:
@@ -71,7 +72,8 @@ h1, h2, .plot, .descr, .info {
cpu = l.split(':',1)[1].strip()
if cpu:
self.content += '<p class="info">CPU: ' + cpu + '</p>'
-
+
+ # Information regarding the memory
meminfo = file('/proc/meminfo', 'r').readlines()
mem = None
for l in meminfo:
@@ -79,7 +81,8 @@ h1, h2, .plot, .descr, .info {
mem = l.split(':',1)[1].strip()
if mem:
self.content += '<p class="info">Total memory: ' + mem + '</p>'
-
+
+ # Input file
self.content += '<div class="inputfile">Input file: ' + \
'<a href="%s">%s</a>' % (basename(inputfile), cfg.inputfile) + \
'<pre>%s</pre></div>' % xmlescape(file(cfg.inputfile, 'r').read())
diff --git a/numbench/main.py b/numbench/main.py
index 1cbb772..1285c18 100644
--- a/numbench/main.py
+++ b/numbench/main.py
@@ -147,6 +147,9 @@ for tname, ttest in cfg.tests.items():
if len(ttest['skip']) != 0:
Print(" - Skip implementations: " + ' '.join(ttest['skip']))
+ if len(ttest['skipre']) != 0:
+ Print(" - Skip implementations (regular expressions): " + ' '.join(ttest['skipre']))
+
if len(ttest['requires']) != 0:
Print(" - Pkg-config requirements substitutions:", '')
for c_0, c_1 in ttest['requires'].items():
diff --git a/numbench/report.py b/numbench/report.py
index 901723b..e3b4f73 100644
--- a/numbench/report.py
+++ b/numbench/report.py
@@ -16,6 +16,7 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
from os.path import join as pjoin, basename
+from shutil import copy as fcopy, copytree
import numpy as np
import benchconfig as cfg
@@ -68,7 +69,8 @@ def saveReport():
for tid,test in cfg.tests.items():
if test.has_key('implementations'):
for impl in test['implementations']:
- if test['results'][impl].has_key(operation):
+ res = test['results'][impl]
+ if res and res.has_key(operation):
resultsFile = test['results'][impl][operation]
x,y = np.loadtxt(resultsFile, unpack=True)
plotf(x, y, label=tid+'/'+impl, hold=True)
@@ -86,6 +88,11 @@ def saveReport():
html.close()
Print('HTML report generated: ' + htmlfname)
+ # Copy input and logs
+ inputdest = pjoin(cfg.reportdir, basename(cfg.inputfile))
+ fcopy(cfg.inputfile, inputdest)
+ copytree(cfg.logdir, pjoin(cfg.reportdir, 'log'))
+
# Initialize module
try:
diff --git a/numbench/utils/btl.py b/numbench/utils/btl.py
index 3031eb3..1f06f67 100644
--- a/numbench/utils/btl.py
+++ b/numbench/utils/btl.py
@@ -215,7 +215,7 @@ def runTest(test, btlconfig):
if not outline:
Print.up()
Print('Execution error')
- return 1
+ return 1, None
logfs.write(outline)
logfs.flush()