Step 4: Running R
Run R using the batch scheduler (Slurm).Running from the scratch directory
You should keep source code and scripts in your home directory, but you should run your jobs from the scratch directory. Code and scripts need to be in permanent storage. Output files can be large, and they should be generated in the scratch directory. Since the scratch directory is purged every 30 days, you must move the outputs that you want to keep to a local computer or to another storage space. Step 7 covers the supplemental storage available to you.
Exercise 4.0: Always run from the scratch directory
The directory name, /share, is an alias to another directory, and it is not the same for every user. Usually you would not need to know this, but printing the working directory from /share may be confusing. Here is what the full path may look like for a typical user:
[unityID@login ~]$ cd /share/groupname/unityID/ [unityID@login unityID]$ pwd /gpfs_common/share01/groupname/unityID
Hint: Add the argument '-r' (for recursive) to the usual copy command to copy an entire directory.
Finding software specific information
Click to open a new tab to the documentation on using R. Every application installed on Hazel has a page like this one; they are reached from the Software page. Note the sections on loading R (module load R) and on running R in batch mode.
Using the software documentation
Use the R documentation to complete the following exercises.Exercise 4.1: Submit an R job to a compute node using Slurm
All of the required instructions are in the documentation on using R.sbatch submit.sh.squeue -u $USER (or the shortcut sq). When you first submit a job to Slurm, the job will be listed with a PD (pending) state. Hit the [up] arrow key to repeat the command to check the state. After the job begins, the state will change to R (running), and the job disappears from the list when it finishes.file weather.pdf to check that it is a valid PDF file. If not, check the Slurm output files out.<jobid> and err.<jobid> generated from your run. Modify and resubmit the job if necessary.sjs <jobid> — see job monitoring.