From alireza.s.mahani at gmail.com  Mon Aug 29 20:48:52 2011
From: alireza.s.mahani at gmail.com (Alireza Mahani)
Date: Mon, 29 Aug 2011 11:48:52 -0700 (PDT)
Subject: [Rd] How to safely using OpenMP pragma inside a .C() function?
Message-ID: <1314643732236-3777036.post@n4.nabble.com>

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:

http://www.r-bloggers.com/using-openmp-ized-c-code-with-r/

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.



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