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

From: pawelm <>
Date: Wed, 31 Aug 2011 13:06:03 -0700 (PDT)


This is very useful example and explanation. Thank you very, very much. The icing on the cake would be some guidelines how to set up the number of threads. R source code uses global variable R_num_math_threads. Can we use that? Or each openmp-enabled R package would have it's own mechanism?

Related question: I was trying to find out if R_num_math_threads could be set up by a user and I found this line in the ./src/main/names.c file:

{"setNumMathThreads", do_setnumthreads, 0, 11, 1, {PP_FUNCALL, PREC_FN, 0}}

It suppose to be a function name but all I get in R command line is:

Error: could not find function "setNumMathThreads"

Any thoughts?

Thank you

View this message in context:
Sent from the R devel mailing list archive at

______________________________________________ mailing list
Received on Wed 31 Aug 2011 - 20:10:18 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 31 Aug 2011 - 21:10:25 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive