gonzales.benchmark.benchmark¶
- class gonzales.benchmark.benchmark.BenchmarkConfigBase(particle_nums, num_exec=5)¶
Base class for benchmark configuration.
- __init__(particle_nums, num_exec=5)¶
Initialize configuration.
- Parameters
particle_nums – tuple of integers representing particle numbers to be generated
num_exec – number of times the function is timed
- class gonzales.benchmark.benchmark.PPBenchmarkConfig(particle_nums, num_exec=5)¶
Bases:
gonzales.benchmark.benchmark.BenchmarkConfigBaseBenchmark configuration for brute force acceleration calculation
- do_timing(space)¶
Executes the calculation.
- Parameters
space – instance of gonzales.simulator.space
- class gonzales.benchmark.benchmark.BHBenchmarkConfig(particle_nums, theta=0.75, num_exec=5)¶
Bases:
gonzales.benchmark.benchmark.BenchmarkConfigBaseBenchmark configuration for Barnes-hut acceleration calculation
- __init__(particle_nums, theta=0.75, num_exec=5)¶
Initialize configuration.
- Parameters
particle_nums – tuple of integers representing particle numbers to be generated
theta – Barnes-Hut parameter
num_exec – number of times the function is timed
- do_timing(space)¶
Executes the calculation.
- Parameters
space – instance of gonzales.simulator.space
- class gonzales.benchmark.benchmark.BenchmarkSuite(output_filename=None)¶
Benchmark suite.
- __init__(output_filename=None)¶
Initialize the suite.
- Parameters
output_filename – filename of output json file
- add_benchmark(bench_name, bench_config)¶
Adds a benchmark instance to the suite.
- Parameters
bench_name – str, name of benchmark
bench_config – instance of BenchmarkConfigBase
- run()¶
Runs the benchmark suite, logs information and dumps results to json.
- gonzales.benchmark.benchmark.run_default_benchmark(output_filename='benchmark_results.json')¶
Runs the default benchmark suite.
- Parameters
output_filename – str, name of output json file