Set or get the number of threads used by OpenMP for parallel regions.
omp_set_num_threads(num)omp_get_num_threads()
The desired number of threads
In the case of omp_get_num_threads
, the current number of threads.
These functions mostly exist because of the CRAN check, which only allows 1 - 2 threads.
As there is a per-thread memory requirement for RUVIII_C
and RUVIII_C_Varying
,
these functions can also be useful for controlling memory usage. However in that case, setting
environment variable OMP_NUM_THREADS also works.