- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
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.
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
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.
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
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.

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