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')
-rw-r--r--gnuradio-runtime/examples/mp-sched/run_synthetic.py23
1 files changed, 13 insertions, 10 deletions
diff --git a/gnuradio-runtime/examples/mp-sched/run_synthetic.py b/gnuradio-runtime/examples/mp-sched/run_synthetic.py
index 35e7f1820d..db8378efe0 100644
--- a/gnuradio-runtime/examples/mp-sched/run_synthetic.py
+++ b/gnuradio-runtime/examples/mp-sched/run_synthetic.py
@@ -38,18 +38,20 @@ def write_shell_script(f, data_filename, description, ncores, gflops, max_pipes_
# We'd like each run of synthetic to take ~10 seconds
desired_time_per_run = 10
est_gflops_avail = min(nstages * npipes, ncores) * gflops
- nsamples = (est_gflops_avail * desired_time_per_run) / (512.0 * nstages * npipes)
+ nsamples = (est_gflops_avail * desired_time_per_run) / \
+ (512.0 * nstages * npipes)
nsamples = int(nsamples * 1e9)
- cmd = "./synthetic.py -m -s %d -p %d -N %d\n" % (nstages, npipes, nsamples)
+ cmd = "./synthetic.py -m -s %d -p %d -N %d\n" % (
+ nstages, npipes, nsamples)
f.write(cmd)
f.write('if test $? -ge 128; then exit 128; fi\n')
- f.write(") 2>&1 | grep --line-buffered -v '^>>>' | tee %s\n" % (data_filename,))
+ f.write(") 2>&1 | grep --line-buffered -v '^>>>' | tee %s\n" %
+ (data_filename,))
f.flush()
-
def main():
description = """%prog gathers multiprocessor scaling data using the ./synthetic.py benchmark.
All combinations of npipes and nstages between 1 and --max-pipes-and-stages are tried.
@@ -61,14 +63,15 @@ plot_flops.py will make pretty graphs from the output data generated by %prog.
"""
parser = ArgumentParser(description=description)
parser.add_argument("-d", "--description", metavar="DESC",
- help="machine description, e.g., \"Dual quad-core Xeon 3 GHz\"")
+ 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]")
+ 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]")
+ 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")
+ 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")
@@ -80,6 +83,6 @@ plot_flops.py will make pretty graphs from the output data generated by %prog.
args.gflops,
args.max_pipes_and_stages)
+
if __name__ == '__main__':
main()
-