[Numpy-discussion] f2py and openmp

lorenzo bolla lbolla at gmail.com
Thu Jul 5 08:01:40 EDT 2007


hi all,
I'm using f2py to compile a f90 function, parallelized with openmp, into a
shared object, that I can import in python.
the question is: when I call the function from python, how can I specify the
number of threads to use?
the usual way of doing it, with a common fortran executable, is setting the
enviroment variable OMP_NUM_THREADS to the desired value.
using os.environ to set it from python does not seem to work: the function
is always executed using 4 processors (that is quite strange in itself:
where does "4" comes from?).
any hints?
thank you all in advance,
lorenzo.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20070705/9ff03a1c/attachment.html>


More information about the NumPy-Discussion mailing list