It would be useful if registerDoFuture() would propagate also via future() / %<-% (as it currently does with %dopar%). Currently, it doesn't:
library("doFuture")
registerDoFuture()
plan(multisession)
print(getDoParName())
# [1] "doFuture"
# registerDoFuture() propagates through %dopar%
> a <- foreach(i = 1L) %dopar% getDoParName()
> a
[[1]]
[1] "doFuture"
# But not through plain futures
b %<-% getDoParName()
> b
# [1] NULL
The workaround is to manual set it inside these futures:
b %<-% {
registerDoFuture()
getDoParName()
}
> b
# [1] "doFuture"
It would be useful if
registerDoFuture()
would propagate also viafuture()
/%<-%
(as it currently does with%dopar%
). Currently, it doesn't:The workaround is to manual set it inside these futures:
which is not ideal.
See also
The background for this feature is in https://github.com/HenrikBengtsson/doFuture/issues/21