README.md

openblasctl

A micro-package for controlling the number of threads used by OpenBLAS from R. This can be useful if you did not set the OMP_NUM_THREADS environment variable before starting your R session. Obviously this requires that you are using the OpenBLAS library with R.

See the details section of ?openblasctl::openblas_set_num_threads for a for a full explanation.

Installation

You can install the stable version from the HPCRAN using the usual install.packages():

install.packages("openblasctl", repos="https://hpcran.org")

The development version is maintained on GitHub:

remotes::install_github("wrathematics/openblasctl")

If your OpenBLAS installation is in a strange place, you can specify it using the --with-openblas-libpath configure argument. For example:

# Stable version
install.packages("openblasctl", repos="https://hpcran.org", configure.args="--with-openblas-libpath='/path/to/openblas/'")

# Development version
remotes::install_github("wrathematics/openblasctl", configure.args="--with-openblas-libpath='/path/to/openblas/'")

Package Use

### Set desired number of threads
library(openblasctl)
openblas_set_num_threads(2)

### Call your linear algebra routines
La.svd(some_big_matrix)


wrathematics/openblasctl documentation built on March 30, 2020, 6:47 p.m.