Re: [Rcpp-devel] OpenMp and IntegerVector

2014-03-12 Thread Andreas Prescher
OK, got it working. The crux was to throw all Rcpp related stuff away from the parallel context, even the Rcpp::List returned by m_psiMinRVec[i]->init(...). Replacing only parInit(const Rcpp::List& seedList) with parInit(std::vector >& made it a "little bit more robust", but still produced "Warn

Re: [Rcpp-devel] OpenMp and IntegerVector

2014-03-11 Thread Hao Ye
> But your threads, > be it pthreads or C++11 threads are not calling the RNG supplied by R, are they? That is correct. Just reading and writing to c++ vectors (with some non-R deterministic computations in-between) Best, -- Hao Ye [email protected] On Mar 11, 2014, at 1:15 PM, Dirk Eddelbuettel wr

Re: [Rcpp-devel] OpenMp and IntegerVector

2014-03-11 Thread Whit Armstrong
you can also use intel TBB, just depends on your preference for syntax I suppose. I've never tried to use openMP threads, but intel tbb works quite nicely. example here based off of rrcov package: https://github.com/armstrtw/rrcov/blob/master/src/covOPW.cpp#L58 Sorry, Dirk, this doesn't use Rcpp

Re: [Rcpp-devel] OpenMp and IntegerVector

2014-03-11 Thread Dirk Eddelbuettel
On 11 March 2014 at 13:06, Hao Ye wrote: | > Just accessing / setting data structures should work (but test first...), | > RNGs is clearly asking for trouble. | | FWIW, I've been able to get this working using Rcpp and C++11 threads. (but using native C++ data structures, of course) Sure, just

Re: [Rcpp-devel] OpenMp and IntegerVector

2014-03-11 Thread Hao Ye
> Just accessing / setting data structures should work (but test first...), > RNGs is clearly asking for trouble. FWIW, I've been able to get this working using Rcpp and C++11 threads. (but using native C++ data structures, of course) Best, -- Hao Ye [email protected] On Mar 11, 2014, at 12:56 PM,

Re: [Rcpp-devel] OpenMp and IntegerVector

2014-03-11 Thread Dirk Eddelbuettel
Andreas, On 11 March 2014 at 20:30, Andreas Prescher wrote: | Hello, | | I got strange behaviour when using | OpenMp and IntegerVector (without | OpenMp all works fine!!) | | From my package (Rcpp 0.10.4 used, let some unimportant | arguments out) | | Rcpp::List PsiMinRContainer::parInit(cons

[Rcpp-devel] OpenMp and IntegerVector

2014-03-11 Thread Andreas Prescher
Hello, I got strange behaviour when using OpenMp and IntegerVector (without OpenMp all works fine!!) From my package (Rcpp 0.10.4 used, let some unimportant arguments out) Rcpp::List PsiMinRContainer::parInit(const Rcpp::List& seedList) { Rcpp::List resultList(m_psiMinRVec.size() - 1);