Skip to content
Prev 2007 / 10988 Next

[Rcpp-devel] OpenMP and Rcpp - compiler error

Dirk:

This does work when I use the Intel compiler, so perhaps you are right.  I am, however, using the standard Apple-provided version, which is 4.2.1. 

I suspect there is a related issue in how OpenMP handles private Rcpp objects in a parallel section.  For example, if I declare

NumericVector X;

#pragma omp parallel (private X)
{
#pragma omp for
for (i=0; i<n; i++) {
	// some code that uses X

}
}

then I would have thought that the compiler would create an instance of X for each thread.  Instead, I am getting memory segfaults even with the Intel compiler, and I wonder if these two issues are related (i.e., perhaps the compielr doesn't know what to do with code like this, and hence the error).

Could I be on track, or way off base?

Thanks,

Michael
On Mar 24, 2011, at 1:03 PM, Dirk Eddelbuettel wrote:

            
-------------------------------------------
Michael Braun
Homer A. Burnell (1928) Career Development Professor, 
	and Assistant Professor of Management Science (Marketing Group)
MIT Sloan School of Management
100 Main St.., E62-535
Cambridge, MA 02139
braunm at mit.edu
617-253-3436