R is a free software environment for statistical computing and graphics. It compiles and runs on a wide variety of UNIX platforms, Windows and MacOS.
We have installed the latest stable R v2.15 version compiled with current compilers and with added modules as well as the default CentOS version.
Below is a list of prerequisites for using R:
The CentOS R is in the default path. To use the CSE version say:
module load R
To use submit a serial job:
#!/bin/bash -l #SBATCH -J MyJob module load R R CMD BATCH --no-save --no-restore <name of R scripts>.R
Then to run the above example:
$ sbatch -p serial <scriptname.sh>
To submit a R+Rmpi parallel job:
#!/bin/bash -l #SBATCH -J MyJob module load R Rmpi R CMD BATCH --no-save --no-restore brute_force.R
Then to submit the job:
$ sbatch -p serial -n 11 <scriptname.sh>
The example code is available at: http://math.acadiau.ca/ACMMaC/Rmpi/brute_force.R
After the job is run in the directory you ran it from you should find a file of the form <scriptname>.o<jobID> containing the output of the job, as well as a PDF file named Rplots.pdf.