From 1a2d4cc189a0eae13ac8a7047327540b126f9267 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Wed, 24 Apr 2013 20:36:48 -0700 Subject: gras: split many_1_to_1_blocks into two benchmarks --- benchmark/bm_registry.py | 25 +++++++++++++++++++------ benchmark/tb_combiner_array.py | 36 ++++++++++++++++++++++++++++++++++++ benchmark/tb_linear_chain.py | 27 +++++++++++++++++++++++++++ benchmark/tb_many_1_to_1_blocks.py | 36 ------------------------------------ 4 files changed, 82 insertions(+), 42 deletions(-) create mode 100644 benchmark/tb_combiner_array.py create mode 100644 benchmark/tb_linear_chain.py delete mode 100644 benchmark/tb_many_1_to_1_blocks.py (limited to 'benchmark') diff --git a/benchmark/bm_registry.py b/benchmark/bm_registry.py index af79a50..da7efe4 100644 --- a/benchmark/bm_registry.py +++ b/benchmark/bm_registry.py @@ -20,15 +20,27 @@ GR_ENV = { 'PYTHONPATH': os.path.join(INSTALL_PREFIX, 'gr/lib/python2.7/dist-packages:%s'%os.getenv('PYTHONPATH')), } -BENCHMARK_MANY_11_BLOCKS = tokwargs( - wat='Benchmark the schedulers with many 1:1 ratio blocks', +BENCHMARK_LINEAR_CHAIN = tokwargs( + wat='Benchmark the schedulers with linear chain topology', moar='''\ -- Compare simultaneous 1:1 ratio blocks in each scheduler. +- Topology is a linear chain of one input/one output blocks. - GRAS will use only the buffer pool allocator, and every work will fully consume available buffers.''', tests = [ - tokwargs(wat='GRAS', args=['tb_many_1_to_1_blocks.py', DURATION], env=GRAS_ENV, expand=True), - tokwargs(wat='GRSS', args=['tb_many_1_to_1_blocks.py', DURATION], env=GR_ENV), + tokwargs(wat='GRAS', args=['tb_linear_chain.py', DURATION], env=GRAS_ENV, expand=True), + tokwargs(wat='GRSS', args=['tb_linear_chain.py', DURATION], env=GR_ENV), + ], +) + +BENCHMARK_COMBINER_ARRAY = tokwargs( + wat='Benchmark the schedulers with combiner array topology', + moar='''\ +- Topology is a tower of two input math blocks. +- GRAS will use only the buffer pool allocator, +and every work will fully consume available buffers.''', + tests = [ + tokwargs(wat='GRAS', args=['tb_combiner_array.py', DURATION], env=GRAS_ENV, expand=True), + tokwargs(wat='GRSS', args=['tb_combiner_array.py', DURATION], env=GR_ENV), ], ) @@ -107,7 +119,8 @@ BENCHMARK_DELAY_BLOCKS = tokwargs( ) BENCHMARKS = ( - BENCHMARK_MANY_11_BLOCKS, + BENCHMARK_LINEAR_CHAIN, + BENCHMARK_COMBINER_ARRAY, BENCHMARK_MANY_RATE_BLOCKS, BENCHMARK_DFIR_BLOCK, BENCHMARK_RESAMP_BLOCK, diff --git a/benchmark/tb_combiner_array.py b/benchmark/tb_combiner_array.py new file mode 100644 index 0000000..c545d7e --- /dev/null +++ b/benchmark/tb_combiner_array.py @@ -0,0 +1,36 @@ +import gnuradio +from gnuradio import gr +from gnuradio import blocks as grblocks +import sys + +if __name__ == '__main__': + + duration = float(sys.argv[1]) + + tb = gr.top_block() + src0 = gr.null_source(8) + src1 = gr.null_source(8) + addr01 = grblocks.add_cc() + src2 = gr.null_source(8) + src3 = gr.null_source(8) + addr23 = grblocks.add_cc() + mult03 = grblocks.multiply_cc() + sink = gr.null_sink(8) + + tb.connect(src0, (addr01, 0)) + tb.connect(src1, (addr01, 1)) + tb.connect(src2, (addr23, 0)) + tb.connect(src3, (addr23, 1)) + + tb.connect(addr01, (mult03, 0)) + tb.connect(addr23, (mult03, 1)) + + tb.connect(mult03, sink) + + import time + tb.start() + time.sleep(duration) + print '##RESULT##', sink.nitems_read(0)/duration + import sys; sys.stdout.flush() + tb.stop() + tb.wait() diff --git a/benchmark/tb_linear_chain.py b/benchmark/tb_linear_chain.py new file mode 100644 index 0000000..184b6e1 --- /dev/null +++ b/benchmark/tb_linear_chain.py @@ -0,0 +1,27 @@ +import gnuradio +from gnuradio import gr +from gnuradio import blocks as grblocks +import sys + +if __name__ == '__main__': + + duration = float(sys.argv[1]) + + tb = gr.top_block() + src = gr.null_source(8) + b0 = gr.copy(8) + b1 = grblocks.sub_cc() + b2 = gr.copy(8) + b3 = grblocks.divide_cc() + b4 = gr.copy(8) + sink = gr.null_sink(8) + + tb.connect(src, b0, b1, b2, b3, b4, sink) + + import time + tb.start() + time.sleep(duration) + print '##RESULT##', sink.nitems_read(0)/duration + import sys; sys.stdout.flush() + tb.stop() + tb.wait() diff --git a/benchmark/tb_many_1_to_1_blocks.py b/benchmark/tb_many_1_to_1_blocks.py deleted file mode 100644 index c545d7e..0000000 --- a/benchmark/tb_many_1_to_1_blocks.py +++ /dev/null @@ -1,36 +0,0 @@ -import gnuradio -from gnuradio import gr -from gnuradio import blocks as grblocks -import sys - -if __name__ == '__main__': - - duration = float(sys.argv[1]) - - tb = gr.top_block() - src0 = gr.null_source(8) - src1 = gr.null_source(8) - addr01 = grblocks.add_cc() - src2 = gr.null_source(8) - src3 = gr.null_source(8) - addr23 = grblocks.add_cc() - mult03 = grblocks.multiply_cc() - sink = gr.null_sink(8) - - tb.connect(src0, (addr01, 0)) - tb.connect(src1, (addr01, 1)) - tb.connect(src2, (addr23, 0)) - tb.connect(src3, (addr23, 1)) - - tb.connect(addr01, (mult03, 0)) - tb.connect(addr23, (mult03, 1)) - - tb.connect(mult03, sink) - - import time - tb.start() - time.sleep(duration) - print '##RESULT##', sink.nitems_read(0)/duration - import sys; sys.stdout.flush() - tb.stop() - tb.wait() -- cgit