Skip to contents

Specify the number of threads for ensemble simulations in Julia. This will not overwrite your current global setting for JULIA_NUM_THREADS.

Usage

use_threads(n = parallel::detectCores() - 1, stop = FALSE)

Arguments

n

Number of Julia threads to use. Defaults to parallel::detectCores() - 1. If set to a value higher than the number of available cores minus 1, it will be set to the number of available cores minus 1.

stop

Stop using threaded ensemble simulations. Defaults to FALSE.

Examples

use_threads(n = 4)
#> Warning: n is set to 4, which is higher than the number of available cores minus 1. Setting it to 3.
use_threads(stop = TRUE)