Linear algebra and parallelized linear algebra (using BLAS)

Linear algebra and parallelized linear algebra (using BLAS)


The openBLAS threaded BLAS is installed on all the compute servers, including the cluster. This allows parallelization of linear algebra routines, in particular any linear algebra done in R, via a mechanism known as threading.

In some cases using multiple threads can actually slow down a job, or more commonly, can give negligible speed-up. It's worth testing your job using a single thread vs. multiple threads to see what the speed-up is.

You can restrict your job to a single thread by setting the OMP_NUM_THREADS environment variable before starting your job. To restrict to a single thread, do the following at the command line (in bash):


or in tcsh, "setenv OMP_NUM_THREADS 1".

To enable openBLAS for R on your own Linux machine, see Section A.3 of the R Installation and Administration Manual.


CRAN's R binary comes with a default BLAS that the R developers recommend and a fast, threaded BLAS from Apple's Accelerate framework. See here for information on how to enable the latter on your own Mac. You'll need administrative privileges.

To change the number of threads used, follow the instructions above for Linux but use VECLIB_MAXIMUM_THREADS rather than OMP_NUM_THREADS.


To enable openBLAS with R on your own Windows machine, see here.