Open chfleming opened 5 years ago
I used parallel::clusterExport
to carry an initial data for parallel tasks in windows
I read the simulate.ctmm
code but cannot give detailed comments as I do not fully understand the details in code. In general I think you should start the parallel cluster with parallel::clusterExport
too. Previously we used a hard coded expression, now you need to add your own value.
Also note parallel::clusterExport
look for global env by default, so you need to specify the environment.
We have a "smart" parallelized lapply function plapply that uses fork in UNIX and sockets in Windows.
I also have a few functions that (for repeated calculations) store and access intermediate calculations in an environment. For instance, when running simulations from
simulate.ctmm
with theprecompute=TRUE
argument, I store stuff a bunch of calculated stuff in the environmentKalman.env
. Then on further runs withprecompute=-1
, which assumes the same inputs, I pull those variables fromKalman.env
instead of wastefully calculating them again.It seems these environments I'm using don't carry over by default with the Windows sockets and I don't presently know how to make them.