diff options
author | Andrea Arteaga <andyspiros@gmail.com> | 2012-03-23 11:36:50 +0100 |
---|---|---|
committer | Andrea Arteaga <andyspiros@gmail.com> | 2012-03-23 11:36:50 +0100 |
commit | 2e70cd3b49d01110923e7ea239da0e1572d3ff17 (patch) | |
tree | 0bd5d05e4c47a1b56c5048cb8326ae4862ba3ff5 /numbench | |
parent | Merge remote branch 'origin/master' (diff) | |
download | auto-numerical-bench-2e70cd3b49d01110923e7ea239da0e1572d3ff17.tar.gz auto-numerical-bench-2e70cd3b49d01110923e7ea239da0e1572d3ff17.tar.bz2 auto-numerical-bench-2e70cd3b49d01110923e7ea239da0e1572d3ff17.zip |
Solved BTL clock problem. Added initial (not tested) scalapack new module. Solved HTML issues.0.2_beta2
Diffstat (limited to 'numbench')
-rw-r--r-- | numbench/modules/scalapack.py | 75 | ||||
-rw-r--r-- | numbench/reports/__init__.py | 0 | ||||
-rw-r--r-- | numbench/reports/html.py | 2 | ||||
-rw-r--r-- | numbench/utils/btl.py | 7 |
4 files changed, 81 insertions, 3 deletions
diff --git a/numbench/modules/scalapack.py b/numbench/modules/scalapack.py new file mode 100644 index 0000000..28e694f --- /dev/null +++ b/numbench/modules/scalapack.py @@ -0,0 +1,75 @@ +#===================================================== +# Copyright (C) 2012 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. +# + +from os.path import join as pjoin + +from internal import btlBase +from ..utils import btl, alternatives as alt + +availableTests = ('axpy', 'matrix_vector', 'lu_decomp', 'cholesky', + 'qr_decomp', 'svd_decomp', 'symm_ev') +defaultTests = availableTests + +class Module: + libname = 'scalapack' + descr = 'Test module for ScaLAPACK implementations' + + def __init__(self, args): + passargs = [] + skip = 0 + self.numproc = 4 + for i, a in enumerate(args): + if skip > 0: + skip -= 1 + continue + elif a in ('-n', '--numproc'): + self.numproc = int(args[i+1]) + else: + passargs.append(a) + + self.tests = btl.selectTests(availableTests, args) + if len(self.tests) == 0: + self.tests = defaultTests + + def getImplementations(self, test): + return alt.getImplementations(test['root'], self.libname) + + def runTest(self, test, implementation): + btlincludes = ['libs/'+i for i in \ + ('BLAS', 'LAPACK', 'BLACS', 'PBLAS', 'STL')] + + # Set up btlconfig + btlconfig = dict ( + CXX = 'mpic++', + source = 'libs/PBLAS/main.cpp', + preargs = ('mpirun', '-np', self.numproc), + exe = pjoin(test['testdir'], implementation, 'test'), + logdir = pjoin(test['logdir'], implementation), + testdir = pjoin(test['testdir'], implementation), + btlincludes = tuple(btlincludes), + defines = ('PBLASNAME='+self.libname, ), + flags = alt.getFlags(test, self.libname, implementation), + tests = self.tests + ) + + return btlBase.runTest(self, test, btlconfig) + + getTests = btlBase.getTests + reportConf = btlBase.reportConf + + diff --git a/numbench/reports/__init__.py b/numbench/reports/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/numbench/reports/__init__.py diff --git a/numbench/reports/html.py b/numbench/reports/html.py index 356f2ab..0ab9ba4 100644 --- a/numbench/reports/html.py +++ b/numbench/reports/html.py @@ -19,7 +19,7 @@ import time from os.path import join as pjoin, basename from xml.sax.saxutils import escape as xmlescape -import benchconfig as cfg +from .. import benchconfig as cfg class ReportFile: def __init__(self, fname, title='Benchmarks report', \ diff --git a/numbench/utils/btl.py b/numbench/utils/btl.py index 541ff1e..d464d38 100644 --- a/numbench/utils/btl.py +++ b/numbench/utils/btl.py @@ -162,7 +162,10 @@ def compileTest(test, btlconfig): def runTest(test, btlconfig): + # Set runtime environment runenv = btlconfig['runenv'] + if not runenv.has_key('BTL_CONFIG'): + runenv['BTL_CONFIG'] = '--real' # Check linking logfs = file(pjoin(btlconfig['logdir'], 'btlLinking.log'), 'w') @@ -173,9 +176,9 @@ def runTest(test, btlconfig): # Prepare arguments args = (btlconfig['exe'],) + tuple(btlconfig['tests']) if btlconfig.has_key('preargs'): - args = btlconfig['preargs'] + args + args = tuple(btlconfig['preargs']) + args if btlconfig.has_key('postargs'): - args = args + btlconfig['postargs'] + args = args + tuple(btlconfig['postargs']) # Open log logfs = file(pjoin(btlconfig['logdir'], "btlRun.log"), 'w') |