| setDelapThreads | R Documentation |
Set or get number OpenMP threads to be used by Delaporte functions which
are parallelized. These include ddelap, pdelap, qdelap, and
rdelap.
setDelapThreads(n)
getDelapThreads()
n |
integer: maximum number of threads to be used. |
The requested thread count is stored in an environment local to the package namespace, following the guidance in Writing R Extensions, and is passed to the compiled routines on each call, where it scopes only Delaporte's own parallel regions. Neither the global options registry nor the process-wide OpenMP settings are touched, so other OpenMP-using packages are unaffected.
On load, the thread count is initialized to the OpenMP runtime maximum at that moment, which respects environment variables such as OMP_NUM_THREADS and OMP_THREAD_LIMIT.
For systems which return valid values for
detectCores, the maximum number of threads will be
capped at that value.
getDelapThreads returns an integer representing the maximum number of
allowed threads.
setDelapThreads invisibly returns the integer value actually set after
flooring and capping.
Avraham Adler Avraham.Adler@gmail.com
detectCores in parallel package.
getDelapThreads()
setDelapThreads(2L)
getDelapThreads()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.