Re: [Numpy-discussion] Set #threads from within python code

2017-03-24 Thread Pavlyk, Oleksandr
: Friday, March 24, 2017 6:31 AM To: numpy-discussion@python.org Subject: [Numpy-discussion] Set #threads from within python code I don't want my python code to run multi-thread. So I can do: MKL_NUM_THREAD=1 NUMEXPR_NUM_THREADS=1 OMP_NUM_THREADS=1 my_program... But I don't seem to be able

Re: [Numpy-discussion] Set #threads from within python code

2017-03-24 Thread Neal Becker
Ah, that probably explains it! On Fri, Mar 24, 2017 at 7:37 AM Daπid wrote: > On 24 March 2017 at 12:30, Neal Becker wrote: > > Using os.environ doesn't > > work. I don't understand why. > > It should, I do that for other variables. Are you setting the > variables before importing other librar

Re: [Numpy-discussion] Set #threads from within python code

2017-03-24 Thread Daπid
On 24 March 2017 at 12:30, Neal Becker wrote: > Using os.environ doesn't > work. I don't understand why. It should, I do that for other variables. Are you setting the variables before importing other libraries? They may only get read at import time. __

[Numpy-discussion] Set #threads from within python code

2017-03-24 Thread Neal Becker
I don't want my python code to run multi-thread. So I can do: MKL_NUM_THREAD=1 NUMEXPR_NUM_THREADS=1 OMP_NUM_THREADS=1 my_program... But I don't seem to be able to achieve this effect without setting env variables on the command line; within my_program. Using os.environ doesn't work. I don't u