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

A suggestion on your furrr implementation #4

Open
DavisVaughan opened this issue Aug 3, 2018 · 1 comment
Open

A suggestion on your furrr implementation #4

DavisVaughan opened this issue Aug 3, 2018 · 1 comment
Labels
enhancement New feature or request

Comments

@DavisVaughan
Copy link

DavisVaughan commented Aug 3, 2018

Thanks a lot for incorporating furrr! It's really great to see it get some love and use in other packages. I had a suggestion on "best practices" of using future based packages, hopefully you find it useful.

I suggest you remove the future::plan() call from featureSelection(). It is best practice to let the user supply the plan, and the developer only worries about what code is parallelized, not how it is parallelized.

The reason for this is that you are inherently limiting the user by setting plan(multiprocess) to only be able to use their local computer for parallel feature selection. future can do much more than this, like run on EC2 or a remote cluster. Ideally, this is what you'd have:

# by default, future_map() runs sequentially if you don't specify any plan
featureSelection(...)

# runs in parallel on your local computer
plan(multiprocess)
featureSelection(...)

# runs in parallel sharded over a cluster somewhere
plan(cluster)
featureSelection(...)

# runs in parallel on multiple ec2 instances
plan(cluster, workers = ec2_ip_addresses)
featureSelection(...)

# sends x, y, and z each to a node of the cluster AND runs in parallel on those cluster nodes
plan(list(cluster, multiprocess))
map(list(x,y,z), featureSelection(.x))

See how many fun things you can do if you let the user specify the plan?

@ghost
Copy link

ghost commented Aug 4, 2018

@DavisVaughan thank you! That is a great suggestion. We will work that in for sure.

Cheers!

@ghost ghost added the enhancement New feature or request label Aug 6, 2018
@ghost ghost self-assigned this Aug 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant