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

Setting options() in workers #77

Closed
datawookie opened this issue Jul 1, 2019 · 4 comments
Closed

Setting options() in workers #77

datawookie opened this issue Jul 1, 2019 · 4 comments

Comments

@datawookie
Copy link

datawookie commented Jul 1, 2019

Hi,

Firstly, thanks for furrr: it's a complete game changer!

I've been trying to use future_map2() over a function which is submitting requests to a (local) OSRM server.

At the top of my script I have the following:

library(furrr)
plan(multiprocess)

library(osrm)
options(osrm.server = "http://127.0.0.1:5000/")

Here the call to options() is ensuring that the OSRM requests go to the local server. However it seems that inside future_map2() these options are not propagated to the workers, with the result that the requests are going to the public OSRM server... which is taking massively longer, completely defeating the objective of running the requests in parallel.

The weird thing is that I haven't run this script in a while and I'm almost 100% certain that the last time I did run it this all worked.

Anyway, I was just wondering whether there is some special incantation that I can use to get this option to apply to the workers?

Thanks a lot!

Best regards,
Andrew.

@datawookie
Copy link
Author

Hi @DavisVaughan, just been chatting to a colleague who suggested setting these options inside the function which I'm running in parallel. That seems like a good option to me. Are there better alternatives? Thanks, Andrew.

@datawookie datawookie reopened this Jul 1, 2019
@Ax3man
Copy link

Ax3man commented Jul 2, 2019

This is a future issue: futureverse/future#134

@Ax3man
Copy link

Ax3man commented Jul 2, 2019

also answered already here: #36

@datawookie
Copy link
Author

Thanks. Helpful link!

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

No branches or pull requests

2 participants