
Make this package's functions available on parallel cluster workers
Source:R/lingam_bootstrap.r
setup_cluster_worker.RdUsed by all *_bootstrap() functions before dispatching iterations via
parallel::parLapply(). Tries to have each worker library() the
installed package; if that is not possible (e.g. during
devtools::load_all() development, where the package is not installed),
falls back to exporting every object in the namespace environment of a
representative function from the algorithm being bootstrapped.
Arguments
- cl
A
parallelcluster object (fromparallel::makePSOCKcluster()).- fun
A function belonging to the package whose namespace environment should be used as the fallback export source (e.g.
lingam_direct,lingam_rcd,lingam_parce,lingam_multi_group).