Selecting interfaces for parallelisation
spaMM implements two interfaces for parallelisation, dopar
and dofuture
, called in particular by its bootstrap procedures. Which one is used is determined by spaMM.options(wrap_parallel="dopar")
(default) or spaMM.options(wrap_parallel="dofuture")
. Depending on arguments, either serial computation (default), a socket cluster (parallelisation default), or a fork cluster (available in linux and alike operating systems) can be used.
dopar
is based on a patchwork of backends: for socket clusters, depending whether the doSNOW
package is attached, foreach
or pbapply
is called (doSNOW
allows more efficient load balancing than pbapply
); for fork clusters, parallel::mclapply
is used. By contrast, dofuture
is based only on the future
and future.apply
packages, ensuring identical control of random number generator across these different cases, hence repeatable results across them. This does not make a difference for bootstrap computations in spaMM as the bootstrap samples are never simulated in parallel: only refitting the models is performed in parallel, and fit results do not depend on random numbers. Further, the future
-based code for socket clusters appears significantly slower than the one used by dopar
. For these reasons, the latter function is used by default by spaMM.
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.