[Numpy-discussion] f2py and openmp

lorenzo bolla lbolla@gmail....
Thu Jul 5 07:01:40 CDT 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://projects.scipy.org/pipermail/numpy-discussion/attachments/20070705/9ff03a1c/attachment.html 


More information about the Numpy-discussion mailing list