[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r8913 - gnuradio/branches/developers/eb/sched-wip/gnur
From: |
eb |
Subject: |
[Commit-gnuradio] r8913 - gnuradio/branches/developers/eb/sched-wip/gnuradio-core/src/lib/runtime |
Date: |
Thu, 17 Jul 2008 07:23:25 -0600 (MDT) |
Author: eb
Date: 2008-07-17 07:23:24 -0600 (Thu, 17 Jul 2008)
New Revision: 8913
Modified:
gnuradio/branches/developers/eb/sched-wip/gnuradio-core/src/lib/runtime/gr_block_executor.cc
gnuradio/branches/developers/eb/sched-wip/gnuradio-core/src/lib/runtime/gr_buffer.h
gnuradio/branches/developers/eb/sched-wip/gnuradio-core/src/lib/runtime/gr_flat_flowgraph.cc
gnuradio/branches/developers/eb/sched-wip/gnuradio-core/src/lib/runtime/gr_flat_flowgraph.h
Log:
Nearly doubles the performance of the single pipeline case.
Modified:
gnuradio/branches/developers/eb/sched-wip/gnuradio-core/src/lib/runtime/gr_block_executor.cc
===================================================================
---
gnuradio/branches/developers/eb/sched-wip/gnuradio-core/src/lib/runtime/gr_block_executor.cc
2008-07-17 13:22:08 UTC (rev 8912)
+++
gnuradio/branches/developers/eb/sched-wip/gnuradio-core/src/lib/runtime/gr_block_executor.cc
2008-07-17 13:23:24 UTC (rev 8913)
@@ -69,7 +69,13 @@
for (int i = 0; i < d->noutputs (); i++){
gr_buffer::scoped_lock guard(*d->output(i)->mutex());
- int n = round_down (d->output(i)->space_available (), output_multiple);
+#if 0
+ int n = round_down(d->output(i)->space_available(), output_multiple);
+#else
+ int n = round_down(std::min(d->output(i)->space_available(),
+ d->output(i)->bufsize()/2),
+ output_multiple);
+#endif
if (n == 0){ // We're blocked on output.
if (d->output(i)->done()){ // Downstream is done, therefore we're
done.
return -1;
Modified:
gnuradio/branches/developers/eb/sched-wip/gnuradio-core/src/lib/runtime/gr_buffer.h
===================================================================
---
gnuradio/branches/developers/eb/sched-wip/gnuradio-core/src/lib/runtime/gr_buffer.h
2008-07-17 13:22:08 UTC (rev 8912)
+++
gnuradio/branches/developers/eb/sched-wip/gnuradio-core/src/lib/runtime/gr_buffer.h
2008-07-17 13:23:24 UTC (rev 8913)
@@ -60,6 +60,11 @@
int space_available ();
/*!
+ * \brief return size of this buffer in items
+ */
+ int bufsize() const { return d_bufsize; }
+
+ /*!
* \brief return pointer to write buffer.
*
* The return value points at space that can hold at least
Modified:
gnuradio/branches/developers/eb/sched-wip/gnuradio-core/src/lib/runtime/gr_flat_flowgraph.cc
===================================================================
---
gnuradio/branches/developers/eb/sched-wip/gnuradio-core/src/lib/runtime/gr_flat_flowgraph.cc
2008-07-17 13:22:08 UTC (rev 8912)
+++
gnuradio/branches/developers/eb/sched-wip/gnuradio-core/src/lib/runtime/gr_flat_flowgraph.cc
2008-07-17 13:23:24 UTC (rev 8913)
@@ -33,6 +33,11 @@
#define GR_FLAT_FLOWGRAPH_DEBUG 0
+// 32Kbyte buffer size between blocks
+#define GR_FIXED_BUFFER_SIZE (32*(1L<<10))
+
+static const unsigned int s_fixed_buffer_size = GR_FIXED_BUFFER_SIZE;
+
gr_flat_flowgraph_sptr
gr_make_flat_flowgraph()
{
@@ -88,8 +93,12 @@
if (!grblock)
throw std::runtime_error("allocate_buffer found non-gr_block");
int item_size = block->output_signature()->sizeof_stream_item(port);
- int nitems = s_fixed_buffer_size/item_size;
+ // *2 because we're now only filling them 1/2 way in order to
+ // increase the available parallelism when using the TPB scheduler.
+ // (We're double buffering, where we used to single buffer)
+ int nitems = s_fixed_buffer_size * 2 / item_size;
+
// Make sure there are at least twice the output_multiple no. of items
if (nitems < 2*grblock->output_multiple()) // Note: this means
output_multiple()
nitems = 2*grblock->output_multiple(); // can't be changed by block
dynamically
Modified:
gnuradio/branches/developers/eb/sched-wip/gnuradio-core/src/lib/runtime/gr_flat_flowgraph.h
===================================================================
---
gnuradio/branches/developers/eb/sched-wip/gnuradio-core/src/lib/runtime/gr_flat_flowgraph.h
2008-07-17 13:22:08 UTC (rev 8912)
+++
gnuradio/branches/developers/eb/sched-wip/gnuradio-core/src/lib/runtime/gr_flat_flowgraph.h
2008-07-17 13:23:24 UTC (rev 8913)
@@ -26,9 +26,6 @@
#include <gr_flowgraph.h>
#include <gr_block.h>
-// 32Kbyte buffer size between blocks
-#define GR_FIXED_BUFFER_SIZE (32*(1L<<10))
-
// Create a shared pointer to a heap allocated gr_flat_flowgraph
// (types defined in gr_runtime_types.h)
gr_flat_flowgraph_sptr gr_make_flat_flowgraph();
@@ -63,7 +60,6 @@
private:
gr_flat_flowgraph();
- static const unsigned int s_fixed_buffer_size = GR_FIXED_BUFFER_SIZE;
gr_block_detail_sptr allocate_block_detail(gr_basic_block_sptr block);
gr_buffer_sptr allocate_buffer(gr_basic_block_sptr block, int port);
void connect_block_inputs(gr_basic_block_sptr block);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r8913 - gnuradio/branches/developers/eb/sched-wip/gnuradio-core/src/lib/runtime,
eb <=