multithreading - In R how to control multi-threading in BLAS parallel matrix product -
i have question regarding use of blas parallelized matrix product in r (being default matrix product @ least since r-3.4, maybe earlier).
the default behavior (at least on machine) matrix product (c.f. example below) use cores available on machine, can problem.
do know how control number of cores used standard matrix product in r?
thanks in advance
example:
n=10000 p=1000 q=5000 = matrix(runif(n*p),nrow=n, ncol=p) b = matrix(runif(p*q),nrow=p, ncol=q) c = %*% b # multi-threaded matrix product session info:
> sessioninfo() r version 3.4.1 (2017-06-30) platform: x86_64-pc-linux-gnu (64-bit) running under: ubuntu 16.04.3 lts matrix products: default blas: /usr/lib/openblas-base/libblas.so.3 lapack: /usr/lib/libopenblasp-r0.2.18.so locale: [1] lc_ctype=fr_fr.utf8 lc_numeric=c [3] lc_time=fr_fr.utf8 lc_collate=fr_fr.utf8 [5] lc_monetary=fr_fr.utf8 lc_messages=fr_fr.utf8 [7] lc_paper=fr_fr.utf8 lc_name=c [9] lc_address=c lc_telephone=c [11] lc_measurement=fr_fr.utf8 lc_identification=c attached base packages: [1] stats graphics grdevices utils datasets methods base loaded via namespace (and not attached): [1] compiler_3.4.1
the package rhpcblasctl just that.
from description:
control number of threads on 'blas' (aka 'gotoblas', 'acml' , 'mkl'). , possible control number of threads in 'openmp'. number of logical cores , physical cores if feasible.
we mention in cran task view on hpc.
Comments
Post a Comment