[issue17038] multiprocessing only use one core when C module are imported

2016-11-28 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: Ended up here by accident. For whoever bumps into this same issue, psutil allows to get an set CPU affinity, so you can avoid using taskset. >>> import psutil >>> psutil.cpu_count() 4 >>> p = psutil.Process() >>> p.cpu_affinity() # get [0, 1, 2, 3] >>>

[issue17038] multiprocessing only use one core when C module are imported

2013-01-26 Thread HadiM
New submission from HadiM: Hi, This is the first time I report a bug so if I did something wrong please let me know. I also tried to ask on #python and #python-fr before posting here to know if it was a bug or a possible multiprocessing limitation on Linux. So I'm sorry if it's not a bug...

[issue17038] multiprocessing only use one core when C module are imported

2013-01-26 Thread HadiM
HadiM added the comment: I test to launch bug.py with pypy (import numpypy instead of import numpy) and the bug did not appear. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17038 ___

[issue17038] multiprocessing only use one core when C module are imported

2013-01-26 Thread Charles-François Natali
Charles-François Natali added the comment: Hello, So I'm sorry if it's not a bug... Don't be afraid, we don't byte :-) Concerning your problem, my guess would be that one of the modules you import sets the process CPU affinity (maybe as a workaround to mitigate the GIL impact in

[issue17038] multiprocessing only use one core when C module are imported

2013-01-26 Thread HadiM
HadiM added the comment: Indeed some value change when I print cpu line from /proc/self/status but I don't really understand what that mean... So there is no solution about that ? We cannot use multiprocessing with these modules under Linux ? Do you think I can manually change the CPU

[issue17038] multiprocessing only use one core when C module are imported

2013-01-26 Thread Charles-François Natali
Charles-François Natali added the comment: Indeed some value change when I print cpu line from /proc/self/status but I don't really understand what that mean... It means that the CPU affinity is changed, so the scheduler binds your process to a subset of the available CPUs. So there is no

[issue17038] multiprocessing only use one core when C module are imported

2013-01-26 Thread Charles-François Natali
Changes by Charles-François Natali cf.nat...@gmail.com: -- resolution: - invalid stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17038 ___

[issue17038] multiprocessing only use one core when C module are imported

2013-01-26 Thread HadiM
HadiM added the comment: Your snippet did the trick ! Thank you for your time. Even if it's not very clean, it's working. Thank again ! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17038