R: Control multi-core processing in wordspace functions...

wordspace.openmp {wordspace} | R Documentation

## Control multi-core processing in wordspace functions (wordspace)

### Description

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.

### Usage

    wordspace.openmp(threads = NULL)

### Arguments

`threads` | if specified, number of parallel threads to be used for multi-core processing

### Details

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.

### Value

If `threads` is unspecified or `NULL`, a data frame with a single row and the following information is returned:

`available` | `TRUE` if OpenMP multi-core support is available
`max` | maximum number of threads that can be used (0 if not available)
`threads` | currently selected number of threads (defaults to 1 if not available)

### Author(s)

Stefan Evert (http://purl.org/stefan.evert)

### See Also

`dist.matrix`

### Examples

    wordspace.openmp()

[Package wordspace version 0.2-6 Index]