mpi_array.benchmarks.benchmark.BenchmarkRunner¶
-
class
mpi_array.benchmarks.benchmark.
BenchmarkRunner
(argv=None)[source]¶ Bases:
object
Discovers and runs benchmarks.
Methods
__init__
([argv])Initialise. create_argument_parser
()Creates argparse.ArgumentParser
for handling command line.create_profile_stats
(profile_file_name)Factory function for creating a pstats.Stats
instance.discover_benchmarks
()Find benchmarks, store Benchmark
objects inbenchmarks
.filter
(b)Returns True
if theBenchmark
b
passes the filtering criterion.handle_profile
(profiler)log_profile_stats
(profile_stats[, sort_keys])Logs the output from pstats.Stats.print_stats()
.run
()Discover and run benchmarks. run_and_write_results
()Discovers, runs and records benchmark results in files. run_benchmarks
()Runs the benchmarks, results are stored in bench_results
.write_bench_results
(bench_results, ...)Writes the benchmark results bench_results
asjson
string to file namedbench_results_file_name
.write_benchmarks
(benchmarks, ...)Writes individual Benchmark
elements ofbenchmarks
asjson
string to file namedbenchmarks_file_name
.write_profile_stats
(profile_stats, ...)Dump the profile stats from the pstats.Stats
object to file.Attributes
bench_results
A list
of benchmark results.bench_results_file_name
A str
, name of file where benchmark results are written.benchmark_module_names
The list
of module names which are searched to discover benchmarks.benchmarks
The list
ofBenchmark
objects.benchmarks_file_name
A str
, name of file where benchmark results are written.comm
A mpi4py.MPI.Comm
object, typicallympi4py.MPI.COMM_WORLD
.default_timer
An callable
used to measure benchmark duration, e.g.discover_only
A bool
, ifTrue
only discover tests and do not run them.do_profile
A bool
, ifTrue
, performs a profile run in addition to the run.do_quick_run
A bool
, ifTrue
, performs a quick run.filter_name_regex
The re.RegularExpression
used to filter the benchmarks by name.is_root_rank
A bool
, ifTrue
this is running on theroot_rank
MPI rank.profile_file_name
A str
indicating the file name in which profile info is saved.profile_stats
A pstats.Stats
object in which profile info is accumulated.rank_logger
A logging.Logger
object for logging all rank process messages.root_logger
A logging.Logger
object for logging root-rank process messages.root_rank
An int
indicating the rank of the master MPI (root) process.