Multi-threaded R

How to get R to harness multiple treads for distributed computing

Multi-threaded R

Eagle is built with the R language. R, by default, is installed for single-threaded computation. However, it is possible to replace R’s default single-threaded math libraries with multi-threaded libraries. In doing so, many of R’s linear algebra operations become implicitly parallelised. We have purposely built Eagle to take full advantage of this implicit parallelisation.

There are two ways in which to install R that is multi-threaded:

  • The easiest approach is to install Microsoft's version of R which is called R Open. R Open looks and works exactly the same as standard R. However, those functions which make calls to the single-threaded linear algebra libraries BLAS and LAPACK are replaced by calls to the high-performance multi-threaded MKL libraries.

    For instructions on how to install R Open for your system, go to our Installation page.

  • An alternate approach is to install standard R from CRAN and to replace the single-threaded BLAS library with OpenBLAS, a free multi-threaded BLAS library. Before R Open, this was the favoured way of making R calculations multi-threaded.

    If you search for "openblas for R" you will find multiple sites with instructions on how to do this. However, briefly, first download openblas. How you do this exactly will be dependent upon which platform you are running. Second, install the latest version of R from CRAN. Third, replace the library libRblas.so with a soft link to the Open BLAS library libopenblas.so.

Both approaches for installing a multi-threaded version of R have advantages and disadvantages. However, we have opted with the first approach (installing R Open) since R Open is trivial to install on a Windows system and the MKL libraries are better performing than openBLAS libraries.