Dear Rcpp developers:

Thanks for developing and maintaining the Rcpp package.
I wrote a function in Rcpp. It is available throughout the package and
works as expected; however, it is not available for praLapply workers. A
temporary fix is just using Rcpp::cppFunction inside the function that
parLapply workers call and copy the entire function over there. However,
this does not seem right for bigger and more complicated functions.
I would be grateful if you could let me know whether there is a better
long-term solution. Here is the package and three functions that you might
want to take a look at.

Original cpp function:
https://github.com/fasrc/CausalGPS/blob/master/src/compute_closest_wgps_helper.cpp

Wrapper function that calls this function + temporal fix:
https://github.com/fasrc/CausalGPS/blob/master/R/compute_closest_wgps.R

The function that uses parLapply (please see line 63-89) to run the c++
code:
https://github.com/fasrc/CausalGPS/blob/master/R/compute_closest_wgps.R

Best regards,
Naeem
_______________________________________________
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

Reply via email to