Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

options("test"=5) are not global #16

Closed
Rloveeee opened this issue Jul 3, 2018 · 1 comment
Closed

options("test"=5) are not global #16

Rloveeee opened this issue Jul 3, 2018 · 1 comment

Comments

@Rloveeee
Copy link

Rloveeee commented Jul 3, 2018

I think I found a small bug in the future.apply package:

options("test"=5)
test=4
plan(multiprocess, workers = 12)
FUN=function(x) c(getOption("test"),test)
future.apply::future_lapply(list(1,2),FUN=FUN,future.globals=TRUE)
future.apply::future_lapply(list(1,2),FUN=FUN,future.globals=FALSE)
lapply(list(1,2),FUN=FUN)

It seems that future.apply::future_lapply can't recover getOptions( ) stuff which are a sort of global variable.

Best

@HenrikBengtsson
Copy link
Collaborator

Hi. Yes, automatic handling of options would be useful.

Unfortunately, we can't just pass all options on to futures as is. For example, some options are specific to the current R session/compute system (remember that futures can be resolved anywhere - also on a computer across the world). Other options are set conditionally on environment variables, which again, may be set differently depending on the computer where the future runs - we need to make sure that is also respected.

We've got futureverse/future#134 that is dedicated to this topic. Note that there is also an example how you can "pass" options yourself already now.

I'm closing this one - please continue the discussion there, e.g. if you have further ideas or thoughts. When we've figured out a way to support options in the core Future API, which probably will start off as a manual options argument, then we'll probably add a corresponding future.options argument to the functions of the future.apply package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants