summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Arteaga <andyspiros@gmail.com>2012-02-28 13:03:41 +0100
committerAndrea Arteaga <andyspiros@gmail.com>2012-02-28 13:03:41 +0100
commitd6e2443b1bf4bac6e9ec836f6155d9d26e0a0d48 (patch)
treeeb2f242c35e8c7212ede7f6919b4c0f1c671d85f
parentRestore copy logs and input file. (diff)
downloadauto-numerical-bench-d6e2443b1bf4bac6e9ec836f6155d9d26e0a0d48.tar.gz
auto-numerical-bench-d6e2443b1bf4bac6e9ec836f6155d9d26e0a0d48.tar.bz2
auto-numerical-bench-d6e2443b1bf4bac6e9ec836f6155d9d26e0a0d48.zip
Removed useless files and deprecated modules.
-rw-r--r--cblastests.in12
-rw-r--r--fftwtests.in5
-rw-r--r--lapacktests.in9
-rw-r--r--numbench/basemodule.py287
-rw-r--r--numbench/benchchilds.py30
-rw-r--r--numbench/blas.py23
-rw-r--r--numbench/blas_accuracy.py164
-rw-r--r--numbench/blasbase.py82
-rw-r--r--numbench/btlbase.py194
-rw-r--r--numbench/cblas.py23
-rw-r--r--numbench/fftw.py86
-rw-r--r--numbench/lapack.py70
-rw-r--r--numbench/lapack_accuracy.py169
-rw-r--r--numbench/metis.py184
-rw-r--r--numbench/scalapack.py88
15 files changed, 0 insertions, 1426 deletions
diff --git a/cblastests.in b/cblastests.in
deleted file mode 100644
index 670ddc4..0000000
--- a/cblastests.in
+++ /dev/null
@@ -1,12 +0,0 @@
-# Testing different implementations of CBLAS
-
-# cblas-reference is a wrapper for blas: test this with different blas implementations
-reference-eigen sci-libs/cblas-reference-20110218 blas:eigen
-reference-openblas sci-libs/cblas-reference-20110218 blas:openblas-threads
-reference-acml sci-libs/cblas-reference-20110218 blas:acml64-gfortran
-
-# Other implementations are not wrappers
-# Test them using gcc-4.6.1 and enabling vectorization
-gsl gsl-1.15-r1 CC=gcc-4.6.1 CFLAGS="-O3 -pipe -march=native -msse3 -msse4.1 -msse4.2"
-goto sci-libs/gotoblas2-1.13 CC=gcc-4.6.1 CFLAGS="-O3 -pipe -march=native -msse3 -msse4.1 -msse4.2" USE=incblas TARGET=NEHALEM
-openblas sci-libs/openblas CC=gcc-4.6.1 CFLAGS="-O3 -pipe -march=native -msse3 -msse4.1 -msse4.2" USE=incblas TARGET=NEHALEM \ No newline at end of file
diff --git a/fftwtests.in b/fftwtests.in
deleted file mode 100644
index 04a905d..0000000
--- a/fftwtests.in
+++ /dev/null
@@ -1,5 +0,0 @@
-# Testing FFTW with different gcc versions and enabling vectorization
-
-gcc-4.6.1 sci-libs/fftw-3.2.2-r1 CC=gcc-4.6.1 CFLAGS="-O3 -march=native -msse2 -msse3 -mssse3 -msse4.1 -msse4.2"
-gcc-4.5.2 sci-libs/fftw-3.2.2-r1 CC=gcc-4.5.2 CFLAGS="-O3 -march=native -msse2 -msse3 -mssse3 -msse4.1 -msse4.2"
-gcc-4.3.6 sci-libs/fftw-3.2.2-r1 CC=gcc-4.3.6 CFLAGS="-O3 -march=native -msse2 -msse3 -mssse3 -msse4.1 -msse4.2" \ No newline at end of file
diff --git a/lapacktests.in b/lapacktests.in
deleted file mode 100644
index f427ebb..0000000
--- a/lapacktests.in
+++ /dev/null
@@ -1,9 +0,0 @@
-# Testing different implementations of LAPACK
-
-# lapack-reference relies on blas: test this with different blas implementations
-reference_eigen sci-libs/lapack-reference-3.3.1-r1 blas:eigen
-reference_openblas sci-libs/lapack-reference-3.3.1-r1 blas:openblas-threads
-
-# Testing other full LAPACK implementations enabling vectorization
-atlas sci-libs/atlas-3.9.41 CFLAGS="-O3 -march=native -msse3 -msse4.1 -msse4.2"
-acml sci-libs/acml-4.4.0-r1 -acml32-gfortran -acml32-gfortran-openmp \ No newline at end of file
diff --git a/numbench/basemodule.py b/numbench/basemodule.py
deleted file mode 100644
index 3e7beb7..0000000
--- a/numbench/basemodule.py
+++ /dev/null
@@ -1,287 +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.
-#
-from os.path import join as pjoin, basename, dirname
-import subprocess as sp
-import shlex, os, sys
-import shutil as shu
-
-import benchconfig as cfg
-from htmlreport import HTMLreport
-import basemodule
-from benchutils import mkdir, run_cmd
-from benchprint import Print
-import utils.benchpkgconfig as pc
-from testdescr import testdescr
-
-try:
- if not locals().has_key('initialized'):
- initialized = True
- import matplotlib
- matplotlib.use('Agg')
- import matplotlib.pyplot as plt
- import numpy as np
- with_images = True
-except ImportError:
- sys.stderr.write('Error: matplotlib and numpy are needed' + \
- 'in order to generate the reports!\n')
- sys.stderr.write('Continue anyway.\n\n')
- with_images = False
-
-
-class BaseModule:
- def __init__(self, args):
- self.summary = False
- self.summary_only = False
-
- self._initialize()
-
- passargs = []
- for i in args:
- if i in ('-S', '--summary-only'):
- self.summary_only = True
- continue
- elif i in ('-s', '--summary'):
- self.summary = True
- continue
- else:
- passargs += [i]
-
- self._parse_args(passargs)
-
- @classmethod
- def printHelp(cls):
- print "Usage: numbench " + cfg.modulename + " [options] [tests]"
- print
- print "Generic options:"
- print " -s -summary"
- print " Generate a summary image that contains all tests results"
- print " and show it on the HTML report page."
- print
- print " -S -summary-only"
- print " Only generate the summary image and skip all other plots."
- print
-
- # Alternatives-2 version
- def get_impls(self, root):
- output = sp.Popen(
- ['eselect', '--no-color', '--brief', self.libname, 'list'],
- env={'ROOT' : root}, stdout=sp.PIPE).communicate()[0]
- output = output.strip()
- if '(none found)' in output:
- 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()
- t = TestClass(root, impl, testdir, logdir)
- t.libname = self.libname
- t.tests = self.tests
- t.files = self.files
- return t
-
- def save_results(self, results, plottype='plot', ylabel="MFlops"):
- if not with_images:
- Print("Report generation skipped - missing libraries")
- return
-
- try:
- plt.figure()
- except:
- Print("Unable to generate plots")
- Print("Please make sure that X is running and $DISPLAY is set")
- return
-
- # Copy inputfile and logs
- shu.copytree(cfg.logdir, pjoin(cfg.reportdir, 'log'))
- baseinfile = basename(cfg.inputfile)
- shu.copy2(cfg.inputfile, pjoin(cfg.reportdir, baseinfile))
-
- if plottype == 'plot': plotf = plt.plot
- elif plottype == 'semilogx': plotf = plt.semilogx
- elif plottype == 'semilogy': plotf = plt.semilogy
- elif plottype == 'loglog': plotf = plt.loglog
- else:
- raise Exception('Unrecognized plot type: "' + plottype + '"')
-
- # Re-order the result dictionary
- newresults = {}
- for test in self.tests:
- newresults[test] = {}
- for nameimpl in results:
- nameimplstr = pjoin(*nameimpl)
- if results[nameimpl] == None:
- continue
- resdat = results[nameimpl][test]
- newresults[test][nameimplstr] = resdat
-
- # Begin the HTML report
- htmlfname = pjoin(cfg.reportdir, 'index.html')
- html = HTMLreport(htmlfname)
-
- # Generate summary - a single image with all plots
- if self.summary or self.summary_only:
- # Save summary figure
- sprows = (len(self.tests)+1)/2
- plt.figure(figsize=(16,6*sprows), dpi=300)
- plt.subplots_adjust(wspace=.4, hspace=.4)
- for i, test in enumerate(self.tests, 1):
- plt.subplot(sprows, 2, i)
- plt.title(testdescr[test])
- for impl in newresults[test]:
- x,y = np.loadtxt(newresults[test][impl], unpack=True)
- plotf(x,y, label=impl, hold=True)
- if self.summary_only:
- plt.legend(loc='best')
- plt.xlabel('size')
- plt.ylabel(ylabel)
- plt.grid(True)
- fname = pjoin(cfg.reportdir, 'summary.png')
- plt.savefig(fname, format='png', bbox_inches='tight', \
- transparent=True)
- html.addFig("Summary", image=os.path.basename(fname), width='90%')
- Print('Summary figure saved: ' + fname)
-
- # Generate plots
- if not self.summary_only:
- for test in self.tests:
- plt.figure(figsize=(12,9), dpi=300)
- for impl in newresults[test]:
- x,y = np.loadtxt(newresults[test][impl], unpack=True)
- plotf(x,y, label=impl, hold=True)
- plt.legend(loc='best')
- plt.xlabel('size')
- plt.ylabel(ylabel)
- plt.grid(True)
- fname = pjoin(cfg.reportdir, test+".png")
- plt.savefig(fname, format='png', bbox_inches='tight', \
- transparent=True)
- html.addFig(testdescr[test], image=os.path.basename(fname))
- Print('Figure ' + fname + ' saved')
-
- html.close()
- Print('HTML report generated: ' + htmlfname)
-
-class CompilationError(Exception):
- def __init__(self, logfile):
- self.logfile = logfile
-
-
-class BaseTest:
- libname = None
- tests = None
- files = None
-
- def __init__(self, root, impl, testdir, logdir):
- self.root = root
- self.impl = impl
- self.testdir = testdir
- self.logdir = pjoin(logdir, impl)
- self.compileenv = {}
- self.runenv = {}
-
- mkdir(self.logdir)
-
- self.libdir = cfg.libdir
- while self.libdir[0] == '/':
- self.libdir = self.libdir[1:]
- self.libdir = pjoin(self.root, self.libdir)
-
- # Base version
- def _generateResults(self):
- return dict(zip(self.tests, self.files))
-
- # Alternatives-2 version with pkg-config
- def _get_flags(self):
- # 1. Run with no requires
- pfile = pc.getFile(self.libname, self.impl, self.root)
- flags = pc.run(pfile, self.root, False)
- logfile = file(pjoin(self.logdir, 'pkg-config.log'), 'w')
- print >> logfile, "File:", pfile
- print >> logfile, "Result:", flags
-
- # 2. Get requires
- requires = pc.requires(pfile)
- print >> logfile, "Requires:", requires
-
- # 3.Substitute requires and add flags
- for r in requires:
- if r in self.changes.keys():
- pfile = pc.getFile(r, self.changes[r])
- flags += ' ' + pc.run(pfile)
- else:
- flags += ' ' + pc.run(r)
- print >> logfile, "Third run:", flags
- logfile.close()
-
- return shlex.split(flags)
-
- def run_test(self, changes={}):
- self.changes = changes
-
- # Convenient renames and definition of report files
- name = self.libname
- root = self.root
- testdir = self.testdir
- self.files = [pjoin(testdir,f) for f in self.files]
- if cfg.libdir[0] == '/':
- libdir = root+cfg.libdir
- else:
- libdir = pjoin(root, cfg.libdir)
-
- # Create dir. If all results already exist use them and do not perform
- # the tests, otherwise remove every old results.
- runtests = False
- if os.path.exists(testdir):
- runtests = not all([os.path.exists(i) for i in self.files])
- else:
- os.makedirs(testdir)
- runtests = True
- if not runtests:
- Print("Not testing: results exist")
- return self._generateResults()
- for i in self.files:
- if os.path.exists(i): os.remove(i)
-
- # Compile test suite
- try:
- returncode, exe, logfile = self._compileTest()
- if returncode != 0:
- raise CompilationError(logfile)
- except CompilationError as e:
- Print("Compilation failed")
- Print("See log: " + e.logfile)
- return
- Print("Compilation successful")
-
- # Run test
- logfile = pjoin(self.logdir, name+"_run.log")
- retcode = self._executeTest(exe, logfile=logfile)
- if retcode != 0:
- Print("Test failed")
- Print("See log: " + logfile)
- return
- Print("Test successful")
-
- # Return
- return self._generateResults()
-
diff --git a/numbench/benchchilds.py b/numbench/benchchilds.py
deleted file mode 100644
index 1686639..0000000
--- a/numbench/benchchilds.py
+++ /dev/null
@@ -1,30 +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.
-#
-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/blas.py b/numbench/blas.py
deleted file mode 100644
index afdaa19..0000000
--- a/numbench/blas.py
+++ /dev/null
@@ -1,23 +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 blasbase
-
-class Module(blasbase.BLASBase):
- def _initialize(self):
- self.libname = "blas"
- blasbase.BLASBase._initialize(self) \ No newline at end of file
diff --git a/numbench/blas_accuracy.py b/numbench/blas_accuracy.py
deleted file mode 100644
index f194d31..0000000
--- a/numbench/blas_accuracy.py
+++ /dev/null
@@ -1,164 +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 subprocess as sp
-import shlex, os
-from os.path import join as pjoin
-
-from benchutils import mkdir, run_cmd
-from benchprint import Print
-from htmlreport import HTMLreport
-import basemodule
-import benchconfig as cfg
-import benchchildren
-
-class Module(basemodule.BaseModule):
-
- def _initialize(self):
- self.libname = 'blas'
- self.avail=['axpy', 'matrix_vector', 'trisolve_vector', 'matrix_matrix']
-
- def _parse_args(self, args):
- # Parse arguments
- tests = []
- for i in args:
- if i in self.avail:
- tests.append(i)
- continue
- raise Exception("Argument not recognized: " + i)
-
- # Sort tests
- self.tests = [i for i in self.avail if i in tests]
-
- # If no test is specified, then do everything
- if len(self.tests) == 0:
- self.tests = self.avail
-
- # Generate list of dat (result) files, relative to the testdir
- self.files = [pjoin('accuracy_%s_%s.dat' % (op, self.libname)) \
- for op in self.tests]
-
- @staticmethod
- def _testClass():
- return BLAS_accuracyTest
-
-
- def save_results(self, results):
- basemodule.BaseModule.save_results(self, results, 'loglog')
-
-class BLAS_accuracyTest(basemodule.BaseTest):
-
- compileenv = {}
- runenv = {}
-
- def _compileTest(self):
- self.compileenv = {}
-
- # Flags and envvars lists
- includes = [pjoin(self.root, 'usr/include')]
- libraries = []
- libdirs = [self.libdir]
- defines = ['NDEBUG']
- flags = []
-
- ## Interpret flags
- for flag in self._get_flags() + \
- shlex.split(run_cmd(['portageq', 'envvar', 'CXXFLAGS']).strip()):
- flag = flag.strip()
- if flag[:2] == '-l':
- libraries.append(flag[2:])
- elif flag[:2] == '-L':
- libdirs.append(flag[2:])
- elif flag[:2] == '-I':
- includes.append(flag[2:])
- else:
- flags.append(flag)
-
- # Set compile environment
- self.compileenv['INCLUDE_PATH'] = ':'.join(includes)
- self.compileenv['LIBRARY_PATH'] = ':'.join(libdirs)
- self.compileenv['LD_LIBRARY_PATH'] = ':'.join(libdirs)
- self.runenv['LD_LIBRARY_PATH'] = ':'.join(libdirs)
-
- exe = pjoin(self.testdir, "test")
- source = pjoin(cfg.btldir, "accuracy/main_blas.cpp")
-
- # Retrieve compiler
- cxx = 'g++'
- cxx_portage = run_cmd(['portageq', 'envvar', 'CXX']).strip()
- if cxx_portage != '':
- cxx = cxx_portage
- if os.environ.has_key('CXX'):
- cxx = os.environ['CXX']
-
- # Form command line arguments
- args = [cxx, source, '-o', exe]
- args += ['-I'+I for I in includes]
- args += ['-l'+l for l in libraries]
- args += ['-L'+L for L in libdirs]
- args += ['-D'+D for D in defines]
- args += flags
-
- # Open logfile or redirect to PIPE
- logfile = file(pjoin(self.logdir, "compile.log"), 'w')
- logfile.write(' '.join([n+'='+v for n,v in self.compileenv.items()]))
- logfile.write(' ' + ' '.join(args) + '\n' + 80*'-' + '\n')
- logfile.flush()
-
- # Execute
- proc=sp.Popen(args,stdout=logfile,stderr=sp.STDOUT,env=self.compileenv)
- proc.wait()
-
- # Close, return
- logfile.close()
- return proc.returncode, exe, logfile.name
-
-
- def _executeTest(self, exe, logfile):
- # Log dynamic link
- lddlogfile = file(pjoin(self.logdir, 'ldd.log'), 'w')
- sp.Popen(['ldd', '-v', exe], stdout=lddlogfile, env=self.runenv).wait()
-
- # Open pipe
- logfile = file(logfile, 'w')
- args = [exe] + self.tests
- logfile.write(' '.join([n+'='+v for n,v in self.runenv.items()]) + ' ')
- logfile.write(' '.join(args) + '\n')
- logfile.write(80*'-' + '\n')
- proc = sp.Popen(args, bufsize=1, stdout=sp.PIPE, stderr=sp.PIPE,
- env=self.runenv, cwd=self.testdir)
- benchchildren.append(proc)
-
- # Interpret output
- Print.down()
- while True:
- line = proc.stdout.readline()
- if not line:
- break
- logfile.write(line)
- if len(line.strip()) == 0:
- continue
- if line[0] != ' ':
- Print.up()
- Print(line.strip().split()[-1])
- Print.down()
- else:
- Print(line.strip())
- Print.up()
- logfile.close()
- proc.wait()
- return proc.returncode
diff --git a/numbench/blasbase.py b/numbench/blasbase.py
deleted file mode 100644
index c08987f..0000000
--- a/numbench/blasbase.py
+++ /dev/null
@@ -1,82 +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 os, btlbase
-import subprocess as sp
-import shlex
-from os.path import join as pjoin
-
-avail1 = ['axpy', 'axpby', 'rot']
-avail2 = ['matrix_vector','atv','symv', 'ger', 'syr2',
- 'trisolve_vector']
-avail3 = ['matrix_matrix', 'aat', 'trisolve_matrix', 'trmm']
-
-class BLASBase(btlbase.BTLBase):
-
- avail1 = avail1
- avail2 = avail2
- avail3 = avail3
- avail = avail1 + avail2 + avail3
-
- def _initialize(self):
- pass
-
- def _parse_args(self, args):
- passargs = []
- # Parse arguments
- tests = []
- for i in args:
- if i == '1':
- tests += self.avail1
- continue
- if i == '2':
- tests += self.avail2
- continue
- if i == '3':
- tests += self.avail3
- continue
- if i in self.avail:
- tests.append(i)
- continue
- passargs.append(i)
-
- # Sort tests
- self.tests = [i for i in self.avail if i in tests]
-
- # If no test is specified, then choose four standard tests
- if len(self.tests) == 0:
- self.tests = ['axpy', 'matrix_vector', \
- 'trisolve_vector', 'matrix_matrix']
-
- btlbase.BTLBase._parse_args(self, passargs)
-
- @staticmethod
- def _testClass():
- return BLASTest
-
-
-class BLASTest(btlbase.BTLTest):
- @staticmethod
- def _btl_source():
- return "libs/BLAS/main.cpp"
-
- @staticmethod
- def _btl_includes():
- return ["libs/BLAS"]
-
- def _btl_defines(self):
- return ["CBLASNAME="+self.libname, self.libname.upper()+"_INTERFACE"] \ No newline at end of file
diff --git a/numbench/btlbase.py b/numbench/btlbase.py
deleted file mode 100644
index 23f1c51..0000000
--- a/numbench/btlbase.py
+++ /dev/null
@@ -1,194 +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, os, shlex
-import subprocess as sp
-from os.path import join as pjoin
-
-from benchutils import mkdir, run_cmd
-from benchprint import Print
-from htmlreport import HTMLreport
-import basemodule
-import benchconfig as cfg
-import benchchildren
-from testdescr import testdescr
-
-class BTLBase(basemodule.BaseModule):
-
- @classmethod
- def printHelp(cls):
- basemodule.BaseModule.printHelp()
-
- print "Tests:"
- for i in cls.avail:
- print " " + i + ":"
- print " " + testdescr[i]
- print
-
- def _parse_args(self, args):
- # 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')
-
-
-class BTLTest(basemodule.BaseTest):
-
- N = None
-
- def _compileTest(self):
- self.compileenv = {}
- self.runenv = {}
-
- # Includes
- includes = [pjoin(cfg.btldir, i) for i in \
- ('actions', 'generic_bench', 'generic_bench/utils', 'libs/STL') + \
- tuple(self._btl_includes())] + [pjoin(self.root, 'usr/include')]
-
- # Libraries
- libraries = ['rt']
-
- # Libdirs
- libdirs = [self.libdir]
-
- # Defines
- defines = ['NDEBUG'] + self._btl_defines()
- defines = self._btl_defines()
-
- # Flags
- flags = []
-
- ## Interpret flags
- for flag in self._get_flags() + \
- shlex.split(run_cmd(['portageq', 'envvar', 'CXXFLAGS']).strip()):
- flag = flag.strip()
- if flag[:2] == '-l':
- libraries.append(flag[2:])
- elif flag[:2] == '-L':
- libdirs.append(flag[2:])
- elif flag[:2] == '-I':
- includes.append(flag[2:])
- else:
- flags.append(flag)
-
- # Set compile environment
- self.compileenv['INCLUDE_PATH'] = ':'.join(includes)
- self.compileenv['LIBRARY_PATH'] = ':'.join(libdirs)
- self.compileenv['LD_LIBRARY_PATH'] = ':'.join(libdirs)
- self.runenv['LD_LIBRARY_PATH'] = ':'.join(libdirs)
- # PATH
- envpath = ':'.join([pjoin(self.root, l) for l in ('bin', 'usr/bin')])
- if (os.environ.has_key('PATH')):
- envpath += ':' + os.environ['PATH']
- self.compileenv['PATH'] = envpath
- self.runenv['PATH'] = envpath
-
- exe = pjoin(self.testdir, "test")
-
- # Retrieve compiler
- cxx = 'g++'
- cxx_portage = run_cmd(['portageq', 'envvar', 'CXX']).strip()
- if cxx_portage != '':
- cxx = cxx_portage
- if os.environ.has_key('CXX'):
- cxx = os.environ['CXX']
-
- # Form command line arguments
- args = [cxx, pjoin(cfg.btldir, self._btl_source()), '-o', exe]
- args += ['-I'+I for I in includes]
- args += ['-l'+l for l in libraries]
- args += ['-L'+L for L in libdirs]
- args += ['-D'+D for D in defines]
- args += flags
-
- # Open logfile or redirect to PIPE
- logfile = file(pjoin(self.logdir, "compile.log"), 'w')
- logfile.write(' '.join([n+'='+v for n,v in self.compileenv.items()]))
- logfile.write(' ' + ' '.join(args) + '\n' + 80*'-' + '\n')
- logfile.flush()
-
- # Execute
- proc=sp.Popen(args,stdout=logfile,stderr=sp.STDOUT,env=self.compileenv)
- proc.wait()
-
- # Close, return
- logfile.close()
- return proc.returncode, exe, logfile.name
-
- def _executeTest(self, exe, logfile, preargs=[]):
- # Log dynamic link
- lddlogfile = file(pjoin(self.logdir, 'ldd.log'), 'w')
- sp.Popen(['ldd', '-v', exe], stdout=lddlogfile, env=self.runenv).wait()
-
- # 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')
- logfile.write(80*'-' + '\n')
- proc = sp.Popen(args, bufsize=1, stdout=sp.PIPE, stderr=sp.PIPE,
- env=self.runenv, cwd=self.testdir)
- benchchildren.append(proc)
-
- # Interpret output
- while True:
- # Each operation test begins with a line on stderr
- errline = proc.stderr.readline()
- if not errline:
- break
- logfile.write(errline)
- resfile = errline.split()[-1]
- testname = resfile[6:-5-len(self.libname)]
- Print(resfile)
-
- # Many different sizes for each operation test
- Print.down()
- cur = 0
- tot = 1
- while cur != tot:
- outline = proc.stdout.readline()
- # If the line is void, something gone wrong
- if not outline:
- Print.up()
- Print('Execution error')
- return 1
- logfile.write(outline)
- 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()
- Print("Execution finished with return code " + str(proc.returncode))
- return proc.returncode
diff --git a/numbench/cblas.py b/numbench/cblas.py
deleted file mode 100644
index ad33663..0000000
--- a/numbench/cblas.py
+++ /dev/null
@@ -1,23 +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 blasbase
-
-class Module(blasbase.BLASBase):
- def _initialize(self):
- self.libname = "cblas"
- blasbase.BLASBase._initialize(self) \ No newline at end of file
diff --git a/numbench/fftw.py b/numbench/fftw.py
deleted file mode 100644
index ec30508..0000000
--- a/numbench/fftw.py
+++ /dev/null
@@ -1,86 +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 os, btlbase
-
-class Module(btlbase.BTLBase):
- def _initialize(self):
- self.libname = "fftw"
- self.avail = (
- "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"
- )
-
- def _parse_args(self, args):
- passargs = []
-
- # Parse arguments
- tests = []
- for i in args:
- if i in self.avail:
- tests.append(i)
- continue
- passargs.append(i)
-
- # Sort tests
- self.tests = [i for i in self.avail if i in tests]
-
- # If no test is specified, run everything
- if len(self.tests) == 0:
- self.tests = self.avail
-
- btlbase.BTLBase._parse_args(self, passargs)
-
- @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():
- return FFTWTest
-
-
-
-class FFTWTest(btlbase.BTLTest):
-
- def _get_flags(self):
- if self.impl == 'fftw':
- return ['-lfftw3', '-lm', '-g3']
- elif self.impl == 'fftw_threads':
- return ['-lfftw3_threads', '-lm']
-
- @staticmethod
- def _btl_source():
- return "libs/FFTW/main.cpp"
-
- @staticmethod
- def _btl_includes():
- return ["libs/FFTW"]
-
- @staticmethod
- def _btl_defines():
- return [] \ No newline at end of file
diff --git a/numbench/lapack.py b/numbench/lapack.py
deleted file mode 100644
index f440903..0000000
--- a/numbench/lapack.py
+++ /dev/null
@@ -1,70 +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 os, btlbase
-import subprocess as sp
-import shlex
-
-class Module(btlbase.BTLBase):
-
- libname = "lapack"
- avail = ['general_solve', 'least_squares', 'lu_decomp', \
- 'cholesky', 'qr_decomp', 'svd_decomp', 'syev', 'stev', 'symm_ev']
-
- def _initialize(self):
- pass
-
- def _parse_args(self, args):
- passargs = []
-
- # Parse arguments
- tests = []
- for i in args:
- if i in self.avail:
- tests.append(i)
- continue
- passargs.append(i)
-
- # Sort tests
- self.tests = [i for i in self.avail if i in tests]
-
- # If no test is specified, run everything
- if len(self.tests) == 0:
- self.tests = ['lu_decomp', 'cholesky', 'qr_decomp', 'svd_decomp',\
- 'syev', 'stev']
-
- btlbase.BTLBase._parse_args(self, passargs)
-
- @staticmethod
- def _testClass():
- return LapackTest
-
-
-
-class LapackTest(btlbase.BTLTest):
- @staticmethod
- def _btl_source():
- return "libs/LAPACK/main.cpp"
-
- @staticmethod
- def _btl_includes():
- return ["libs/BLAS", "libs/LAPACK"]
-
- @staticmethod
- def _btl_defines():
- return ["LAPACKNAME=lapack"]
- \ No newline at end of file
diff --git a/numbench/lapack_accuracy.py b/numbench/lapack_accuracy.py
deleted file mode 100644
index 3e04aa3..0000000
--- a/numbench/lapack_accuracy.py
+++ /dev/null
@@ -1,169 +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 subprocess as sp
-import shlex, os
-from os.path import join as pjoin
-
-from benchutils import mkdir, run_cmd
-from benchprint import Print
-from htmlreport import HTMLreport
-import basemodule
-import benchconfig as cfg
-import benchchildren
-
-class Module(basemodule.BaseModule):
-
- def _initialize(self):
- self.libname = 'lapack'
- self.avail=['lu_decomp', 'cholesky', 'svd_decomp', 'qr_decomp', \
- 'syev', 'stev']
-
- def _parse_args(self, args):
- # Parse arguments
- tests = []
- for i in args:
- if i in self.avail:
- tests.append(i)
- continue
- raise Exception("Argument not recognized: " + i)
-
- # Sort tests
- self.tests = [i for i in self.avail if i in tests]
-
- # If no test is specified, then do everything
- if len(self.tests) == 0:
- self.tests = self.avail
-
- # Generate list of dat (result) files, relative to the testdir
- self.files = [pjoin('accuracy_%s_%s.dat' % (op, self.libname)) \
- for op in self.tests]
-
- @staticmethod
- def _testClass():
- return LAPACK_accuracyTest
-
-
- def save_results(self, results):
- basemodule.BaseModule.save_results(self, results, 'plot', \
- 'Relative error')
-
-class LAPACK_accuracyTest(basemodule.BaseTest):
-
- compileenv = {}
- runenv = {}
-
- def _compileTest(self):
- self.compileenv = {}
-
- # Flags and envvars lists
- includes = [pjoin(self.root, 'usr/include'),
- pjoin(cfg.btldir, 'accuracy'),
- pjoin(cfg.btldir, 'libs', 'LAPACK'),
- pjoin(cfg.btldir, 'generic_bench', 'utils')]
- libraries = []
- libdirs = [self.libdir]
- defines = ['NDEBUG']
- flags = []
-
- ## Interpret flags
- for flag in self._get_flags() + \
- shlex.split(run_cmd(['portageq', 'envvar', 'CXXFLAGS']).strip()):
- flag = flag.strip()
- if flag[:2] == '-l':
- libraries.append(flag[2:])
- elif flag[:2] == '-L':
- libdirs.append(flag[2:])
- elif flag[:2] == '-I':
- includes.append(flag[2:])
- else:
- flags.append(flag)
-
- # Set compile environment
- self.compileenv['INCLUDE_PATH'] = ':'.join(includes)
- self.compileenv['LIBRARY_PATH'] = ':'.join(libdirs)
- self.compileenv['LD_LIBRARY_PATH'] = ':'.join(libdirs)
- self.runenv['LD_LIBRARY_PATH'] = ':'.join(libdirs)
-
- exe = pjoin(self.testdir, "test")
- source = pjoin(cfg.btldir, "accuracy/lapack/main_lapack.cpp")
-
- # Retrieve compiler
- cxx = 'g++'
- cxx_portage = run_cmd(['portageq', 'envvar', 'CXX']).strip()
- if cxx_portage != '':
- cxx = cxx_portage
- if os.environ.has_key('CXX'):
- cxx = os.environ['CXX']
-
- # Form command line arguments
- args = [cxx, source, '-o', exe]
- args += ['-I'+I for I in includes]
- args += ['-l'+l for l in libraries]
- args += ['-L'+L for L in libdirs]
- args += ['-D'+D for D in defines]
- args += flags
-
- # Open logfile or redirect to PIPE
- logfile = file(pjoin(self.logdir, "compile.log"), 'w')
- logfile.write(' '.join([n+'='+v for n,v in self.compileenv.items()]))
- logfile.write(' ' + ' '.join(args) + '\n' + 80*'-' + '\n')
- logfile.flush()
-
- # Execute
- proc=sp.Popen(args,stdout=logfile,stderr=sp.STDOUT,env=self.compileenv)
- proc.wait()
-
- # Close, return
- logfile.close()
- return proc.returncode, exe, logfile.name
-
-
- def _executeTest(self, exe, logfile):
- # Log dynamic link
- lddlogfile = file(pjoin(self.logdir, 'ldd.log'), 'w')
- sp.Popen(['ldd', '-v', exe], stdout=lddlogfile, env=self.runenv).wait()
-
- # Open pipe
- logfile = file(logfile, 'w')
- args = [exe] + self.tests
- logfile.write(' '.join([n+'='+v for n,v in self.runenv.items()]) + ' ')
- logfile.write(' '.join(args) + '\n')
- logfile.write(80*'-' + '\n')
- proc = sp.Popen(args, bufsize=1, stdout=sp.PIPE, stderr=logfile,
- env=self.runenv, cwd=self.testdir)
- benchchildren.append(proc)
-
- # Interpret output
- Print.down()
- while True:
- line = proc.stdout.readline()
- if not line:
- break
- logfile.write(line)
- if len(line.strip()) == 0:
- continue
- if line[0] != ' ':
- Print.up()
- Print(line.strip())
- Print.down()
- else:
- Print(line[1:-1])
- Print.up()
- logfile.close()
- proc.wait()
- return proc.returncode
diff --git a/numbench/metis.py b/numbench/metis.py
deleted file mode 100644
index 4c7c36b..0000000
--- a/numbench/metis.py
+++ /dev/null
@@ -1,184 +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 os, shlex, numpy as np, subprocess as sp
-from os.path import realpath, exists as pexists, join as pjoin
-from random import randint
-
-import basemodule
-import benchconfig as cfg
-from benchutils import mkdir
-from benchprint import Print
-import benchchildren
-
-inputsdir = pjoin(cfg.testsdir, 'metis-input')
-mkdir(inputsdir)
-
-avail_graph = ['pmetis-8', 'kmetis-8', 'pmetis-64', 'kmetis-64']
-avail_mesh = []
-avail_matrix = []
-
-class Module(basemodule.BaseModule):
-
- #classmethod
- def _initialize(cls):
- cls.avail = avail_graph + avail_mesh + avail_matrix
-
- def _parse_args(self, args):
- tests = []
-
- # Parse arguments
- for i in args:
- if i in self.avail:
- tests.append(i)
- else:
- raise Exception("Argument not recognized: " + i)
-
- if len(tests) == 0:
- # If not test provided, perform all
- self.tests = self.avail
- else:
- # Sort tests
- self.tests = [i for i in self.avail if i in tests]
-
- @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')
-
- def getTest(self, root, impl, testdir, logdir):
- t = MetisTest(root, testdir, logdir, self.tests)
- return t
-
-
-class MetisTest:
- sizes = None
-
- def __init__(self, root, testdir, logdir, tests):
- self.root = root
- self.testdir = testdir
- self.logdir = logdir
- self.tests = tests
- mkdir(logdir)
- mkdir(testdir)
-
- @classmethod
- def _getSizes(cls):
- if cls.sizes is None:
- cls.sizes = [int(i) for i in np.logspace(3, 6, 100)]
- return cls.sizes
-
- def _generateFiles(self):
- Print("Generating input files...")
- # Graph
- if len([i for i in self.tests if i in avail_graph]) != 0:
- for size in self._getSizes():
- fname = pjoin(inputsdir, 'input_%i.graph' % size)
- if not pexists(fname):
- writeGraph(size, fname)
- Print("Done")
-
-
- def run_test(self, changes={}):
- self._generateFiles()
- result = {}
-
- for t in [i for i in self.tests if i in avail_graph]:
- Print('Doing ' + t)
- Print.down()
- res = []
-
- for s,size in enumerate(self._getSizes(), 1):
- inputfile = pjoin(inputsdir, 'input_%i.graph' % size)
-
- # Setting environment
- env = os.environ.copy()
- envpath = env.has_key('PATH') and env['PATH'] or ''
- env['PATH'] = ':'.join([pjoin(self.root, p) for p in \
- ('bin', 'usr/bin')]) + ':' + envpath
- envlib = env.has_key('LD_LIBARY_PATH') and \
- env['LD_LIBARY_PATH'] or ''
- env['LD_LIBRARY_PATH'] = ':'.join([pjoin(self.root,p) for p in \
- ('usr/lib', 'usr/lib64', 'usr/lib32')]) + ':' + envlib
-
- # Get executable
- exe, parts = t.split('-')
- exe = pjoin(self.root, 'usr/bin', exe)
-
- # Check dynamic linking
- logf = file(pjoin(self.logdir, 'ldd.log'), 'w')
- p = sp.Popen(\
- ['ldd', '-v', exe], stdout=logf, stderr=sp.STDOUT, env=env
- )
- p.wait()
-
- # Execute
- logname = pjoin(self.logdir, t + '_%i.log' % size)
- cmd = [exe, inputfile, parts]
- pr = sp.Popen(cmd, stdout=sp.PIPE, stderr=sp.STDOUT, env=env)
- benchchildren.append(pr)
- lines = pr.communicate()[0].split('\n')
-
- # Interpret output
- for i,line in enumerate(lines):
- if line[:18] == "Timing Information":
- begin_timing = i+1
- break
-
- lines = [i[:-1] for i in lines[begin_timing+1:]]
- for l in lines:
- if l.strip()[:13] == "Partitioning:":
- time = float(shlex.split(l)[1])
- break
- res.append((size,time))
- Print("size: %6i %2.3f sec. (%i/%i)" % (size, time, s, 100))
-
- Print.up()
-
- # Write sizes / times to result file
- resfname = pjoin(self.testdir, t+'.dat')
- resfs = file(resfname, 'w')
- for i in res:
- print >> resfs, i[0], i[1]
- resfs.close()
- result[t] = resfname
- return result
-
-
-def writeGraph(size, filename):
- edges = [[] for i in xrange(size)]
- nedges = 0
- for e1 in xrange(len(edges)):
- n = 0
- tot = randint(1, min(size / 4, 5))
- while n < tot:
- e2 = randint(0, size - 1)
- if e2 not in edges[e1] and e1 != e2:
- edges[e1].append(e2)
- edges[e2].append(e1)
- n += 1
- nedges += 1
- fs = file(filename, 'w')
- print >> fs, size, nedges
- for s in edges:
- print >> fs, ' '.join([str(i+1) for i in s])
- fs.close()
diff --git a/numbench/scalapack.py b/numbench/scalapack.py
deleted file mode 100644
index c639ef9..0000000
--- a/numbench/scalapack.py
+++ /dev/null
@@ -1,88 +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 os, btlbase, shlex, subprocess as sp
-
-numproc = 4
-
-class Module(btlbase.BTLBase):
- def _initialize(self):
- self.libname = "scalapack"
- self.avail = ['axpy', 'matrix_vector', 'lu_decomp', 'cholesky',
- 'qr_decomp', 'svd_decomp', 'symm_ev']
-
- def _parse_args(self, args):
- passargs = []
-
- # Parse arguments
- tests = []
- skip = 0
-
- for i, a in enumerate(args):
- if skip != 0:
- skip -= 1
- continue
- if a == '-n':
- skip += 1
- numproc = args[i+1]
- continue
- if a in self.avail:
- tests.append(a)
- continue
- passargs.append(a)
-
- # Sort tests
- self.tests = [i for i in self.avail if i in tests]
-
- # If no test is specified, then choose four standard tests
- if len(self.tests) == 0:
- self.tests = self.avail
-
- btlbase.BTLBase._parse_args(self, passargs)
-
- @staticmethod
- def _testClass():
- return ScaLAPACKTest
-
-
-class ScaLAPACKTest(btlbase.BTLTest):
-# def __init__(self, *args, **kwargs):
-# os.environ['CXX'] = 'mpic++'
-# btlbase.BTLTest.__init__(self, *args, **kwargs)
-
- def _get_flags(self):
- proc = sp.Popen(['mpic++', '-showme'], stdout=sp.PIPE)
- out = proc.communicate()[0]
- if proc.returncode != 0:
- raise Exception("An MPI implementation is needed in order to" \
- + " run the scalapack tests.")
- return shlex.split(out)[1:] + btlbase.BTLTest._get_flags(self)
-
- def _executeTest(self, exe, logfile):
- btlbase.BTLTest._executeTest(self, exe, logfile, \
- ['mpirun', '-n', str(numproc)])
-
- @staticmethod
- def _btl_source():
- return "libs/PBLAS/main.cpp"
-
- @staticmethod
- def _btl_includes():
- return ["libs/"+i for i in ("BLAS", "LAPACK", "BLACS", "PBLAS", "STL")]
-
- def _btl_defines(self):
- return ["PBLASNAME="+self.libname] \ No newline at end of file