Commit 22dbdc94 by Winter Committed by Marcus Winter

dataflow_cpp: query maximum number of queues for sequential processes in…

dataflow_cpp: query maximum number of queues for sequential processes in addition to the core count and use the minimum
parent 8834481a
...@@ -32,6 +32,8 @@ ...@@ -32,6 +32,8 @@
#include <embb/tasks/node.h> #include <embb/tasks/node.h>
#include <embb/base/function.h> #include <embb/base/function.h>
#include <algorithm>
namespace embb { namespace embb {
namespace dataflow { namespace dataflow {
namespace internal { namespace internal {
...@@ -46,7 +48,9 @@ class SchedulerMTAPI : public Scheduler { ...@@ -46,7 +48,9 @@ class SchedulerMTAPI : public Scheduler {
group_[ii] = &group; group_[ii] = &group;
} }
queue_count_ = static_cast<int>(node.GetWorkerThreadCount()); queue_count_ = std::min(
static_cast<int>(node.GetQueueCount()),
static_cast<int>(node.GetWorkerThreadCount()) );
queue_ = reinterpret_cast<embb::tasks::Queue**>( queue_ = reinterpret_cast<embb::tasks::Queue**>(
embb::base::Allocation::Allocate( embb::base::Allocation::Allocate(
sizeof(embb::tasks::Queue*)*queue_count_)); sizeof(embb::tasks::Queue*)*queue_count_));
......
...@@ -156,7 +156,7 @@ void SimpleTest::TestBasic() { ...@@ -156,7 +156,7 @@ void SimpleTest::TestBasic() {
core_set, core_set,
1024, // max tasks (default: 1024) 1024, // max tasks (default: 1024)
128, // max groups (default: 128) 128, // max groups (default: 128)
num_cores, // max queues (default: 16) 2, // max queues (default: 16)
1024, // queue capacity (default: 1024) 1024, // queue capacity (default: 1024)
4); // num priorities (default: 4) 4); // num priorities (default: 4)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment