Rcpp sourceCpp with parallel foreach

I have a function foo written in Rcpp that I can use in my R session via sourceCpp.

I also have a cluster of machines using R parallel makePSOCKCluster. I want to run a parallel foreach loop through these machines that will use foo. I can see that the function is exported via foreach, but I think that only the Rcpp function pointer is exported. How can I make sure that the foo function itself is also exported?

+3
r rcpp


source to share


No one has answered this question yet

See similar questions:

0
foreach with Rcpp package does not export object

or similar:

629
data.table vs dplyr: can something do good and other do bad or bad?
12
Moving from sourceCpp to package using Rcpp
five
rep_each in Rcpp sugar
five
sourceCpp from Rcpp gives strange compilation error on canonical example
2
Parallel calculation of quadratic term in Rcpp
2
parallel computing with Rcpp and RNG foreach is much slower than expected
1
Compiling multiple nested loops using rcpp :: cppFunction
0
for loop failures in Rcpp
0
Cannot run Rcpp function in foreach% dopar%
-1
Allow Rcpp functions in DEoptim for R



All Articles
Loading...
X
Show
Funny
Dev
Pics