Community
cancel
Showing results for 
Search instead for 
Did you mean: 
hoodibaba
Beginner
61 Views

How to assign CPU to part of code

Jump to solution
Hello All,

I am new to parallel computing world and I want to assign some part of my code to run in CPU 1 and other on CPU 2. Can somebody help me in this regard or tell be some example.

I am asking this because in my previous thread, during the execution of program, either of the CPU was working...it was like when CPU1 runs then CPU 2 was using only 21 or 25% of resources and vice versa.

Please help me.

Thanks in advance.


0 Kudos
1 Solution
ARCH_R_Intel
Employee
61 Views
In general, TBB does not let you assign code to CPUs. Instead, you specify what could run in parallel ("potential parallelism") and the TBB run-time decides what actually is run in parallel ("actual parallelism"). It is usually best to speciffy much more potential parallelism than there are cores.

If your code can be partitioned into only a few pieces that can run in parallel, you might consider using tbb::parallel_invoke. There is an example of using it in Section 4.12 of the TBB Reference manual.

View solution in original post

2 Replies
Krishna_R_Intel
Employee
61 Views
Hi,
Thanks for using the forum and please kindly excuse the delayed response. I will come back with an update or questions to you on this shortly. Appreciate your patience.

Thanks,
Krishna
ARCH_R_Intel
Employee
62 Views
In general, TBB does not let you assign code to CPUs. Instead, you specify what could run in parallel ("potential parallelism") and the TBB run-time decides what actually is run in parallel ("actual parallelism"). It is usually best to speciffy much more potential parallelism than there are cores.

If your code can be partitioned into only a few pieces that can run in parallel, you might consider using tbb::parallel_invoke. There is an example of using it in Section 4.12 of the TBB Reference manual.

View solution in original post

Reply