Running serial R code on the cluster is similar to running any other serial job. We give
a serial example, and then demonstrate how to run a parallel job using the SNOW and Rmpi packages.
Make sure you've read the tutorial for C programs
first, to understand the basics of serial and parallel programming on tara.
For more information about the software, see the R
website.
There are several versions of R installed on R. By default, you will use the
system R, which may not be the most recent
[araim1@tara-fe1 ~]$ R --version
R version 2.13.0 (2011-04-13)
...
[araim1@tara-fe1 ~]$
To use a newer version, load the following module
[araim1@tara-fe1 ~]$ module load R
[araim1@tara-fe1 ~]$ R --version
R version 2.14.0 (2011-10-31)
...
[araim1@tara-fe1 ~]$
The module is loaded for the duration of your SSH session. To automatically load
it each time you log in, put the line "module load R" into $HOME/.bash_profile
Serial example
In order to run R on the cluster
nodes, we will need an R script and a batch submission script. Here is a
sample script that creates a scatter plot and adds a regression line.