Yen-R

From FarmShare

Revision as of 12:05, 2 November 2015 by Chekh (Talk | contribs)
Jump to: navigation, search

Trying to compile a yen-specific R with Intel MKL. Following https://web.stanford.edu/group/proclus/cgi-bin/mediawiki/index.php/Software-R#admin_-_installing_R.2F3.1.0.mkl

as chekh on yen4

 mkdir /farmshare/software/free/r/yen-r
 wget https://cran.r-project.org/src/base/R-3/R-3.2.2.tar.gz
 tar zxvf R-3.2.2.tar.gz
 cd R-3.2.2/
 module load intel/2016
 CFLAGS="-O2 -march=native" CXXFLAGS="-O2 -march=native" FFLAGS="-O2 -march=native" FCFLAGS="-O2 -march=native" ./configure --with-blas="-L${MKLROOT}/lib/intel64 -lmkl_gf_lp64 -lmkl_sequential -lmkl_lapack95_lp64 -lmkl_core" --with-lapack --prefix=/farmshare/software/free/r/yen-r/ir --enable-R-shlib


That will use gcc but Intel MKL to compile it.

configure results:

R is now configured for x86_64-pc-linux-gnu

  Source directory:          .
  Installation directory:    /farmshare/software/free/r/yen-r/ir

  C compiler:                gcc -std=gnu99  -O2 -march=native
  Fortran 77 compiler:       gfortran  -O2 -march=native

  C++ compiler:              g++  -O2 -march=native
  C++ 11 compiler:           g++  -std=c++11 -O2 -march=native
  Fortran 90/95 compiler:    gfortran -O2 -march=native
  Obj-C compiler:	     gcc -g -O2 -fobjc-exceptions

  Interfaces supported:      X11, tcltk
  External libraries:        readline, BLAS(ATLAS), LAPACK(generic), zlib, bzlib, lzma, PCRE, curl
  Additional capabilities:   PNG, JPEG, TIFF, NLS, cairo, ICU
  Options enabled:           shared R library, R profiling

  Capabilities skipped:      
  Options not enabled:       shared BLAS, memory profiling

  Recommended packages:      yes
 make
 make install

test

use file proclus:~chekh/alex_blas_test.R (first example from http://www.bios.unc.edu/research/genomic_software/Matrix_eQTL/BLAS_Testing.html )

It prints out the runtime at the end, but I guess you actually need to multiply that by the number of cores it used. Which you have to catch from e.g. the output of /usr/bin/time CPU.

proclus login node, R 2.15 mkl:

module load R
/usr/bin/time R --vanilla < alex_blas_test.R
...
%*%	 6.871 	crossprod	 6.421> 
68.40user 0.61system 1:10.39elapsed 98%CPU (0avgtext+0avgdata 2796640maxresident)k
16inputs+0outputs (0major+20901minor)pagefaults 0swaps

so that was 6.8,6.4 on one CPU

yen4, Ubuntu R:

$ /usr/bin/time R --vanilla < alex_blas_test.R 
...
%*%	 1.84 	crossprod	 1.141> 
179.62user 290.75system 0:26.70elapsed 1761%CPU (0avgtext+0avgdata 697980maxresident)k
112inputs+24outputs (1major+514924minor)pagefaults 0swaps

so that was 1.8, 1.1 but with ~18 CPU

yen4, newly built R:

$ /usr/bin/time /farmshare/software/free/r/yen-r/ir/bin/R --vanilla < alex_blas_test.R 
...
%*%	 13.382 	crossprod	 12.467> 
125.97user 29.37system 2:35.23elapsed 100%CPU (0avgtext+0avgdata 748872maxresident)k
0inputs+0outputs (0major+331647minor)pagefaults 0swaps

So that was 13.3 and 12.4 on one CPU.

Personal tools
Toolbox
LANGUAGES