stringdist-parallelization: Multithreading and parallelization in stringdist
Description
Multithreading and parallelization in stringdistMultithreading and parallelization in <pkg>stringdist</pkg>
The core functions of stringdist are implemented in C. On systems
where openMP is available, stringdist will automatically take
advantage of multiple cores.By default, the number of threads to use is taken from options('sd_num_thread').
When the package is loaded, the value for this option is determined as follows:
- The number of available cores is determined with
parallel::detectCores()
- If available, the environment variable
OMP_THREAD_LIMIT is determined
- The number of threads is set to the lesser of
OMP_THREAD_LIMIT and the number of detected cores.
- If the number of threads larger then or equal to $4$, and
OMP_THREAD_LIMIT is not set, it is set to 'sd_num_thread'-1 .eqn
$n-1$code
'nthread'href
http://cran.r-project.org/web/packages/microbenchmark/index.htmlDetails
This page describes how stringdist uses parallel processing.