You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have already asked this question in stack overflow but I didn't get any response so apologies for the cross posting. The question is updated with a reproducible example;
I am trying to use future_map from package furrr within a function I wrote. The function has a dependency on a particular option set in options(). When I change this option to something else it is completely ignored when the function runs in plan(multisession). Is there a way to "inform" every worker on the option change? If I change back to plan(sequential) the function works as expected.
Here is a reproducible example:
# Two functions
abc <- function(n) {
n * getOption("tst_value")
}
future_abc_mult <- function(n) {
future_map(n, ~abc(.))
}
# Load packages:
library(furrr)
# Set options:
options(tst_value = 1)
# Try using default plan; sequential
n = c(1,2,3,4)
future_abc_mult(n)
# Try using multiprocess plan
plan(multiprocess)
future_abc_mult(n)
Here is my sessionInfo
sessionInfo()
R version 3.4.2 (2017-09-28)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
future actually documents this as a still open issue over there. Look there for a few examples of how to do this manually. I agree that it might should be easier, or made more clear, but its not anything that furrr will be able to do so I'm going to close!
I have already asked this question in stack overflow but I didn't get any response so apologies for the cross posting. The question is updated with a reproducible example;
I am trying to use
future_map
from package furrr within a function I wrote. The function has a dependency on a particular option set inoptions()
. When I change this option to something else it is completely ignored when the function runs inplan(multisession)
. Is there a way to "inform" every worker on the option change? If I change back toplan(sequential)
the function works as expected.Here is a reproducible example:
Here is my sessionInfo
The text was updated successfully, but these errors were encountered: