Re: [Rcpp-devel] When calling same Rcpp function several times different results are returned

2015-07-14 Thread Danas Zuokas
I have tried this with no luck. 2015-07-14 14:34 GMT+03:00 Romain Francois : > Or just use a std::vector for sg. That should do it. > > Romain > > Envoyé de mon iPhone > > > Le 14 juil. 2015 à 13:21, JJ Allaire a écrit : > > > > The examples in the RcppParallel documentation assume that access t

Re: [Rcpp-devel] When calling same Rcpp function several times different results are returned

2015-07-14 Thread JJ Allaire
Would that still solve the problem if there are overlapping indexes in gi ? (i.e. if the same index appeared more than one time and was utilized from more than one thread at a time) On Tue, Jul 14, 2015 at 7:21 AM, JJ Allaire wrote: > The examples in the RcppParallel documentation assume that acc

Re: [Rcpp-devel] When calling same Rcpp function several times different results are returned

2015-07-14 Thread Romain Francois
Or just use a std::vector for sg. That should do it. Romain Envoyé de mon iPhone > Le 14 juil. 2015 à 13:21, JJ Allaire a écrit : > > The examples in the RcppParallel documentation assume that access to > vectors and matrixes are *aligned* (i.e. fall into neat buckets > whereby reading and wr

Re: [Rcpp-devel] When calling same Rcpp function several times different results are returned

2015-07-14 Thread JJ Allaire
The examples in the RcppParallel documentation assume that access to vectors and matrixes are *aligned* (i.e. fall into neat buckets whereby reading and writing doesn't overlap between worker instances). Your example appears to access arbitrary elements of sg (depending on what's passed in gi) whic

Re: [Rcpp-devel] When calling same Rcpp function several times different results are returned

2015-07-14 Thread Danas Zuokas
Yes it is the same question on SO and I did consider RHertel's comments. But this problem (sums by group id) is not parallelFor it is parallelReduce: I split vector, calculate sums and then aggregate those sums. Please correct me if I am wrong. 2015-07-14 13:54 GMT+03:00 Dirk Eddelbuettel : > > O

Re: [Rcpp-devel] When calling same Rcpp function several times different results are returned

2015-07-14 Thread Dirk Eddelbuettel
On 14 July 2015 at 09:25, Danas Zuokas wrote: | I have written parallel implementation of sums in groups using RcppParallel. Isn't this the same question as http://stackoverflow.com/questions/31318419/when-calling-same-rcpp-function-several-times-different-results-are-returned You got some excel