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

Feature request: Evaluation of expression on each worker #51

Open
stephensrmmartin opened this issue Feb 6, 2019 · 1 comment
Open

Comments

@stephensrmmartin
Copy link

doRedis is really cool, but I would love a straightforward way to execute expressions on each worker.
Why you ask?

Rstan/Stan compiles templates down to C++, and ultimately to a dso. My workstation has a different cpu and GCC version than our cluster.

What I tend to do, is build the model on the cluster, and on each worker load it in.
E.g., clusterEvalQ(cl, sMod <- readRDS('mystanmodel.rds'))
or clusterEvalQ(cl, sMod <- stan_model('mystanmodel.stan'))
foreach()'s export will not work for this problem, because it will try to export the local sMod, which is incompatible with the cluster's runtime and likely the CPU itself. In fact, I have to use .noexport='sMod', otherwise it will not be able to find and load the .dso file.

To my knowledge, there is no alternative.
So ideally, there would be a doRedis function that doesn't require foreach, and simply sends the same job to every worker to execute in its session. Then foreach() could be run without issue.
If there is some other method that I am missing, I'd love to hear it.

@bwlewis
Copy link
Owner

bwlewis commented Apr 9, 2019 via email

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