Dear Luke, HPC-list,

Thanks for the package link.  Could you give me a little advice on where to
start?

For instance, is your install.R file required to make the parallelization
work or just providing interface functions to set processor numbers, etc?
you're using the .Call interface; I'm using the .C interface,does this make
a difference?

I'm still not clear why the parallelization doesn't happen when the shared
object file has been compiled successfully with openmp support.

Thanks for the help,

Carl

On Fri, Apr 2, 2010 at 11:08 AM, <luke@stat.uiowa.edu> wrote:

> 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@stat.uiowa.edu
> Iowa City, IA 52242                 WWW:  http://www.stat.uiowa.edu
>



-- 
Carl Boettiger
Population Biology, UC Davis
http://two.ucdavis.edu/~cboettig

	[[alternative HTML version deleted]]

