Generate a suitable parallel processing future plan for your session. See ?future::plan
for more details on future plans.
Usage
suitableParallelPlan(
strategy = suitableParallelStrategy(),
workers = suitableParallelWorkers(),
...
)
suitableParallelStrategy()
suitableParallelWorkers(RAM_per_worker = 8, proportion_max_workers = 0.75)
Arguments
- strategy
The parallel strategy to use. See
?future::plan
for details.- workers
The number of workers to use.
- ...
Arguments to pass to
future::plan()
.- RAM_per_worker
The memory (in gigabytes) to allocate to each worker when calculating a suitable number of workers.
- proportion_max_workers
A value between 0 and 1. The maximum number of workers to allocate as a proportion of the total number of workers available (as detected by
future::availableCores()
).
Examples
## Return a suitable parallel strategy for the current session
suitableParallelStrategy()
#> [1] "multicore"
## Return a suitable number parallel workers based on the system resources.
suitableParallelWorkers()
#> [1] 1
if (FALSE) {
## Generate a suitable parallel plan
suitableParallelPlan()
}