esys.escriptcore.benchmark Package

Classes

class esys.escriptcore.benchmark.Benchmark(name=None, description=None)

Bases: object

Runs a bunch of similar BenchmarkProblem s with a bunch of Options.

addOptions(options)

Adds options to the benchmark.

Parameters:options (Options) – the options to be added to the benchmark. If options==None the options are left unchanged.
addProblem(problem)

Adds a problem to the benchmark.

Parameters:problem (BenchmarkProblem) – the problem to be added
getHTML(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:

HTML document

Return type:

str

run(scale=1)

Runs all problems with all options.

Parameters:scale (int or list of int s) – 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.
class esys.escriptcore.benchmark.BenchmarkFilter

Bases: object

Object to filter the characteristics returned by Benchmark runs.

getResultNames()

Returns the names of the results produced when run() is called.

Returns:the list of the names to be used when the results of the run() call are printed
Return type:list of str
Note :this function has to overwritten by a particular problem
class esys.escriptcore.benchmark.BenchmarkProblem(name=None)

Bases: object

Represents a benchmark problem that can be run and which returns a list of characteristics such as timing, MFlops, error, etc.

run(options=None)

Runs the problem and returns a list of run characteristics.

Parameters:options (Options) – the options that are used for the run. Note that the number of OpenMP threads is controlled by the Benchmark the problem is run in.
Returns:run characteristics
Return type:any type that can be read by the BenchmarkFilter applied to it
Note :this function has to be overwritten by a particular problem
class esys.escriptcore.benchmark.BenchmarkSuite(name=None)

Bases: object

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

Variables:MAX_LEVEL – maximum number of level in headers for output
MAX_LEVEL = 5
addBenchmark(benchmark)

Adds a new Benchmark to the suite.

Parameters:benchmark (Benchmark) – the benchmark to add
getHTML(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:

HTML document

Return type:

str

run(scale=1)

Runs all benchmarks.

Parameters:scale (int or list of int) – 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.
class esys.escriptcore.benchmark.Options(name=None)

Bases: object

Defines a set of options to be used to run a BenchmarkProblem.

Functions

Others

  • __author__
  • __builtins__
  • __copyright__
  • __doc__
  • __file__
  • __license__
  • __name__
  • __package__
  • __url__