[Rcpp-devel] Conversion of Rcpp::Vector Rcpp::List and Rcpp::Matrix to std objects - OpenMP

Asis Hallab asis.hallab at gmail.com
Sat Jun 1 13:45:22 CEST 2013

Dear Dirk and Simon,

thank you very much for your help.

I have made a few experiments and am very puzzled. Maybe I could
bother you with advise on this?

The experiments on a
#pragma omp parallel for

1) Use private directive on all Rcpp-Objects that are only accessed to
be read from, and a shared statement on the Rcpp List that collects
the results. -> segfault
2) Make all private -> runs fine, but returns an empty result list
3) Use a std::map instead of the Rcpp List to collect the results ->
endless loop telling me "****snapping into wrong generation"
4) No private, nor shared directives and the above Rcpp List
collecting the results works fine on small test data (3 loops), but on
real live test data ( 1000 loops ) gives the above "****snapping into
wrong generation"

Do you have any idea, what I could do?
I am still learning C++ - Maybe I should use references instead of
Objects? But aren't SEXP pointers anyway?

Kind regards!

More information about the Rcpp-devel mailing list