View source: R/epi_utils_multicore.R
epi_utils_multicore | R Documentation |
epi_utils_multicore() setups a parallel function call using the package future.
epi_utils_multicore(
num_cores = NULL,
future_plan = "multiprocess",
gc = TRUE,
verbose = TRUE,
...
)
num_cores |
Number of cores to use. Default cores - 1. |
future_plan |
The strategy to use for plan(). Default is 'multiprocess'. |
gc |
Garbage collection. Default is TRUE. Not all strategies use it though and cause an overhead. |
verbose |
Prints out the settings for future::plan(). Default is TRUE. |
... |
pass any further parameters accepted by future::plan(). |
Nothing
num_cores is calculated as max(1, parallel::detectCores() - 1). If using
sequential a warning will be emitted for workers. Not all strategies use gc().
See plan
.
Antonio Berlanga-Taylor <\url{https://github.com/AntonioJBT/episcout}>
plan
,
detectCores
,
registerDoFuture
,
availableCores
,
availableWorkers
.
## Not run:
epi_utils_multicore(num_cores = 1, future_plan = 'sequential')
future_v %<-% { sum(1 + 2)}
future_v
epi_utils_multicore(future_plan = 'multiprocess')
future_v %<-% {sum(2 + 2)}
future_v
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.