- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am new to Intel TBB, and I am trying to add some new features on it.
However, I do not quite understand how to use the note_affinity and set_affinity methods?
I am wondering if there are some example codes with these methods?
Any help would be grateful.
Thanks for reading.
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Actually note_affinity and set_affinity are part of the low-level TBB tasking support. Our general recommendation is to start your TBB work with learning TBB algorithms (like tbb::parallel_for, tbb::parallel_reduce, tbb::pipeline and so on). These algorithms are easy to use and cover the vast majority of parallelization scenarios, so that only in the most non-trivial cases you may need to resort to manual building task hierarchies.
As long as tbb::parallel_for or tbb::parallel_reduce suit your purposes you can use tbb::affinity_partitioner with them. This partitioner internally uses tbb::task::note_affinity and tbb::task::set_affinity methods to take advantage of cache locality.
You can find more iformation about affinity partitioner in the "Bandwidth and Cache Affinity" article in the TBB Tutorial, and examples of code using it in GettingStarted/substring_finder and parallel_for/seismic (the standard TBB examples).
As long as tbb::parallel_for or tbb::parallel_reduce suit your purposes you can use tbb::affinity_partitioner with them. This partitioner internally uses tbb::task::note_affinity and tbb::task::set_affinity methods to take advantage of cache locality.
You can find more iformation about affinity partitioner in the "Bandwidth and Cache Affinity" article in the TBB Tutorial, and examples of code using it in GettingStarted/substring_finder and parallel_for/seismic (the standard TBB examples).
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Actually note_affinity and set_affinity are part of the low-level TBB tasking support. Our general recommendation is to start your TBB work with learning TBB algorithms (like tbb::parallel_for, tbb::parallel_reduce, tbb::pipeline and so on). These algorithms are easy to use and cover the vast majority of parallelization scenarios, so that only in the most non-trivial cases you may need to resort to manual building task hierarchies.
As long as tbb::parallel_for or tbb::parallel_reduce suit your purposes you can use tbb::affinity_partitioner with them. This partitioner internally uses tbb::task::note_affinity and tbb::task::set_affinity methods to take advantage of cache locality.
You can find more iformation about affinity partitioner in the "Bandwidth and Cache Affinity" article in the TBB Tutorial, and examples of code using it in GettingStarted/substring_finder and parallel_for/seismic (the standard TBB examples).
As long as tbb::parallel_for or tbb::parallel_reduce suit your purposes you can use tbb::affinity_partitioner with them. This partitioner internally uses tbb::task::note_affinity and tbb::task::set_affinity methods to take advantage of cache locality.
You can find more iformation about affinity partitioner in the "Bandwidth and Cache Affinity" article in the TBB Tutorial, and examples of code using it in GettingStarted/substring_finder and parallel_for/seismic (the standard TBB examples).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am curious as to what you are trying to implement with note_affinity()/set_affinity(). Please provide some brief description (if it's not a trade secret of course).
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