HenrikBengtsson / doFuture

:rocket: R package: doFuture - Use Foreach to Parallelize via Future Framework
https://doFuture.futureverse.org
84 stars 6 forks source link

plyr w/ .parallel=TRUE fail in R 3.6.0 #32

Closed HenrikBengtsson closed 5 years ago

HenrikBengtsson commented 5 years ago

In recent R-devel ("R 3.6.0"), we now get:

library("doFuture")
registerDoFuture()
plan(multisession, workers=2)
library("plyr")
x <- list(a = 1:10, beta = exp(-3:3), logic = c(TRUE, FALSE, FALSE, TRUE))
y <- llply(x, quantile, probs = (1:3) / 4, .parallel = TRUE)
Error in { : task 3 failed - "'probs' outside [0,1]"

This is independent of doFuture, e.g. it occurs also with doParallel, and appear to be a plyr issue. See https://github.com/hadley/plyr/issues/292.

What's concerning is that this bug may pass without producing an error, but where the results of .parallel=FALSE differs from those of .parallel=TRUE, e.g.

> y0 <- llply(list(1:10), quantile, probs = (1:3)/4, .parallel = FALSE)
> y1 <- llply(list(1:10), quantile, probs = (1:3)/4, .parallel = TRUE)
> y0
[[1]]
 25%  50%  75% 
3.25 5.50 7.75 

> y1
[[1]]
325% 550% 775% 
3.25 5.50 7.75 
HenrikBengtsson commented 5 years ago

Fixed in R-devel r76227. See also https://github.com/hadley/plyr/issues/292#issuecomment-472223530.