This function checks if parallel processing can be set up and enables it. Ideally this is done by the user for more control! In the package parallelization is usually only used for predictions and projections, but not for inference in which case parallel inference should be handled by the engine.
Arguments
- plan_exists
A
logicalcheck on whether an existingfuture::futureplan exists (Default:FALSE).- cores
A
numericnumber stating the number of cores to use.- strategy
A
characterdenoting the strategy to be used for future. See help offuture::futurefor options. (Default:"multisession").- workers
An optional list of remote machines or workers, e.g.
"c(remote.server.org)". Alternatively a"cluster"object can be provided.
Details
Currently supported strategies are:
"sequential"= Resolves futures sequentially in the current R process (Package default)."multisession"= Resolves futures asynchronously across'cores'sessions."multicore"= Resolves futures asynchronously across on forked processes. Only works on UNIX systems!"cluster"= Resolves futures asynchronously in sessions on this or more machines."slurm"= To be implemented: Slurm linkage via batchtools.
Note
The 'plan' set by future::future exists after the function has been executed.
If the aim is to parallize across many species, this is better done in a scripted solution. Make sure not to parallize predictions within existing clusters to avoid out-of-memory issues.
