summaryrefslogtreecommitdiff
path: root/gnuradio-runtime/examples/mp-sched/run_synthetic.py
diff options
context:
space:
mode:
Diffstat (limited to 'gnuradio-runtime/examples/mp-sched/run_synthetic.py')
-rwxr-xr-xgnuradio-runtime/examples/mp-sched/run_synthetic.py39
1 files changed, 17 insertions, 22 deletions
diff --git a/gnuradio-runtime/examples/mp-sched/run_synthetic.py b/gnuradio-runtime/examples/mp-sched/run_synthetic.py
index 4896bca462..802fb9fd34 100755
--- a/gnuradio-runtime/examples/mp-sched/run_synthetic.py
+++ b/gnuradio-runtime/examples/mp-sched/run_synthetic.py
@@ -27,7 +27,7 @@ import re
import sys
import os
import tempfile
-from optparse import OptionParser
+from argparse import ArgumentParser
def write_shell_script(f, data_filename, description, ncores, gflops, max_pipes_and_stages):
@@ -70,31 +70,26 @@ total runtime of about 43 minutes, assuming that your values for -n and -f are r
For x86 machines, assume 3 FLOPS per processor Hz. E.g., 3 GHz machine -> 9 GFLOPS.
plot_flops.py will make pretty graphs from the output data generated by %prog.
"""
- usage = "usage: %prog [options] output.dat"
- parser = OptionParser(usage=usage, description=description)
- parser.add_option("-d", "--description", metavar="DESC",
- help="machine description, e.g., \"Dual quad-core Xeon 3 GHz\"", default=None)
- parser.add_option("-n", "--ncores", type="int", default=1,
- help="number of processor cores [default=%default]")
- parser.add_option("-g", "--gflops", metavar="GFLOPS", type="float", default=3.0,
- help="estimated GFLOPS per core [default=%default]")
- parser.add_option("-m", "--max-pipes-and-stages", metavar="MAX", type="int", default=16,
- help="maximum number of pipes and stages to use [default=%default]")
- (options, args) = parser.parse_args()
- if len(args) != 1:
- parser.print_help()
- raise SystemExit, 1
-
- output_filename = args[0]
+ parser = ArgumentParser(description=description)
+ parser.add_argument("-d", "--description", metavar="DESC",
+ help="machine description, e.g., \"Dual quad-core Xeon 3 GHz\"")
+ parser.add_argument("-n", "--ncores", type=int, default=1,
+ help="number of processor cores [default=%(default)s]")
+ parser.add_argument("-g", "--gflops", metavar="GFLOPS", type=float, default=3.0,
+ help="estimated GFLOPS per core [default=%(default)s]")
+ parser.add_argument("-m", "--max-pipes-and-stages", metavar="MAX", type=int, default=16,
+ help="maximum number of pipes and stages to use [default=%(default)s]")
+ parser.add_argument("output_file_name", metavar="FILE", help="output file name")
+ args = parser.parse_args()
shell = os.popen("/bin/sh", "w")
write_shell_script(shell,
- output_filename,
- options.description,
- options.ncores,
- options.gflops,
- options.max_pipes_and_stages)
+ args.output_file_name,
+ args.description,
+ args.ncores,
+ args.gflops,
+ args.max_pipes_and_stages)
if __name__ == '__main__':
main()