12

After spending a huge amount of time on building the ATLAS from the source code, I found that libopenblas and libatals in the OpenSUSE 13.1 repository. My questions are

  1. Does that easy-install (without tuning on your own computer) "libatlas" in the repository really improve the computation performance?

  2. Is OpenBLAS better than ATLAS or only better than the easy-install "libatlas" in the repository of a flavor of Linux? See For faster R use OpenBLAS instead: better than ATLAS, trivial to switch to on Ubuntu.

  3. I followed this post Compiling Numpy with OpenBLAS but cannot find "numpy.core._dotblas" module. Morever I couldn't build Numpy with ATLAS and OpenBLAS at the same time.

  4. Could someone post a .py file or bash code for doing the comparison between ATLAS and OpenBLAS? For example.

  5. I built Numpy-1.9 with my own ATLAS, compiled OpenBLAS from the source code and installed the "libopenblaso" (OpenMP version) and "libopenblasp" (pthreads version) in the repository of OpenSUSE 13.1. How to configure the links and the libraries so that one can tell Numpy-1.9 to use OpenBLAS instead of ATLAS without rebuilding the Numpy-1.9 package.

Note: If you install "libatlas" in the repository, the ATLAS is not tuned for your computer and cannot the computation performance much. Therefore, I built and tuned the ATLAS first, then built Numpy with my own ATLAS. After that I tried to link OpenBLAS to Numpy but failed.

Many thanks in advance!


Thank you @Dmitry for the quick reply! But the questions are not solved...

Install

$ sudo zypper in libopenblasp0

The following NEW package is going to be installed:
  libopenblasp0 

1 new package to install.
Overall download size: 3.0 MiB. After the operation, additional 30.3 MiB will be used.
Continue? [y/n/? shows all options] (y): 
Retrieving package libopenblasp0-0.2.11-11.1.x86_64      (1/1),   3.0 MiB ( 30.3 MiB unpacked)
Retrieving: libopenblasp0-0.2.11-11.1.x86_64.rpm ...........................[done (2.1 MiB/s)]
(1/1) Installing: libopenblasp0-0.2.11-11.1 ............................................[done]

Additional rpm output:
/sbin/ldconfig: Can't link /usr/lib64//usr/local/atlas/lib/libtatlas.so to libopenblas.so.0

Q: Why is there a funny double slash "..64//usr.."?

Link the library

$ /usr/sbin/update-alternatives --config libblas.so.3

  Selection    Path                               Priority   Status
------------------------------------------------------------
  0            /usr/local/atlas/lib/libtatlas.so   70        auto mode
  1            /usr/lib64/blas/libblas.so.3        50        manual mode
  2            /usr/lib64/libopenblasp.so.0        20        manual mode
  3            /usr/local/atlas/lib/libcblas.a     50        manual mode
  4            /usr/local/atlas/lib/libptcblas.a   60        manual mode
  5            /usr/local/atlas/lib/libsatlas.so   65        manual mode
* 6            /usr/local/atlas/lib/libtatlas.so   70        manual mode

Q: Is this configuration fine, as some static libraries ".a" are linked?

Note: "libopenblasp.so.0" is linked automatically after "zypper in", whilst all "atlas" libraries are manually created by the command:

$ /usr/sbin/update-alternatives --install /usr/lib64/blas/libblas.so.3 libblas.so.3 /usr/local/atlas/lib/libxxxx.x <Integer>
Community
  • 1
  • 1
gundamlh
  • 173
  • 1
  • 9
  • 1
    Here is a report [Comparing different versions of BLAS](http://cran.r-project.org/web/packages/gcbd/vignettes/gcbd.pdf)! – gundamlh Sep 14 '14 at 07:09
  • 1
    Comparison: http://stackoverflow.com/questions/5260068/multithreaded-blas-in-python-numpy – gundamlh Sep 14 '14 at 13:30

1 Answers1

6

You can switch between system BLAS and LAPACK implementations by using update-alternatives. For example:

/usr/sbin/update-alternatives --config libblas.so.3

http://en.opensuse.org/openSUSE:Science_Linear_algebra_libraries

I don't know about atlas packages, but we provide openblas with multiarch support. Math kernel includes all processor specific optimizations and set right variant dynamically. Note, there are 3 versions of openblas library: serial, pthreads and openmp version. You need to use pthreads or openmp.

Dmitry
  • 86
  • 2
  • $ sudo zypper in libopenblasp0 $ 1 new package to install. $ Additional rpm output: /sbin/ldconfig: Can't link /usr/lib64//usr/local/atlas/lib/libtatlas.so to libopenblas.so.0 – gundamlh Sep 14 '14 at 08:16
  • why is there a double slash "..64//usr.."? – gundamlh Sep 14 '14 at 08:28
  • Really strange error. Do you have own atlas build in /usr/local? And do you have installed updates? Where was conflict between ldconfig and update-alternatives. In any case, if you have big logs or something similar, you can write me directly: dmitry_r [at] opensuse.org – Dmitry Sep 14 '14 at 08:43
  • Yes, I built my own atlas library from the source code. What updates should I install? Do you mean $ sudo /sbin/ldconfig after the installation? No, I didn't. I will send you the big install-log right now. – gundamlh Sep 14 '14 at 08:51
  • According to your logs updates are installed. So ldconfig was confused by your own atlas. Unfortunately I can't say anything about this situation. – Dmitry Sep 14 '14 at 08:58
  • Perhaps I should install my own atlas in the default directory /usr/lib64 instead? – gundamlh Sep 14 '14 at 09:25