Community
cancel
Showing results for 
Search instead for 
Did you mean: 
velvia
Beginner
44 Views

TBB and NUMA

Jump to solution

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

0 Kudos

Accepted Solutions
Alexei_K_Intel
Employee
44 Views

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.

View solution in original post

4 Replies
Alexei_K_Intel
Employee
44 Views

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

velvia
Beginner
44 Views

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?

Alexei_K_Intel
Employee
45 Views

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.

View solution in original post

velvia
Beginner
44 Views

Thanks for the hint Alexei. I'll give it a try.