Package esys :: Package escript :: Module benchmark :: Class BenchmarkSuite
[hide private]
[frames] | no frames]

Class BenchmarkSuite

object --+
         |
        BenchmarkSuite

Framework to run a bunch of Benchmarks using the object and creating a table of statistics.

Instance Methods [hide private]
Benchmark
__getitem__(self, i)
Returns the i-th benchmark in the suite through self[i].
 
__init__(self, name=None)
Sets up a suite of benchmarks.
int
__len__(self)
Returns the number of benchmarks in the suite.
str
__str__(self)
Returns the name of the benchmark suite.
 
addBenchmark(self, benchmark)
Adds a new Benchmark to the suite.
str
getHTML(self, filter, level=1)
Returns the results of the last benchmark run in HTML format.
 
run(self, scale=1)
Runs all benchmarks.

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__

Class Variables [hide private]
  MAX_LEVEL = 5
maximum number of level in headers for output
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__getitem__(self, i)
(Indexing operator)

 

Returns the i-th benchmark in the suite through self[i].

Parameters:
  • i (int) - index of the requested benchmark
Returns: Benchmark
i-th benchmark

__init__(self, name=None)
(Constructor)

 

Sets up a suite of benchmarks.

Parameters:
  • name (str) - name of the benchmark suite. If no name is given the class name is used.
Overrides: object.__init__

__len__(self)
(Length operator)

 

Returns the number of benchmarks in the suite.

Returns: int
number of benchmarks

__str__(self)
(Informal representation operator)

 

Returns the name of the benchmark suite.

Returns: str
the name
Overrides: object.__str__

addBenchmark(self, benchmark)

 

Adds a new Benchmark to the suite.

Parameters:
  • benchmark (Benchmark) - the benchmark to add

getHTML(self, filter, level=1)

 

Returns the results of the last benchmark run in HTML format.

Parameters:
  • filter (BenchmarkFilter) - filter to be applied to the results
  • level (int) - level used in header <H?> tags
Returns: str
HTML document

run(self, scale=1)

 

Runs all benchmarks.

Parameters:
  • scale (int or list of ints) - defines the number of (OpenMP) threads to be used. If scale is a scalar all benchmarks are run with scale number of threads. If scale is a list, the p-th problem in each of the benchmarks in the suite is run with scale[p] threads. If scale[p]<1 the p-th problem is omitted.