Parallel NumPy with OpenBLAS08 Feb 2016
NumPy is a fantastic resource for doing numerical computations in Python, allowing significant speedups by allowing efficient C-implemented operations in the back end do the heavy lifting. However, standard shipped NumPy implementations from Linux package systems and through pip do not take advantage of the potential speed improvments available by executing appropriate array operations in parallel.
In order to do such operations in parallel, we must build it against a supported parallel implementation of BLAS/LAPACK, which are the libraries used to perform linear algebra in NumPy. Some of the supported implementations can be challenging to build themselves, however I found success with OpenBLAS.
I then uncommented the OpenBLAS section and changed the paths to the correct
ones for my system (
pacman -Ql openblas-lapack was of use to locate these
paths on my Arch Linux system) and built and installed NumPy with:
Opening an interactive Python shell, I was able to verify that the operations
were running in parallel by executing the following instructions and observing
CPU usage in