i was trying to make network construction in wgcna packages execute faster. As recommended in the "frequently asked questions" , i wanna to compile R with blas library.
After openblas installation completed, i found the following information in the manual : "Once installed it canbe used by somethinglike --with-blas="-lopenblas
" ." Is that means i have to configure R with this? Because i do not want to re-install R and its libraries, i checked any blas in R with the command " lsof -p pidID |grep blas
". The feedback is "/usr/lib64/R/lib/libRblas.so". I try to replace the libRblas.so/libblas.so with libopenblas-r0.2.19.so (with the following commands) to make openblas work for R.
export OPENBLAS_NUM_THREADS=8 export LD_LIBRARY_PATH=${HOME}/usr/lib64/openblas/lib\:$LD_LIBRARY_PATH
ln -s /usr/lib64/libopenblas-r0.2.19.so /usr/lib64/libblas.so
ln -s /usr/lib64/libopenblas-r0.2.19.so /usr/lib64/R/lib/libblas.so
lsof -p pidID |grep blas
> R 71713 root mem REG 253,0 33947432 201416627 /usr/lib64/libopenblas-r0.2.19.so
It seems work. But when i use "cat /proc/pidID/status|grep Threads
" to check the threads, only 1 threads were used in R.
It seems R calls openblas successfully, but why only i thread were used in R ? what can i do to use multiple-threads in R with openblas? Do i still need to re-install R?
Hi martin,thx for your reply.
i had re-installed R and configured with
--with-blas="-lopenblas
. After installation, i executed“./R” from the “bin” directory. "lsof -p pidID |grep blas
" reports R is using libopenblas-r0.2.19.so, but still only 1 thread.btw, i have set
export OPENBLAS_NUM_THREADS=8.
still confused. Is there anything i have missed ?I don't really have enough experience; probably better to ask on R-sig-hpc (maybe after googling 'R-sig-hpc openblas').