[f2py] control number of OpenMP threads at runtime

Steve Schmerler <[email protected]>
Newsgroups gmane.comp.python.f2py.user
Message-ID <[email protected]>
Hi

I use OpenMP to speed up subroutines in my extension modules. I don't
set the number of threads in the code (e.g. with !$omp parallel
num_threads(N) or omp_set_num_threads(N)). 

Without these the code runs 4 threads on a quad-core box. The problem
is: the extension module does not seem to honor the OMP_NUM_THREADS
environment var (it does for a "normal" Fortran executable). How do I
control the number of threads at runtime for the extension module?

best,
Steve
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.