OMP - more threads than number of processors?

The default OpenMP directive is:

opm_get_num_threads gives the number of threads equivalent to processors / cores.

I have an 8-core machine, so it gives me 8 threads. This is maximum? Can I get more threads than 8 if I intentionally specify more than 8?

thanks

+6
source share
1 answer

You can set as many threads as you want:

 int threads = 16; omp_set_num_threads(threads); 

http://msdn.microsoft.com/en-US/library/e16bady3%28v=vs.80%29

But be sure that you are aware of the disadvantages of using more threads than there are logical cores in the system.

+7
source

Source: https://habr.com/ru/post/921504/


All Articles