[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r8824 - in gnuradio/branches/developers/eb/sched-wip:
From: |
eb |
Subject: |
[Commit-gnuradio] r8824 - in gnuradio/branches/developers/eb/sched-wip: . gnuradio-core/src/lib/runtime |
Date: |
Tue, 8 Jul 2008 00:32:57 -0600 (MDT) |
Author: eb
Date: 2008-07-08 00:32:51 -0600 (Tue, 08 Jul 2008)
New Revision: 8824
Modified:
gnuradio/branches/developers/eb/sched-wip/gnuradio-core/src/lib/runtime/gr_block_detail.h
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.h
gnuradio/branches/developers/eb/sched-wip/gnuradio-core/src/lib/runtime/gr_scheduler_tpb.cc
gnuradio/branches/developers/eb/sched-wip/gnuradio-core/src/lib/runtime/gr_top_block_impl.cc
gnuradio/branches/developers/eb/sched-wip/gnuradio-core/src/lib/runtime/gr_tpb_thread_body.cc
gnuradio/branches/developers/eb/sched-wip/run_tests.sh.in
Log:
thread-per-block scheduler passes make check
Modified:
gnuradio/branches/developers/eb/sched-wip/gnuradio-core/src/lib/runtime/gr_block_detail.h
===================================================================
---
gnuradio/branches/developers/eb/sched-wip/gnuradio-core/src/lib/runtime/gr_block_detail.h
2008-07-08 01:45:40 UTC (rev 8823)
+++
gnuradio/branches/developers/eb/sched-wip/gnuradio-core/src/lib/runtime/gr_block_detail.h
2008-07-08 06:32:51 UTC (rev 8824)
@@ -73,6 +73,9 @@
*/
void consume_each (int how_many_items);
+ /*!
+ * \brief Tell the scheduler \p how_many_items were produced on each output
stream.
+ */
void produce_each (int how_many_items);
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-08 01:45:40 UTC (rev 8823)
+++
gnuradio/branches/developers/eb/sched-wip/gnuradio-core/src/lib/runtime/gr_block_executor.cc
2008-07-08 06:32:51 UTC (rev 8824)
@@ -88,14 +88,13 @@
{
if (ENABLE_LOGGING){
char name[100];
- snprintf(name, sizeof(name), "sst-%d.log", which_scheduler++);
+ snprintf(name, sizeof(name), "sst-%03d.log", which_scheduler++);
d_log = new std::ofstream(name);
std::unitbuf(*d_log); // make it unbuffered...
*d_log << "gr_block_executor: "
<< d_block << std::endl;
}
- d_block->detail()->set_done(false); // reset done flag
d_block->start(); // enable any drivers, etc.
}
@@ -302,7 +301,8 @@
return READY;
// We didn't produce any output even though we called general_work.
- // Call this BLKD_IN, since we didn't do anything productive.
+ // We have (most likely) consumed some input.
+
// If this is a source, it's broken.
if (d->source_p()){
std::cerr << "gr_block_executor: source " << m
@@ -310,7 +310,9 @@
// FIXME maybe we ought to raise an exception...
goto were_done;
}
- return BLKD_IN;
+
+ // Have the caller try again...
+ return READY_NO_OUTPUT;
}
assert (0);
Modified:
gnuradio/branches/developers/eb/sched-wip/gnuradio-core/src/lib/runtime/gr_block_executor.h
===================================================================
---
gnuradio/branches/developers/eb/sched-wip/gnuradio-core/src/lib/runtime/gr_block_executor.h
2008-07-08 01:45:40 UTC (rev 8823)
+++
gnuradio/branches/developers/eb/sched-wip/gnuradio-core/src/lib/runtime/gr_block_executor.h
2008-07-08 06:32:51 UTC (rev 8824)
@@ -53,10 +53,11 @@
~gr_block_executor ();
enum state {
- READY, // We made progress; everything's cool.
- BLKD_IN, // no progress; we're blocked waiting for input data.
- BLKD_OUT, // no progress; we're blocked waiting for output buffer space.
- DONE, // we're done; don't call me again.
+ READY, // We made progress; everything's cool.
+ READY_NO_OUTPUT, // We consumed some input, but produced no output.
+ BLKD_IN, // no progress; we're blocked waiting for input data.
+ BLKD_OUT, // no progress; we're blocked waiting for output buffer
space.
+ DONE, // we're done; don't call me again.
};
/*
Modified:
gnuradio/branches/developers/eb/sched-wip/gnuradio-core/src/lib/runtime/gr_scheduler_tpb.cc
===================================================================
---
gnuradio/branches/developers/eb/sched-wip/gnuradio-core/src/lib/runtime/gr_scheduler_tpb.cc
2008-07-08 01:45:40 UTC (rev 8823)
+++
gnuradio/branches/developers/eb/sched-wip/gnuradio-core/src/lib/runtime/gr_scheduler_tpb.cc
2008-07-08 06:32:51 UTC (rev 8824)
@@ -61,6 +61,12 @@
used_blocks = ffg->topological_sort(used_blocks);
gr_block_vector_t blocks = gr_flat_flowgraph::make_block_vector(used_blocks);
+ // Ensure that the done flag is clear on all blocks
+
+ for (size_t i = 0; i < blocks.size(); i++){
+ blocks[i]->detail()->set_done(false);
+ }
+
// Fire off a thead for each block
for (size_t i = 0; i < blocks.size(); i++){
Modified:
gnuradio/branches/developers/eb/sched-wip/gnuradio-core/src/lib/runtime/gr_top_block_impl.cc
===================================================================
---
gnuradio/branches/developers/eb/sched-wip/gnuradio-core/src/lib/runtime/gr_top_block_impl.cc
2008-07-08 01:45:40 UTC (rev 8823)
+++
gnuradio/branches/developers/eb/sched-wip/gnuradio-core/src/lib/runtime/gr_top_block_impl.cc
2008-07-08 06:32:51 UTC (rev 8824)
@@ -45,8 +45,8 @@
const char *name;
scheduler_maker f;
} scheduler_table[] = {
- { "STS", gr_scheduler_sts::make }, // first entry is default
- { "TPB", gr_scheduler_tpb::make }
+ { "TPB", gr_scheduler_tpb::make }, // first entry is default
+ { "STS", gr_scheduler_sts::make }
};
static gr_scheduler_sptr
Modified:
gnuradio/branches/developers/eb/sched-wip/gnuradio-core/src/lib/runtime/gr_tpb_thread_body.cc
===================================================================
---
gnuradio/branches/developers/eb/sched-wip/gnuradio-core/src/lib/runtime/gr_tpb_thread_body.cc
2008-07-08 01:45:40 UTC (rev 8823)
+++
gnuradio/branches/developers/eb/sched-wip/gnuradio-core/src/lib/runtime/gr_tpb_thread_body.cc
2008-07-08 06:32:51 UTC (rev 8824)
@@ -41,6 +41,10 @@
d->d_tpb.notify_neighbors(d);
break;
+ case gr_block_executor::READY_NO_OUTPUT: // Notify upstream only
+ d->d_tpb.notify_upstream(d);
+ break;
+
case gr_block_executor::DONE: // Game over.
d->d_tpb.notify_neighbors(d);
return;
Modified: gnuradio/branches/developers/eb/sched-wip/run_tests.sh.in
===================================================================
--- gnuradio/branches/developers/eb/sched-wip/run_tests.sh.in 2008-07-08
01:45:40 UTC (rev 8823)
+++ gnuradio/branches/developers/eb/sched-wip/run_tests.sh.in 2008-07-08
06:32:51 UTC (rev 8824)
@@ -138,8 +138,15 @@
ok=yes
for file in $3/qa_*.py
do
- if ! @PYTHON@ $file
+ # echo $file
+ /usr/bin/python $file
+ r=$?
+ if [ $r -ne 0 ]
then
+ if [ $r -ge 128 ] # killed by a signal
+ then
+ exit $r
+ fi
ok=no
fi
done
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r8824 - in gnuradio/branches/developers/eb/sched-wip: . gnuradio-core/src/lib/runtime,
eb <=