Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parallel processing fails #151

Open
evelinag opened this issue May 22, 2015 · 2 comments
Open

Parallel processing fails #151

evelinag opened this issue May 22, 2015 · 2 comments
Labels
Type: Enhancement New feature or request

Comments

@evelinag
Copy link
Contributor

I tried calling R from a parallel loop but it fails with Error: unprotect_ptr: pointer not found, the sequential version works without problems.

#r "packages/R.NET.Community/lib/net40/RDotNet.dll"
#r "packages/RProvider/lib/net40/RProvider.dll"
#r "packages/RProvider/lib/net40/RProvider.Runtime.dll"
open RProvider
open RProvider.stats
open RDotNet

// this works
[| 0..10 |]
|> Array.map (fun _ -> R.rnorm(10) )

// this fails
[| 0..10 |]
|> Array.Parallel.map (fun _ -> R.rnorm(10) )
@mae1st0rm
Copy link

Hi! I have the similar question: Is it possible to call RProvider functions in parallel? For example cal R.lm from different Threads/Tasks (PLINQ) simultaneously?

@tpetricek
Copy link
Member

As far as I understand it, the underlying R engine can only be called from a single thread - so only a single thread can access it (and additionally, I think it also starts doing odd things when you call it from multiple threads, even when the calls are not concurrent).

In principle, I suspect that you can create multiple instances of the R.NET engine (@jmp75 would probably know), but this is not something that we are currently exposing in the R type provider (you cannot really currently initialize the R provider multiple times in a single process).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants