latrend-parallel: Parallel computing using latrend

Description Windows Unix See Also

Description

The model estimation functions support parallel computation through the use of the foreach mechanism. In order to make use of parallel execution, a parallel back-end must be registered.

Windows

On Windows, the parallel-package can be used to define parallel socket workers.

1
2
3

Then, register the cluster as the parallel back-end using the doParallel package:

1
doParallel::registerDoParallel(cl)

If you defined your own lcMethod or lcModel extension classes, make sure to load them on the workers as well. This can be done, for example, using:

1
2
parallel::clusterEvalQ(cl,
  expr = setClass('lcMethodMyImpl', contains = "lcMethod"))

Unix

On Unix systems, it is easier to setup parallelization as the R process is forked. In this example we use the doMC package:

1
2
nCores = parallel::detectCores(logical = FALSE)
doMC::registerDoMC(nCores - 1)

See Also

latrendRep, latrendBatch, latrendBoot, latrendCV


latrend documentation built on April 14, 2021, 5:08 p.m.