Rstudio on Trillium via OnDemand - CoBrALab/documentation GitHub Wiki

Introduction

On Trillium we have access to an easy way to run rscripts through the RStudio user interface offered by Compute Canada. It is called OnDemand.

How to Access

To access this service, follow this link: https://ondemand.scinet.utoronto.ca/

They also have a fairly comprehensive wiki here.

You will have to login with your scinet account information, including two-factor authentification.

Starting an RStudio session

Once you login, you will see a dashboard with information and a collection of apps. Scroll down to "Interactive Apps" (see screenshot 1).

Click on "RStudio Server". You will now see a form where you can specify certain criteria for your session. Take note of "Number of hours" as the default is 1 and if you do not increase it, all of your unsaved work will be deleted on session close. Take note also of "Number of physical cores", as the default is 8, which may limit any parallel computing you are doing. Finally, in the last field "Modules", specify cobralab.

When you are satisfied with your selections, press the "Launch" button at the bottom. Your request will be queued (like a debugjob) and when it is fulfilled, it's status will be "Running" and you will see a button on the bottom that says "Connect to RStudio Server". Click this button.

Using the RStudio session.

Once you connected to the server, you will see the familiar RStudio GUI. With the cobralab modules that you loaded when creating your server request, you can use tools like "RMINC" normally by loading them in an R script with library(RMINC).

You can write new files or you can open existing files by going File > Open File... through the RStudio window.

Save your work frequently as the session will close when the time runs out.

Using RMINC

library(RMINC)

When initialising your session, make sure to:

  1. Select R version 4.4
  2. Load the lab module: module load cobralab
  3. Select the number of cores you need, this value will be the max for the parallel argument in your RMINC calls:
# Example: if you requested 25 cores
model <- mincLmer(Path ~ temp_group * poly(age, degree = 1) + (1|subject),
                  data = data2,
                  mask = mask,
                  parallel = c("local", 25),
                  REML = FALSE,
                  summary_type = AIC_summary)

Running jobs in the terminal

If you want to test something in a terminal on Trillium, but you know it will take longer than the 1 hour maximally allotted for a debugjob, OnDemand has a possible solution too.

Login to OnDemand, as outlined above. This time, when you go to "Interactive Apps" click on "Trillium Desktop". Allocate number of cores, memory, and time. A virtual desktop will appear. Click on the terminal, and you can use it as any terminal to access your Trillium files and code.