This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
|
r [2020/09/21 21:13] root created |
r [2022/12/07 16:17] (current) root |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ==== R ==== | + | === R === |
| - | The " | + | The " |
| - | + | ||
| - | Here we have a quick benchmark for an older installed version of R that should be using MKL blas. It takes 413 elapsed seconds | + | |
| < | < | ||
| - | $ module purge; | + | module load gcc/9.3.1 mkl/19.0.5 R/4.2.2 |
| - | $ R -f bench2.r | + | |
| - | R version 3.1.2 (2014-10-31) -- " | + | |
| - | ... | + | |
| - | > set.seed(123) | + | |
| - | > X <- Matrix(rnorm(9e6), | + | |
| - | > print(system.time(for(i in 1:25) solve(X))) | + | |
| - | | + | |
| - | 411.935 | + | |
| </ | </ | ||
| - | + | " | |
| - | + | ||
| - | A newer version of R with the MKL blas properly linked | + | |
| < | < | ||
| - | $ export MKL_NUM_THREADS=1 | + | module load gcc/9.3.1 mkl/19.0.5 R/4.2.2 rstudio |
| - | $ R -f bench2.r | + | |
| - | R version 3.3.1 (2016-06-21) -- "Bug in Your Hair" | + | |
| - | ... | + | |
| - | > set.seed(123) | + | |
| - | > X <- Matrix(rnorm(9e6), | + | |
| - | > print(system.time(for(i in 1:25) solve(X))) | + | |
| - | | + | |
| - | | + | |
| </ | </ | ||
| - | With maximum threading | + | If you need a new R package, you can ask hpc-support to add it to the central installation, |
| + | |||
| + | For this simple installation, | ||
| < | < | ||
| - | $ export MKL_NUM_THREADS=16 | + | pinnacle-l4: |
| - | $ R -f bench2.r | + | options(repos = c(CRAN = "https:// |
| - | R version 3.3.1 (2016-06-21) -- "Bug in Your Hair" | + | pinnacle-l4: |
| - | ... | + | R_LIBS_USER=~/ |
| - | > set.seed(123) | + | pinnacle-l4: |
| - | > X <- Matrix(rnorm(9e6), | + | pinnacle-l4:feynman:$ mkdir -p R/ |
| - | > print(system.time(for(i in 1:25) solve(X))) | + | pinnacle-l4: |
| - | user system elapsed | + | |
| - | 132.876 2.945 | + | |
| </ | </ | ||
| - | The program is very simple and actual programs will not show such dramatic speedups, but it is still very worthwhile to have the right version and threading for the computer | + | With those files in place you can install any R package yourself. Some redundant text output below has been omitted. |
| < | < | ||
| - | $ cat bench2.r | + | pinnacle-l4: |
| - | require(Matrix) | + | pinnacle-l4: |
| - | set.seed(123) | + | R version 4.2.2 (2022-10-31) -- " |
| - | X <- Matrix(rnorm(9e6), | + | Copyright |
| - | print(system.time(for(i in 1:25) solve(X))) | + | Platform: x86_64-pc-linux-gnu |
| - | </ | + | |
| - | Installation of recent R versions on Centos-6 is involved, as multiple packages need to be updated first, and the procedure is mostly undocumented, | + | [Previously saved workspace restored] |
| - | < | + | |
| - | yum install libXt-devel libssh2-devel openssl-devel | + | |
| - | / | + | |
| - | cd temp-install-directory | + | |
| - | wget http:// | + | |
| - | tar zxf xz-5*gz | + | |
| - | cd xz-5.2.2 | + | |
| - | ./configure --prefix=/ | + | |
| - | make && make install | + | |
| - | cd .. | + | > install.packages(" |
| - | wget https://sourceforge.net/projects/pcre/files/latest/ | + | Installing package into ‘/scrfs/storage/feynman/home/R/x86_64-pc-linux-gnu/ |
| - | mv down*es pcre-8.39.tar.bz2 | + | (as ‘lib’ is unspecified) |
| - | tar jxf pcre*2 | + | trying URL ' |
| - | cd pcre-8.39 | + | Content type ' |
| - | ./configure --prefix=/share/apps/pcre/8.39 --enable-utf | + | ================================================== |
| - | make && make install | + | downloaded 77 KB |
| - | cd .. | + | * installing *source* package ‘broman’ ... |
| - | wget https://curl.haxx.se/download/curl-7.50.0.tar.gz | + | ** package ‘broman’ successfully unpacked and MD5 sums checked |
| - | tar zxf curl*gz | + | ** using staged installation |
| - | cd curl-7.50.0 | + | ** libs |
| - | ./configure | + | gcc -I"/share/apps/R/R-4.0.2/lib64/R/ |
| - | make && make install | + | gcc -I"/ |
| + | gcc -I"/ | ||
| + | gcc -I"/ | ||
| + | gcc -I"/ | ||
| + | gcc -shared -L/ | ||
| + | installing to / | ||
| + | ** R | ||
| + | ** data | ||
| + | *** moving datasets to lazyload DB | ||
| + | ** byte-compile and prepare package for lazy loading | ||
| + | ** help | ||
| + | *** installing help indices | ||
| + | ** building package indices | ||
| + | ** testing if installed package can be loaded from temporary location | ||
| + | ** checking absolute paths in shared objects and dynamic libraries | ||
| + | ** testing if installed package can be loaded from final location | ||
| + | ** testing if installed package keeps a record of temporary installation path | ||
| + | * DONE (broman) | ||
| - | cd .. | + | The downloaded source packages are in |
| - | wget http://www.bzip.org/1.0.6/ | + | ‘/tmp/RtmpRuxu78/downloaded_packages’ |
| - | tar zxf bzip*gz | + | > quit() |
| - | cd bzip2-1.0.6 | + | Save workspace image? [y/n/c]: n |
| - | vi Makefile | + | pinnacle-l4: |
| - | make install PREFIX=/share/apps/ | + | |
| - | cd .. | ||
| - | wget https:// | ||
| - | tar zxf R-3.3.1.tar.gz | ||
| - | cd R-3.3.1 | ||
| - | module load intel/ | ||
| - | IOPT=" | ||
| - | FC=ifort CC=icc CXX=icpc FCFLAGS=" | ||
| - | make && make install | ||
| </ | </ | ||