- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I use TBB for parallelizing my code.
However, due to the dynamic scheduling, the result is not deterministic.
For testing, I do want the code to be parallel (to gain the speedup), but I would like to use static scheduling.
Is it possible to use static scheduling with TBB?
Thanks in advance,
Yoav
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you mean something a-la OpenMP schedule(static), it does not exist. First, OpenMP fixes the number of threads in a parallel region, so schedule(static) can divide the work equally between the threads. In TBB, the number of threads handling parallel_for tasks can change dynamically.
Partitioning of the overall iteration space intowork chunksis deterministic with simple_partitioner, and non-deterministic with auto_ and affinity_partitioner. Mapping of work chunks to threads is always dynamic and nondeterministicin TBB, done by its work stealing scheduler.
Under the result not being deterministic, what exactly do you mean? Maybe we could suggest some ideas how to deal with the trouble.
Partitioning of the overall iteration space intowork chunksis deterministic with simple_partitioner, and non-deterministic with auto_ and affinity_partitioner. Mapping of work chunks to threads is always dynamic and nondeterministicin TBB, done by its work stealing scheduler.
Under the result not being deterministic, what exactly do you mean? Maybe we could suggest some ideas how to deal with the trouble.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Just to cover the basics (although you would have read that in the documentation): the
ultimate deterministic execution is where task_scheduler_init is used to
specify single-threaded execution. TBB is about optional parallelism without required concurrency partly to allow such simple static scheduling. Did you try it yet?
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page