An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-hpc/attachments/20100401/ee5de238/attachment.pl>
openmp C functions in R
3 messages · Luke Tierney, Carl Boettiger
1 day later
You could check out how I handle this in the pnmath package at http://www.stat.uiowa.edu/~luke/R/experimental/pnmath_0.0-3.tar.gz luke
On Thu, 1 Apr 2010, Carl Boettiger wrote:
Dear R-sig-hpc, I have a C function that uses openmp for parallelization on shared memory architecture. I have a Makevars file in the src directory which specifies the the -fopenmp flag. When I run R CMD SHLIB file.c to compile my file, it uses the openmp flag and doesn't give any warnings. Yet when I call the function from R using the .C interface, it uses only one processor. If I compile a stand-alone version of the C code, it runs in parallel on all available processors. Is this the expected behavior? What is the correct way to adapt already parallelized C code to be callable from R? Thanks very much for your help. Carl
Luke Tierney
Chair, Statistics and Actuarial Science
Ralph E. Wareham Professor of Mathematical Sciences
University of Iowa Phone: 319-335-3386
Department of Statistics and Fax: 319-335-3017
Actuarial Science
241 Schaeffer Hall email: luke at stat.uiowa.edu
Iowa City, IA 52242 WWW: http://www.stat.uiowa.edu
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-hpc/attachments/20100402/969bf2c8/attachment.pl>