Closed joethorley closed 4 years ago
From @audrey-b
just wanted to mention that I've encountered problems when running sims_simulate in parallel with plan(multisession). I get "TRUE" which confirms that the code ran without problem but then the files are not always saved in the folder.
It seems to work the first time I run the code, but then if I change my working directory it won't save the results... strange
For some reason, the files get saved in my simanalyse directory instead of my working directory
Maybe the workers don't understand that "." is the working directory when in parallel... (edited)
The working directory wouldn't get passed as argument to the workers... (?)
Maybe the following would solve the problem:
normalized_path = normalizePath(path) future_map(path = normalized_path, ...)
This way the worker would use the correct path instead of interpreting "."
The problem appears to be in furrr (https://github.com/DavisVaughan/furrr/issues/90).
The solution is to specify the folder of interest using the path argument not by using setwd()
which is generally considered bad practice http://plantarum.ca/code/setwd/