[Rcpp-devel] The help for parallel computing in Rcpp

To Duc Khanh toduc at stat.unipd.it
Sat Apr 2 00:21:21 CEST 2016


Dear all

My name is Khanh, a PhD student in Department of Statistical Science,
University of Padua.

I would like ask you how to use the function parallelFor() -in package
RcppParallel- to computing a "for loop". In particular, I have to compute
a triple sum, which is

\[
\sum_{i=1}^{n} \sum_{j = 1, j \ne i}^{n} \sum_{\stackrel{k=1}{k \ne j,
k\ne i}}^{n} I(T_i, T_j, T_k) D_{1i} D_{2j} D_{3k},
\]
where $I(.)$ is a function.


I coded in Rcpp, my program has to spend more time when n is large (may
be 5000). So I would like use the parallel computing to reduce the runing
time. My idea is to use the parallelfor() (a function in C/C++) for the
"for loop" corresponding to the index i, however, this work is not
applicable to Rcpp. On the other hand, with Rcpp, I found the
parallelFor() function, but I really do not know what can I do with my
situation. Could you help me?

I am waiting your respond. Thanks you!!

Your sincerely,

Khanh

-- 
Khanh To Duc
PhD student, Department of Statistical Science, XXIX cycle.
Office: Room 130
Telephone: +39 049 827 4147
Mobile: +39 345 667 0711
http://www.stat.unipd.it/it/fare-ricerca/duc-khanh



More information about the Rcpp-devel mailing list