Description Usage Arguments Value Note Author(s) See Also Examples
View source: R/epi_utils_multicore.R
epi_utils_multicore() setups a parallel function call using the package future.
1 2 |
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 <https://github.com/AntonioJBT/episcout>
plan
,
detectCores
,
registerDoFuture
,
availableCores
,
availableWorkers
.
1 2 3 4 5 6 7 8 9 | ## 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.