Re: [Numpy-discussion] Numpy wheels, openBLAS and threading

2017-09-28 Thread Derek Homeier
On 28 Sep 2017, at 3:37 pm, Max Linke wrote: > > os.environ can be used to change environment variables from within > python. > > https://docs.python.org/2/library/os.html#os.environ > > I do not know when openBLAS is reading the environment variables though. > Changing a value while your pytho

Re: [Numpy-discussion] Numpy wheels, openBLAS and threading

2017-09-28 Thread Peter Cock
This came up for Biopython recently (someone using our library on a cluster ran into thread limits triggered by the importing of NumPy), and suggested something like this: import os try: os.environ["OMP_NUM_THREADS"] = "1" import numpy finally: del os.environ["OMP_NUM_THREADS"] Or MKL_

Re: [Numpy-discussion] Numpy wheels, openBLAS and threading

2017-09-28 Thread Max Linke
os.environ can be used to change environment variables from within python. https://docs.python.org/2/library/os.html#os.environ I do not know when openBLAS is reading the environment variables though. Changing a value while your python process is running might be to late. Jean-Christophe Houde w

[Numpy-discussion] Numpy wheels, openBLAS and threading

2017-09-28 Thread Jean-Christophe Houde
Hi all, not sure if this is the best place to ask for this. If not, please advise on the correct place. Since the numpy wheels internally use openBLAS, operations can be implicitly multithreaded directly by openBLAS. This, of course, can clash with multithreading or parallel processing. The reco