Last data update: 2014.03.03

R: Thread options for RcppParallel
setThreadOptionsR Documentation

Thread options for RcppParallel

Description

Set thread options (number of threads to use for task scheduling and stack size per-thread) for RcppParallel.

Usage

setThreadOptions(numThreads = "auto", 
                 stackSize = "auto")
defaultNumThreads()

Arguments

numThreads

Number of threads to use for task scheduling (call defaultNumThreads to determine the the default value used for "auto").

stackSize

Stack size (in bytes) to use for worker threads. The default used for "auto" is 2MB on 32-bit systems and 4MB on 64-bit systems (note that this parameter has no effect on Windows).

Details

RcppParallel is automatically initialized with the default number of threads and thread stack size when it loads. You can call setThreadOptions at any time to change the defaults.

Value

The defaultNumThreads returns the default number of threads that are used by RcppParallel if another value isn't specified using setThreadOptions.

Examples

library(RcppParallel)

setThreadOptions(numThreads = 4)

defaultNumThreads()

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(RcppParallel)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/RcppParallel/setThreadOptions.Rd_%03d_medium.png", width=480, height=480)
> ### Name: setThreadOptions
> ### Title: Thread options for RcppParallel
> ### Aliases: setThreadOptions defaultNumThreads
> 
> ### ** Examples
> 
> library(RcppParallel)
> 
> setThreadOptions(numThreads = 4)
> 
> defaultNumThreads()
[1] 4
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>