R
rwhit
Guest
rwhit Asks: Issue with future and furrr, 1 processor only. R
Unfortunately, this is unlikely to be reproducible as I suspect it has to do with my setup. I'm on a windows machine, with a custom library location.
Whenever I run future_map etc, only one core seems to be loaded. I suspect this is because my libraries are not in the standard place however, this seems to be a situation that future now handles natively without any changes required.
Below is an example of my code (which runs) but only one core is used.
I have also tried using the "cluster" plan instead of "multisession" to no avail (uses same setup as foreach cluster which is working).
At this point I've ended up using the "foreach" package instead of "furrr" which is a shame because I prefer the furrr syntax.
Many thanks
Unfortunately, this is unlikely to be reproducible as I suspect it has to do with my setup. I'm on a windows machine, with a custom library location.
Whenever I run future_map etc, only one core seems to be loaded. I suspect this is because my libraries are not in the standard place however, this seems to be a situation that future now handles natively without any changes required.
Below is an example of my code (which runs) but only one core is used.
Code:
list.of.packages <- c(
"furrr",
"tidyverse",
"tsibbledata",
"tsibble",
"fable"
)
new.packages <- list.of.packages[!(list.of.packages %in% installed.packages()[,"Package"])]
if(length(new.packages) > 0){
install.packages(new.packages, dep=TRUE)
}
for(package.i in list.of.packages){
suppressPackageStartupMessages(
library(
package.i,
character.only = TRUE
)
)
}
plan(multisession)
ts <- tsibbledata::aus_retail %>%
group_by(`Series ID`) %>%
nest() %>%
mutate(model = future_map(data, ~model(
.x,
snaive = SNAIVE(Turnover),
ets = ETS(log(Turnover) ~ error("A") + trend("A") + season("A"))
)))
I have also tried using the "cluster" plan instead of "multisession" to no avail (uses same setup as foreach cluster which is working).
At this point I've ended up using the "foreach" package instead of "furrr" which is a shame because I prefer the furrr syntax.
Many thanks