- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear Collegues,
I've got a question about what actually happens if I specify the number of OpenMP threads exceeding the actual number of CPU's logical cores in #pragma omp parallel directive construct ( #pragma omp parallel num_threads(10) if the maximum number of logical cores for my CPU is 8 ) ? And is that efficient since each OpenMP thread is mapped to a corresponding CPU logical core ?
I'm sorry, I know that OpenMP questions is offtopic for this forum, but I would prefer to get answers about in this particular forum and not forum.openmp.org.
Thanks for your reply in advance.
Cheers, Arthur.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Your question is quite valid.
There are some cases where you may wish to oversubscribe and experience improved performance. In situations where a, or some, or all threads in the parallel region perform thread blocking operations such as I/O. In those cases an otherwise oversubscribed thread can compute during the I/O wait time. As to how much to oversubscribe, this is more of a matter of experimentation.
A similar situation exists where you may find it advantageous to undersubscribe. An example of this you have a modeless dialog box and support threads providing visualizations of the state of the computation.
Jim Dempsey
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you have pinned 2 threads to each of certain hardware logical processors, you would expect those threads to swap periodically and each get 50% of that processor's resources. If you don't pin them, you would expect the os scheduler to rotate threads so as to give each equal time, further worsening cache locality.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Your question is quite valid.
There are some cases where you may wish to oversubscribe and experience improved performance. In situations where a, or some, or all threads in the parallel region perform thread blocking operations such as I/O. In those cases an otherwise oversubscribed thread can compute during the I/O wait time. As to how much to oversubscribe, this is more of a matter of experimentation.
A similar situation exists where you may find it advantageous to undersubscribe. An example of this you have a modeless dialog box and support threads providing visualizations of the state of the computation.
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks a lot for your reply.

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