- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Does anybody know how to get the number of cores in TBB?
Thanks,
Zhongze
Does anybody know how to get the number of cores in TBB?
Thanks,
Zhongze
Link Copied
7 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Zhongze,
tbb::task_scheduler_init::default_num_threads() returns the number of threads that the task scheduler will use by default. Often this is equal to the number of cores, but I don't know how hyperthreading CPUs are treated.
Regards,
Christian
tbb::task_scheduler_init::default_num_threads() returns the number of threads that the task scheduler will use by default. Often this is equal to the number of cores, but I don't know how hyperthreading CPUs are treated.
Regards,
Christian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Each HT (or "logical") core is treated in the same way as a full core.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Zhongze,
If you don't mind my asking, what do you need to know the number of cores for?
AJ
If you don't mind my asking, what do you need to know the number of cores for?
AJ
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
MADamarochk:Each HT (or "logical") core is treated in the same way as a full core.
I would add that this may change in future.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
To complete the picture, TBB sees only those CPUs/cores (HT or full) that are enabled by the BIOS and OS.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I need that number in order to partition a graph. It doesn't make sense to partition a graph into 16 subgraphs on a dual core machine or partition a graph into 2 subgraphs on a quad-core machine.
Thanks,
Zhongze
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, Zhongze
As I explained in the answer to your other post, you most probably do not need to know the number of cores at all, since the degree of partitioning should depend on the amount of work necessary to process each subgraph. And if your sparse matrices are really large, then you should partition the graph in much more parts then the number of cores.
In fact partitioning into 16 (or even more) subgrapphs on dualcore machine usually makes perfect sence, as the work distribution across the subgraphs is normally very nonuniform (this is one of the problems with running MPI version of this algorithm on the grids). TBB applications running on shared memory systems can benefit from fine grained parallelism. Follow the link above for more details.
As I explained in the answer to your other post, you most probably do not need to know the number of cores at all, since the degree of partitioning should depend on the amount of work necessary to process each subgraph. And if your sparse matrices are really large, then you should partition the graph in much more parts then the number of cores.
In fact partitioning into 16 (or even more) subgrapphs on dualcore machine usually makes perfect sence, as the work distribution across the subgraphs is normally very nonuniform (this is one of the problems with running MPI version of this algorithm on the grids). TBB applications running on shared memory systems can benefit from fine grained parallelism. Follow the link above for more details.
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