Skip to content Skip to sidebar Skip to footer

Scipy.sparse Package Is Multithreads/multiprocess Or Not

I am using scipy.sparse.linalg.spilu and scipy.sparse.linalg.bicgstab to solve Ax=b. I observed my CPU usage sometimes is around 50%. My CPU is Intel(R) Xeon(R) CPU E3-1245 V2@3.40

Solution 1:

These routines are not themselves parallelized. However, if you are using a multithreaded BLAS library such as ATLAS or Openblas, which is likely, several linear algebra operations in the routines are parallelized. Therefore, they benefit from multiple cores.

Solution 2:

@p.v is correct. You must link scipy/numpy to a multithreaded blas library to take advantage of your multiple cores.

On a side note, I'm assuming that you are using Linux. Within Linux, when watching CPU utilization, the percentage you see is per core. 50% would mean that half of one core is being used. If you have 8 cores, then you should see CPU usage around 800% if all 8 are being used fully.

Post a Comment for "Scipy.sparse Package Is Multithreads/multiprocess Or Not"