Difference between revisions of "R"

From HPC users
Jump to navigationJump to search
Line 19: Line 19:
For parallelization the packages doMPI and Rmpi are installed. To launch an parallel R script inside an [[SGE Job Management (Queueing) System| SGE]] script please use command line
For parallelization the packages doMPI and Rmpi are installed. To launch an parallel R script inside an [[SGE Job Management (Queueing) System| SGE]] script please use command line


   mpirun -bootstrap sge -np $NSLOTS -env I_MPI_FABRICS shm:ofa R --slave -f ''SCRIPTNAME'' ''SCRIPT_CMDLINE_OPTIONS''
   mpirun -bootstrap sge -np $NSLOTS R --slave -f ''SCRIPTNAME'' ''SCRIPT_CMDLINE_OPTIONS''


to enable SGE to control all processes of your script. Please do not use the batch starting sequence ''R CMD BATCH''.
to enable SGE to control all processes of your script. Please do not use the batch starting sequence ''R CMD BATCH''.
Line 25: Line 25:
The corresponding parallel environment in the SGE submission script is specified by
The corresponding parallel environment in the SGE submission script is specified by


   #$ -pe impi41 NUMBER_OF_CORES
   #$ -pe impi NUMBER_OF_CORES
   #$ -R y
   #$ -R y



Revision as of 11:16, 7 July 2015

There are two R releases available on FLOW and HERO. The actual relase is available by

 module load r/3.1.1

With this command the corresponding Intel compilers and Intel MPI will be automatically loaded.


Additional installed packages

The actual release contains a lot of additional R packages, for example

  chron, abind, ade4, akima, bitops, caTools, circular, doMC, doMPI, ensembleBMA, foreach, gdata, geosphere,
  gplots, gtools, hht, iterators, lattice, latticeExtra, ncdf, raster, RColorBrewer, RCurl, RMpi, signal, solaR,
  stringr, timeDate, truncnorm, VGAM, zoo

and many more...

Usage of R and MPI

For parallelization the packages doMPI and Rmpi are installed. To launch an parallel R script inside an SGE script please use command line

  mpirun -bootstrap sge -np $NSLOTS R --slave -f SCRIPTNAME SCRIPT_CMDLINE_OPTIONS

to enable SGE to control all processes of your script. Please do not use the batch starting sequence R CMD BATCH.

The corresponding parallel environment in the SGE submission script is specified by

 #$ -pe impi NUMBER_OF_CORES
 #$ -R y

Note (only!) for Rmpi:

  • Before you start R with the mpirun command you have to set the environment variable R_PROFILE in your SGE-Script. Otherwise the MPI processes were not spawned. Please add following line to your SGE-script
  export R_PROFILE="/cm/shared/uniol/apps/R/3.1.1/lib64/R/library/Rmpi/Rprofile"
  • The MPI processes were spawned by the mpirun command. The Rmpi command mpi.spawn.Rslaves() is not necessary and should not be used within the script!


External links