diff options
author | Tom Rondeau | 2012-02-09 23:23:36 -0500 |
---|---|---|
committer | Tom Rondeau | 2012-02-13 14:57:28 -0500 |
commit | 84cb8f63d0d96ede1a6a10940112ae5a087029fc (patch) | |
tree | 6e0fef4762ed872fcebfbfb47becf5147917229b /gnuradio-examples/python/volk_benchmark | |
parent | a9a2c632040d37562a64eb81ed7d4f136a7a774e (diff) | |
download | gnuradio-84cb8f63d0d96ede1a6a10940112ae5a087029fc.tar.gz gnuradio-84cb8f63d0d96ede1a6a10940112ae5a087029fc.tar.bz2 gnuradio-84cb8f63d0d96ede1a6a10940112ae5a087029fc.zip |
volk: better args for benchmarking volk tests; can specify a list of test numbers.
Diffstat (limited to 'gnuradio-examples/python/volk_benchmark')
-rwxr-xr-x | gnuradio-examples/python/volk_benchmark/volk_math.py | 9 | ||||
-rwxr-xr-x | gnuradio-examples/python/volk_benchmark/volk_types.py | 24 |
2 files changed, 17 insertions, 16 deletions
diff --git a/gnuradio-examples/python/volk_benchmark/volk_math.py b/gnuradio-examples/python/volk_benchmark/volk_math.py index 42f3ffa4b..8b0081387 100755 --- a/gnuradio-examples/python/volk_benchmark/volk_math.py +++ b/gnuradio-examples/python/volk_benchmark/volk_math.py @@ -100,8 +100,8 @@ def main(): implementation. The results are stored to an SQLite database \ that can then be read by volk_plot.py to plot the differences.' parser = argparse.ArgumentParser(description=desc) - parser.add_argument('label', type=str, - default=None, + parser.add_argument('-L', '--label', type=str, + required=True, default=None, help='Label of database table [default: %(default)s]') parser.add_argument('-D', '--database', type=str, default="volk_results.db", @@ -112,9 +112,10 @@ def main(): parser.add_argument('-I', '--iterations', type=int, default=20, help='Number of iterations [default: %(default)s]') - parser.add_argument('--test', type=int, + parser.add_argument('--tests', type=int, nargs='*', choices=xrange(len(avail_tests)), - help='Test to run') + help='A list of tests to run; can be a single test or a \ + space-separated list.') parser.add_argument('--list', action='store_true', help='List the available tests') parser.add_argument('--all', action='store_true', diff --git a/gnuradio-examples/python/volk_benchmark/volk_types.py b/gnuradio-examples/python/volk_benchmark/volk_types.py index 8041ccac1..893318ddd 100755 --- a/gnuradio-examples/python/volk_benchmark/volk_types.py +++ b/gnuradio-examples/python/volk_benchmark/volk_types.py @@ -138,8 +138,8 @@ def main(): implementation. The results are stored to an SQLite database \ that can then be read by volk_plot.py to plot the differences.' parser = argparse.ArgumentParser(description=desc) - parser.add_argument('label', type=str, - default=None, + parser.add_argument('-L', '--label', type=str, + required=True, default=None, help='Label of database table [default: %(default)s]') parser.add_argument('-D', '--database', type=str, default="volk_results.db", @@ -150,9 +150,10 @@ def main(): parser.add_argument('-I', '--iterations', type=int, default=20, help='Number of iterations [default: %(default)s]') - parser.add_argument('--test', type=int, + parser.add_argument('--tests', type=int, nargs='*', choices=xrange(len(avail_tests)), - help='Test to run') + help='A list of tests to run; can be a single test or a \ + space-separated list.') parser.add_argument('--list', action='store_true', help='List the available tests') parser.add_argument('--all', action='store_true', @@ -171,16 +172,15 @@ def main(): conn = create_connection(args.database) new_table(conn, label) - if not args.all: - func = avail_tests[args.test] - res = run_tests(func, N, iters) + if args.all: + tests = xrange(len(avail_tests)) + else: + tests = args.tests + + for test in tests: + res = run_tests(avail_tests[test], N, iters) if res is not None: replace_results(conn, label, N, iters, res) - else: - for f in avail_tests: - res = run_tests(f, N, iters) - if res is not None: - replace_results(conn, label, N, iters, res) if __name__ == "__main__": try: |