Parallelisation
parallelisation.Rmd
Parallelisation
- Since version 2.0.0, MAMS relies on the package
future.apply for parallel computation.
The package future.apply is part of the future parallelisation framework that requires users to define their parallelisation strategy by means of the functionfuture::plan()
.
This function takes several options like, for example:-
sequential
, default strategy corresponding to a computation without parallelisation;
-
multicore
, using separate forked R processes, available to unix/osx users;
-
multisession
, using separate R sessions, available to all users.
-
cluster
, using separate R sessions on one or more machines
-
We refer to (Bengtsson 2021) for an
overview of the future framework.
The performance of each plan varies depending on the operating system and computer specifications. On personal computers, our experience suggests that
cluster
is optimal for windows machines,multicore
is optimal for linux machines,multisession
is optimal for OSX machines.
Note that, for the functions of MAMS to be available
to workers defined by future::plan()
, MAMS
has to be installed at a location available under .libPaths
(by default, R installs packages in the directory corresponding to the
first element of .libPaths).
References
Bengtsson, Henrik. 2021. “A Unifying Framework for Parallel and
Distributed Processing in R Using Futures.” The R
Journal 13 (2): 208. https://doi.org/10.32614/rj-2021-048.