- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I would like to use TBB on a bi-Xeon plateform and I would like to use the first-touch policy to commit my array so half of it is bound to the first CPU and half of it is bound to the second CPU. Obivously, I want to use the cache-affinity partitioner so I can later use the same mapping in between tasks and cores.
How can I do that?
Best regards,
Francois
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Unfortunately no, but it may give some distribution. Perhaps, you may want to try tbb::static_partitioner that can achieve uniform distribution. However, it is a Community Preview feature and available only in recent versions.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Francois,
The simplest way is to initialize the data structures with tbb::parallel_for. Try something like
tbb::affinity_partitioner ap; tbb::parallel_for(0, N, [&array] (int i) { array = 0; }, ap );
I hope it will help.
Regards, Alex
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Alex,
Is there anything in this loop that guarantees us that half of the tasks will be sent to the first CPU and half of them will be sent to the second one?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Unfortunately no, but it may give some distribution. Perhaps, you may want to try tbb::static_partitioner that can achieve uniform distribution. However, it is a Community Preview feature and available only in recent versions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the hint Alexei. I'll give it a try.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page