diff options
author | 2012-03-05 16:46:27 +0100 | |
---|---|---|
committer | 2012-03-05 16:46:27 +0100 | |
commit | e9e071f6f4e35f8184cee5daae7466f1d62ce349 (patch) | |
tree | eafeedad60fe79ba97fee6ba2aef54d0c29a0f8d | |
parent | Renamed HTMLReport, made reports modular. (diff) | |
parent | Added support for FFTW and sample configuration file. (diff) | |
download | auto-numerical-bench-e9e071f6f4e35f8184cee5daae7466f1d62ce349.tar.gz auto-numerical-bench-e9e071f6f4e35f8184cee5daae7466f1d62ce349.tar.bz2 auto-numerical-bench-e9e071f6f4e35f8184cee5daae7466f1d62ce349.zip |
Merge remote branch 'origin/master'
-rw-r--r-- | numbench/benchconfig.py | 2 | ||||
-rw-r--r-- | numbench/modules/blas.py | 4 | ||||
-rw-r--r-- | numbench/modules/cblas.py | 4 | ||||
-rw-r--r-- | numbench/modules/fftw.py | 70 | ||||
-rw-r--r-- | numbench/modules/internal/btlBase.py | 12 | ||||
-rw-r--r-- | numbench/modules/internal/lapackBase.py | 4 | ||||
-rw-r--r-- | numbench/modules/lapack.py | 4 | ||||
-rw-r--r-- | numbench/utils/portageutils.py | 2 | ||||
-rw-r--r-- | samples/fftwtests.xml | 31 |
9 files changed, 117 insertions, 16 deletions
diff --git a/numbench/benchconfig.py b/numbench/benchconfig.py index 64b8982..c7ff33b 100644 --- a/numbench/benchconfig.py +++ b/numbench/benchconfig.py @@ -1,5 +1,5 @@ #===================================================== -# Copyright (C) 2011 Andrea Arteaga <andyspiros@gmail.com> +# Copyright (C) 2011-2012 Andrea Arteaga <andyspiros@gmail.com> #===================================================== # # This program is free software; you can redistribute it and/or diff --git a/numbench/modules/blas.py b/numbench/modules/blas.py index 49aa31c..24834f5 100644 --- a/numbench/modules/blas.py +++ b/numbench/modules/blas.py @@ -18,8 +18,8 @@ import internal.blasBase as base class Module: - libname = "blas" - descr = "Test module for BLAS implementations" + libname = 'blas' + descr = 'Test module for BLAS implementations' __init__ = base.init getImplementations = base.getImplementations diff --git a/numbench/modules/cblas.py b/numbench/modules/cblas.py index bdc17a5..a0ef2c7 100644 --- a/numbench/modules/cblas.py +++ b/numbench/modules/cblas.py @@ -18,8 +18,8 @@ import internal.blasBase as base class Module: - libname = "cblas" - descr = "Test module for CBLAS implementations" + libname = 'cblas' + descr = 'Test module for CBLAS implementations' __init__ = base.init getImplementations = base.getImplementations diff --git a/numbench/modules/fftw.py b/numbench/modules/fftw.py new file mode 100644 index 0000000..1283244 --- /dev/null +++ b/numbench/modules/fftw.py @@ -0,0 +1,70 @@ +#===================================================== +# 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 exists, join as pjoin +from ..utils import btl +from internal import btlBase +from .. import benchconfig as cfg + +availableTests = ( + 'FFTW_1D_Forward_Measure', 'FFTW_1D_Forward_Estimate', + '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_3D_Forward_Measure', 'FFTW_3D_Forward_Estimate', + 'FFTW_3D_Backward_Measure', 'FFTW_3D_Backward_Estimate', +) +defaultTests = availableTests + + +class Module: + libname = 'fftw' + descr = 'Test module for FFTW library' + + def __init__(self, args): + self.tests = btl.selectTests(availableTests, args) + if len(self.tests) == 0: + self.tests = defaultTests + + def getImplementations(self, test): + ret = ['fftw3'] + for impl in ('fftw3_threads', 'fftw3_omp'): + l = pjoin(test['root'], cfg.libdir, 'lib'+impl+'.so') + if exists(l): + ret.append(impl) + return ret + + def runTest(self, test, implementation): + # Set up btlconfig + btlconfig = dict ( + source = 'libs/FFTW/main.cpp', + exe = pjoin(test['testdir'], implementation, 'test'), + libraries = [implementation, 'm'], + logdir = pjoin(test['logdir'], implementation), + testdir = pjoin(test['testdir'], implementation), + tests = self.tests + ) + + if implementation != 'fftw3': + btlconfig['libraries'].append('fftw3') + + return btlBase.runTest(self, test, btlconfig) + + getTests = btlBase.getTests + reportConf = btlBase.reportConf
\ No newline at end of file diff --git a/numbench/modules/internal/btlBase.py b/numbench/modules/internal/btlBase.py index 8237692..4cbb555 100644 --- a/numbench/modules/internal/btlBase.py +++ b/numbench/modules/internal/btlBase.py @@ -30,26 +30,26 @@ def runTest(self, test, btlconfig): for i in btlconfig['tests']]) if all([exists(i) for i in tmpres.values()]): - Print("Results exist - skipping run") + Print('Results exist - skipping run') return tmpres # Compile test suite ret = btl.compileTest(test, btlconfig) if ret != 0: - Print("Compilation failed with code: %i" % ret) + Print('Compilation failed with code: %i' % ret) return None else: - Print("Compilation successful") + Print('Compilation successful') # Run test suite ret, result = btl.runTest(test, btlconfig) if ret != 0: - Print("Execution failed with code: %i" % ret) - Print("The results will be incomplete") + Print('Execution failed with code: %i' % ret) + Print('The results will be incomplete') # TODO: remove this if possible (return incomplete results) return None else: - Print("Execution successful") + Print('Execution successful') return result diff --git a/numbench/modules/internal/lapackBase.py b/numbench/modules/internal/lapackBase.py index 7cd0c8c..b0f4a4c 100644 --- a/numbench/modules/internal/lapackBase.py +++ b/numbench/modules/internal/lapackBase.py @@ -40,11 +40,11 @@ def runTest(self, test, implementation): # Set up btlconfig btlconfig = dict ( source = 'libs/LAPACK/main.cpp', - exe = pjoin(test['testdir'], implementation, "test"), + exe = pjoin(test['testdir'], implementation, 'test'), logdir = pjoin(test['logdir'], implementation), testdir = pjoin(test['testdir'], implementation), btlincludes = ('libs/BLAS', 'libs/LAPACK'), - defines = ("LAPACKNAME="+self.libname, ), + defines = ('LAPACKNAME='+self.libname, ), flags = alt.getFlags(test, self.libname, implementation), tests = self.tests ) diff --git a/numbench/modules/lapack.py b/numbench/modules/lapack.py index 073e51a..13e46d5 100644 --- a/numbench/modules/lapack.py +++ b/numbench/modules/lapack.py @@ -18,8 +18,8 @@ import internal.lapackBase as base class Module: - libname = "lapack" - descr = "Test module for LAPACK implementations" + libname = 'lapack' + descr = 'Test module for LAPACK implementations' __init__ = base.init getImplementations = base.getImplementations diff --git a/numbench/utils/portageutils.py b/numbench/utils/portageutils.py index 41c0cdc..f58bb2b 100644 --- a/numbench/utils/portageutils.py +++ b/numbench/utils/portageutils.py @@ -19,7 +19,7 @@ import commands as cmd import subprocess as sp import os, portage, shlex from os.path import join as pjoin, dirname -from utils import benchutils as bu +import benchutils as bu class InstallException(Exception): def __init__(self, package, command, logfile): diff --git a/samples/fftwtests.xml b/samples/fftwtests.xml new file mode 100644 index 0000000..7791931 --- /dev/null +++ b/samples/fftwtests.xml @@ -0,0 +1,31 @@ +<tests> + + <test id="fftw-O0"> + <pkg>sci-libs/fftw-3.3-r2</pkg> + <emergeenv> + <var name="CFLAGS">-O0</var> + </emergeenv> + </test> + + <test id="fftw-O1"> + <pkg>sci-libs/fftw-3.3-r2</pkg> + <emergeenv> + <var name="CFLAGS">-O1</var> + </emergeenv> + </test> + + <test id="fftw-O2"> + <pkg>sci-libs/fftw-3.3-r2</pkg> + <emergeenv> + <var name="CFLAGS">-O2</var> + </emergeenv> + </test> + + <test id="fftw-O3"> + <pkg>sci-libs/fftw-3.3-r2</pkg> + <emergeenv> + <var name="CFLAGS">-O3</var> + </emergeenv> + </test> + +</tests> |