[Rd] How to safely using OpenMP pragma inside a .C() function?

Alireza Mahani alireza.s.mahani at gmail.com
Mon Aug 29 20:48:52 CEST 2011

I am trying to parallelize part of a C function that is called from R (via
.C) using OpenMP's "parallel for" pragma. I get mixed results: some runs
finish with no problem, but some lead to R crashing after issuing a long
error message involving memory violations.

I found this post, which describes how a .Call() function can be made to
avoid crashing R by raising the stack limit:


However, trying this in my .C function doesn't help things. Any
suggestions/tips on whether I can safely use OpenMP inside a .C function,
and if yes how?

Thank you,
Alireza Mahani

View this message in context: http://r.789695.n4.nabble.com/How-to-safely-using-OpenMP-pragma-inside-a-C-function-tp3777036p3777036.html
Sent from the R devel mailing list archive at Nabble.com.

More information about the R-devel mailing list