| survrecThreads | R Documentation |
Gets or sets the maximum number of threads used by the parallel parts of
the package, currently the re-estimation phase of the bootstrap in
survdiffr(), which refits the survival curve once per bootstrap
replicate.
survrecThreads(n)
n |
Maximum number of threads, or |
By default the package lets OpenMP decide, which means it honours the
OMP_NUM_THREADS environment variable. Set this option to cap the
number of threads regardless of that variable, for instance when
running inside a shared machine or a job scheduler.
The bootstrap resampling itself always runs serially because it draws
from R's random number generator (which is not thread-safe); results are
therefore reproducible with set.seed() independently of the number of
threads.
If the package was built without OpenMP support (which is the case with the default compiler on macOS), the computation runs sequentially and this setting has no effect.
The current setting, invisibly when it is being changed.
NULL means "let OpenMP decide".
survrecThreads() # current setting
old <- survrecThreads(2)
survrecThreads(old) # restore
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.