Step 5: Debugging R Code
Run R interactively on a compute node for testing and debugging.
Review your progress from Step 4
Navigate to the guide directory on /share. It should contain a PDF file called weather.pdf, a R script weather.R, a submit script submit.sh, and the output/error files (out.<jobid>, err.<jobid>) generated by Slurm. A second browser tab should be open to the R documentation. If not, open a new tab to the documentation on using R.
Debugging on Hazel
When developing code or batch scripts, it is often useful to interact with a program at the command line while directly on a node. It is inconvenient to make a small change to a code or script and wait in the queue for hours, only to find a minor typo that crashes your job within seconds. Running applications on a login node - even for only a couple seconds to test a script - is prohibited; for this type of problem, you can reserve a short debugging session on a compute node in interactive mode. See Interactive Jobs for more on interactive sessions.Exercise 5.1: Run R interactively from a compute node
All of the required instructions are in the documentation on using R.salloc --ntasks=1 --exclusive --time=00:10:00) can be used exactly as is, but because the example is not memory intensive, you may omit the --exclusive.
hostname to confirm that you are no longer on a login node.file.rename("weather.pdf","weather2.pdf"). This command renames the file it just created, and it returns TRUE if successful.
quit(). Do not save the workspace (type [n]).file weather2.pdf to confirm that it is a valid PDF file.scontrol show node [name of your node]. How many cores are on that node (look for CPUTot)? You can also see a one-line summary of every node type with the si command; see the monitoring shortcuts (sq, si, sjs).