Learn R Programming

RUVIIIC (version 1.0.19)

omp_set_num_threads: Set or get the number of OpenMP threads

Description

Set or get the number of threads used by OpenMP for parallel regions.

Usage

omp_set_num_threads(num)

omp_get_num_threads()

Arguments

num

The desired number of threads

Value

In the case of omp_get_num_threads, the current number of threads.

Details

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.