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

Is it possible to save and register some previous parallel backend again later? #31

Open
privefl opened this issue Aug 10, 2021 · 3 comments

Comments

@privefl
Copy link

privefl commented Aug 10, 2021

E.g. some better way to do something like:

library(doParallel)

registerDoParallel(cl1 <- makeCluster(4))
cl_save <- foreach:::getDoPar()$data

registerDoParallel(cl2 <- makeCluster(2))
foreach(ic = 1:10, .combine = 'c') %dopar% { ic }
stopCluster(cl2)

registerDoParallel(cl_save)
foreach(ic = 1:10, .combine = 'c') %dopar% { ic }

stopCluster(cl1)
@privefl
Copy link
Author

privefl commented Aug 10, 2021

So basically being able to temporarily register a new backend, but restoring the previously registered one after.

@HenrikBengtsson
Copy link

Is FR #19 a generalization of this feature request?

@privefl
Copy link
Author

privefl commented Aug 11, 2021

Yes, something like that would help.

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