ctmm-initiative / ctmm

Continuous-Time Movement Modeling. Functions for identifying, fitting, and applying continuous-space, continuous-time stochastic movement models to animal tracking data.
http://biology.umd.edu/movement.html
43 stars 10 forks source link

temporary environments not passed in Windows sockets #31

Open chfleming opened 5 years ago

chfleming commented 5 years ago

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 the precompute=TRUE argument, I store stuff a bunch of calculated stuff in the environment Kalman.env. Then on further runs with precompute=-1, which assumes the same inputs, I pull those variables from Kalman.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.

xhdong-umd commented 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.