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.
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/'")
### Set desired number of threads
library(openblasctl)
openblas_set_num_threads(2)
### Call your linear algebra routines
La.svd(some_big_matrix)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.