[Rd] multi threaded execution of package

Simon Urbanek simon.urbanek at r-project.org
Mon Mar 4 15:25:07 CET 2013


On Mar 4, 2013, at 5:57 AM, Vitaliy FEOKTISTOV wrote:

> Hello,
> 
> I'm creating a package for R. This package containes a fortran (wrapped C)
> *.so .
> This dynamic library is compiled to be multi-threaded (-parallel -openmp
> -threads .. options).
> 

Just the fact that it's compiled with such options doesn't mean it will actually run threaded, they just turn on support in case the code wants to use it, they don't actually parallelize anything on their own.


> When I call this library from R : dyn.load("mylib.so")
> the execution is one threaded !
> 
> Where could be a problem and how to correct it ?
> 

Hard to say for sure, but possibly in your code. Would you care to provide the details, such as your platform, the exact code you're using etc?
Note that there are many packages that have no issue with using OpenMP, for example.

Cheers,
Simon



More information about the R-devel mailing list