settings.num_cpus = 1 does not work
See original GitHub issueI am distributing some qutip code to several cores. I want to enforce that qutip only uses one core per job with qutip.settings.num_cpus=1, but it is not working, the processes still take all the processors of my machine, so that if I have N cores, the multiprocessing ends up using N*N threads, slowing things down a lot! How can I force qutip to use only 1 core? Currently loading like this:
from qutip import create, destroy, Qobj, expect, tensor, qeye, fidelity, basis, variance, settings
from pathos.multiprocessing import ProcessingPool
settings.num_cpus = 1
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
I cant see any other cores but only 1 in msconfig boot advanced
I have amd ryzen 5 3550h with 8 cores. But my task manager is not showing that. I can see how many cores...
Read more >Setting num_thread = 1 does not work on Windows #4447
Hi there, when setting num_threads = 1, on my linux machine CPU usage dropped from 70% to 10%, however, it didn't change CPU...
Read more >How To Enable All Cores in Windows - Alphr
Core Settings In Windows 10 · Type 'msconfig' into the Windows Search Box and hit Enter. · Select the Boot tab and then...
Read more >HOW TO ENABLE ALL CORES IN WINDOWS 10 - YouTube
Problems arise when the Windows OS then never re-enables all the cores. ... try ticking detect HAL in the BOOT Advanced Options in...
Read more >How To Enable All CPU Cores Windows 10 - YouTube
Copy link. Info. Shopping. Tap to unmute. If playback doesn't begin shortly, try restarting your device. Your browser can 't play this video....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This parallelism does not come from
qutip
butscipy
:coherent
usescipy.sparse.linalg.expm
which run in parallel for big matrix. This can be fixed with enviroment variable like$ export OPENBLAS_NUM_THREADS=1
in bash oros.environ["OPENBLAS_NUM_THREADS"] = "1"
in python, but there are a few possibilities:See https://stackoverflow.com/questions/30791550/limit-number-of-threads-in-numpy
I remember that @fminga had a similar necessity while exploiting
qutip.parallel
on a cluster (the RAM or SWAP were clogging the cluster) and I think he solved it by enforcing thenum_cpus
in theparfor
. I don’t know if this would work for your case.