Re: [Rcpp-devel] Populate a Matrix in Parallel (Text Version)

2018-09-28 Thread Ralf Stubner
Hi Joseph, On 9/28/18 3:26 AM, Joseph Wood wrote: > I understand that parallelism is not a magic wand. Have you read my > original post? I have managed to parallelize generating permutations > by taking advantage of the fact that I can generate the ith > permutation via nthPerm. My question is abo

Re: [Rcpp-devel] Populate a Matrix in Parallel (Text Version)

2018-09-27 Thread Joseph Wood
Thank you Jeff for your reply, I understand that parallelism is not a magic wand. Have you read my original post? I have managed to parallelize generating permutations by taking advantage of the fact that I can generate the ith permutation via nthPerm. My question is about making this thread safe

Re: [Rcpp-devel] Populate a Matrix in Parallel (Text Version)

2018-09-27 Thread Jeff Newmiller
You cannot parallelize a serial calculation. Sorry, parallelism is not a magic wand that you can wave at any problem. If you find portions of your calculations are independent, then you can parallelize those portions and do the rest serially. On September 27, 2018 5:04:52 PM PDT, Joseph Wood w

Re: [Rcpp-devel] Populate a Matrix in Parallel (Text Version)

2018-09-27 Thread Joseph Wood
Hey Ralf and Alexis, Thank you so much for your replies. All of the resources and information are very much appreciated. Alexis, yes I have looked at many examples including the one you linked to dealing with matrix transform. I'm really glad you linked that, because this is a perfect example of

Re: [Rcpp-devel] Populate a Matrix in Parallel (Text Version)

2018-09-26 Thread Alexis Sarda
I'm not sure I understand the problem. You've found RcppParallel, have you looked at the examples? There's one with handling matrices here: http://gallery.rcpp.org/articles/parallel-matrix-transform/ In the call to parallelFor() you can change the values you iterate over and change your logic bas

Re: [Rcpp-devel] Populate a Matrix in Parallel (Text Version)

2018-09-26 Thread Ralf Stubner
I haven’t read your message in detail, but the second example from here might be helpful: https://cran.r-project.org/web/packages/dqrng/vignettes/parallel.html There a matrix is filled in parallel by splitting the columns among the threads. Splitting by columns is helpful since matrices in R ar