This is an old revision of the document!
R is installed in /opt/gridware/applications/R/R-3.0.0/ and is compiled using mvapich2 with the GNU compilers. Simply adding
export MODULEPATH=/opt/gridware/bioinformatics/modules:$MODULEPATH module add R/3.0.0
to your .bashrc file in your home directory will set up the appropriate paths to R, the compilers (if you want to add your own R packages) and the mpi libraries. Note that R 2.15.2 and 2.15.3 are also currently installed and can be used by modifying the “module add” command.
On the CHPC clusters the .bashrc file is not automatically run for interactive logins, only the .profile file is. To rectify this add the following lines to the end of your .profile file:
if [ -f ~/.bashrc ]; then . ~/.bashrc fi
Then make any changes to the PATH variable in your .bashrc file. It is vital that all paths are updated in the .bashrc file is because that file is run for non-interactive jobs, which all the jobs submitted to the Moab queues are.
The rMPI and doMPI packages are already installed to allow R to use MPI to distribute its work across multiple nodes of the cluster.
Once you've created your R script file, called 'job-1.r', you will need to create a job script file to submit to the Moab scheduler.
Example job script file:
#!/bin/bash #MSUB -l nodes=2:ppn=8 #MSUB -l walltime=1:00:00 #MSUB -V #MSUB -o /export/home/username/simulations/job-1.out #MSUB -e /export/home/username/simulations/job-1.err #MSUB -d /export/home/username/simulations #MSUB -M be your_emall@address #MSUB -q mpirun -np 16 /opt/gridware/applications/R/R-2.15.2/bin/R --slave -f /export/home/username/simulations/job-1.r
Notes:
username with your user name.your_emall@address with your email address.simulations with your program's working directory (which should really be on scratch for speed).job-1 to be your script file name.