This is an old revision of the document!
R is installed in /opt/gridware/applications/R/R-2.15.2/ and is compiled using Open-MPI with the GNU compilers so you will need to add
module add openmpi/openmpi-1.6.1-gnu
to your .bashrc file in your home directory.
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.
Now you must add the R path to PATH in your .bashrc file by including the following line:
export PATH=/opt/gridware/applications/R/R-2.15.2/bin:$PATH
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.