Skip to content

R2 Guide

SpencerFleming edited this page May 29, 2019 · 2 revisions

Using R2

This document will get you logged into R2.

To access R2 from out of campus, the easiest way is to SSH into Onyx, then SSH into from within it. It sounds dumb, but it actually works great.

To set up your dev environment on R2, the best practice is to clone this git repo onto ~/scratch. To run the code on R2, you'll have to add some modules to your session containing the libraries it uses:

module add gsl/gcc/2.4
module add gdal/intel/2.2.2

You can add these two lines to the end of your bashrc so that they're added whenever you log in automatically.

Slurm

R2 uses Slurm to help manage all of its hardware resources, and let all the users queue up their huge tests. It accepts special bash scripts that can be configured to email you when your tests are complete, specify how and where you want to queue your script, and more. I'd recommend you run your tests through this if you expect the process to take any more than a couple seconds.

Here's a link to Slurm's website. You might find the documentation here useful sometimes.

Here's a link to an example script that runs on R2. This will be all you need in most cases.

To use a bash script like this in Slurm, enter the following on R2:

sbatch <path/to/script>

And you'll be able to see the progress of your job by entering

squeue

or

squeue -u <username>

if you would like to filter out the other jobs. You may find that depending on how busy it is, it might take a while for your job to actually start running.

When the job starts running, a file will show up in your home directory named 'slurm-1234.out' or something similar. It will contain the output from the script you submitted, written to in real-time, so you can check on it as it runs.

Clone this wiki locally