I'm curious what the design argument for doParallel:::doParallelSNOW()
giving a warning when globals are explicitly specified in .export
could be? For example,
library("doParallel")
registerDoParallel(cl <- parallel::makeCluster(2L))
a <- 1
y <- foreach(i = 1L, .export = "a") %dopar% { 2 * a }
## Warning in e$fun(obj, substitute(ex), parent.frame(), e$data) :
## already exporting variable(s): a
Is it possible to disable above warnings in doParallel?
I'd argue that such a warning would suggest the user/developer not to specify .export
and rely fully on foreach adaptors to take care of globals. However, the success of identification of globals differ among adaptors.
Package versions: doParallel 1.0.11, iterators 1.0.9, foreach 1.4.4
CLARIFICATION 2018-01-14: These warnings occur after doParallel first having identified globals automatically and then appending the ones the developer list in .export
- my question is on why it doesn't not accept the deliberate choice that was done by the developer? Warning about correct globals is a bit misleading.