Multi-threaded OpenBLAS backported to recent Ubuntu releases

[This article was first published on The Ubuntu R Blog, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

OpenBLAS is a multi-threaded BLAS library that has been available in Ubuntu for a while, minus the multi-threading. This has been fixed for the OpenBLAS package to be released in Saucy Salamander, and I have backported the package to the more recent releases of Ubunutu, including Raring, Quantal, and Precise. The current version of OpenBLAS is 0.2.8-1.

To install the multi-threaded version of OpenBLAS, install my RDev PPA. Then run the following:

 sudo apt-get update
 sudo apt-get install libopenblas-base

If you are using Precise (12.04) or Quantal (12.10), you will need to install more recent version of atlas and/or blas, which are also available on the RDev PPA. You will notice a warning about breaking older versions of atlas and blas, which is an indication that you will need to install the other packages.

The good news is that once you install the package, there is nothing you need to do to enable the library. It should also use the maximum number of cores available on your machine, up to 64 (hard limit coded into the package).

To test the library, run R-benchmark-25.R before you install the package and then after. Watch the number of cores being used (via htop, for example) with and without OpenBLAS. With OpenBLAS you should see all you cores ramp up to 100% when doing some of the benchmarks. The decrease in time to run the benchmark will vary from machine to machine. To remove the library, just remove the package.

If you have any questions or problems, please let me know.

To leave a comment for the author, please follow the link and comment on their blog: The Ubuntu R Blog.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)