Control whether multi-core processing is used by wordspace functions (if available) and how many threads are run in parallel. See "Details" below for more information.
wordspace.openmp(threads = NULL)
if specified, number of parallel threads to be used for multi-core processing
If threads
is unspecified or NULL
, a data frame with a single row and the following information is returned:
TRUE
if OpenMP multi-core support is available
maximum number of threads that can be used (0 if not available)
currently selected number of threads (defaults to 1 if not available)
The wordspace
package has experimental support for multi-core processing using OpenMP on some platforms.
So far, only the dist.matrix
function uses multi-core processing (for all distance measures except cosine
).
Even where supported, OpenMP is not enabled by default and has to be activated explicitly with wordspace.openmp(threads=N)
, where N
is
the number of parallel threads to be used.
Call wordspace.openmp()
without arguments to find out whether OpenMP is supported on your platform
and obtain information about the maximum number of threads available as well as the current setting.
Note that multi-threading of other R packages and functions (such as optimised matrix algebra in the BLAS library) is never affected by this function.
# NOT RUN {
wordspace.openmp()
# }
Run the code above in your browser using DataLab