In this tutorial, you will run an interactive RStudio session and execute R code. Make sure you have opened a FastX session and are logged in to one of the fx nodes, see Getting Started with Slurm Interactive Jobs.

To run interactive jobs, we have use the srun
command to log in to an interactive job node. You can see what nodes are available using sinfo
:

For GPU tasks, you should use one of the gpu nodes as shown on the left column: either comp7gpu1 or turingvm. You can specify what node to use using the --nodelist=comp7gpu1
parameter in srun
.
For now, we will not request a specific node.
srun --pty --mem=8gb --time=1:00:00 --cpus-per-task=1 --nodes=1 /bin/bash
srun
: Command to submit a job to the Slurm scheduler.--pty
: Allocate a pseudo-terminal for interactive job execution.--mem=8gb
: Request 8 gigabytes of memory for the job.--time=1:00:00
: Set a time limit of 1 hour for the job’s execution.--cpus-per-task=1
: Request 1 CPU core per task.--nodes=1
: Request 1 compute node for the job./bin/bash
: Execute the Bash shell as the job’s command.
You will see that you are logged in to one of the interactive nodes.

Check what modules are installed:
module av
# OR
# module avail

To load the RStudio, type in the following command:
module load rstudio
Now run the following command to load the Jupyter Notebook:
rstudio

You will see RStudio in a new window.

Open an R script using the directory navigation window on the bottom right. To run the R script, click the green Run icon.

You will see the output in the Console below.