[Rd] parallel::mclapply does not return try-error objects with mc.preschedule=TRUE
Karl Forner
karl.forner at gmail.com
Thu Apr 11 13:43:23 CEST 2013
Hello,
Consider this:
1)
library(parallel)
res <- mclapply(1:2, stop)
#Warning message:
#In mclapply(1:2, stop) :
# all scheduled cores encountered errors in user code
is(res[[1]], 'try-error')
#[1] FALSE
2)
library(parallel)
res <- mclapply(1:2, stop, mc.preschedule=FALSE)
#Warning message:
#In mclapply(1:2, stop, mc.preschedule = FALSE) :
# 2 function calls resulted in an error
is(res[[1]], 'try-error')
#[1] TRUE
The documentation states that:
'Each forked process runs its job inside try(..., silent = TRUE) so if
errors occur they will be stored as class "try-error" objects in the
return value and a warning will be given.'
Is this a bug ?
Thanks
Karl
> sessionInfo()
R version 2.15.3 (2013-03-01)
Platform: x86_64-unknown-linux-gnu (64-bit)
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=C LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] parallel stats graphics grDevices utils datasets methods
[8] base
loaded via a namespace (and not attached):
[1] tools_2.15.3
More information about the R-devel
mailing list