Commit 1660322a authored by Mikaël Salson's avatar Mikaël Salson

benchmark-releases.py: Add possibility to select releases and benchmarks

parent 85080a20
Pipeline #142265 passed with stages
in 42 minutes and 11 seconds
...@@ -74,8 +74,10 @@ stats = {} ...@@ -74,8 +74,10 @@ stats = {}
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
parser.add_argument('-c', '--current', action='store_true', help='install current HEAD') parser.add_argument('-c', '--current', action='store_true', help='install current HEAD')
parser.add_argument('-i', '--install', action='store_true', help='install various releases from %s' % ARCHIVE) parser.add_argument('-i', '--install', default=None, nargs='?', const=' ', help='install various releases from %s (default all, otherwise specify them separated with whitespaces, eg. "2018-01 2019.03")' % ARCHIVE)
parser.add_argument('-b', '--benchmark', action='store_true', help='benchmark installed releases') parser.add_argument('-b', '--benchmark', action='store_true', help='benchmark installed releases')
parser.add_argument('-s', '--select', dest='benchs', action='append',
help = 'Specify the benchmarks to select (among {}, default is all)'.format(', '.join(BENCHS.keys())))
parser.add_argument('-r', '--retries', type=int, default=1, help='Number of times each benchmark is launched') parser.add_argument('-r', '--retries', type=int, default=1, help='Number of times each benchmark is launched')
...@@ -152,10 +154,12 @@ def install(release, tgz): ...@@ -152,10 +154,12 @@ def install(release, tgz):
def install_current(): def install_current():
install(CURRENT, None) install(CURRENT, None)
def install_from_archive(): def install_from_archive(install_versions):
to_install_versions = install_versions.split()
for release, tgz in get_releases(): for release, tgz in get_releases():
try: try:
install(release, tgz) if len(to_install_versions) == 0 or release in to_install_versions:
install(release, tgz)
except subprocess.CalledProcessError: except subprocess.CalledProcessError:
print("FAILED") print("FAILED")
...@@ -212,13 +216,14 @@ def show_benchs(f): ...@@ -212,13 +216,14 @@ def show_benchs(f):
bench_line(f, release, stats, 1) bench_line(f, release, stats, 1)
def bench_all(retries): def bench_all(retries, selected_benchs):
try: try:
go("make -C ../.. germline") go("make -C ../.. germline")
go("make -C ../.. data") go("make -C ../.. data")
go("make -C ../.. demo") go("make -C ../.. demo")
for tag, bench in BENCHS.items(): for tag, bench in BENCHS.items():
run_all(tag, bench, retries) if len(selected_benchs) == 0 or tag in selected_benchs:
run_all(tag, bench, retries)
except KeyboardInterrupt: except KeyboardInterrupt:
pass pass
...@@ -234,8 +239,8 @@ if __name__ == '__main__': ...@@ -234,8 +239,8 @@ if __name__ == '__main__':
install_current() install_current()
if args.install: if args.install:
install_from_archive() install_from_archive(args.install)
if args.benchmark: if args.benchmark:
bench_all(args.retries) bench_all(args.retries, args.benchs)
show_benchs(sys.stdout) show_benchs(sys.stdout)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment