Skip to content

RStudio

To use RStudio click the RStudio icon after logging in. It is located in the second row at the home screen. This opens up a Slurm job script where values can be filled in.

Launching the App

When launching the RStudio app, you will need to configure several settings:

  • Account:
    • If using a UT login, the default Account should be used uthpc.
    • If using an ETAIS login, choose the appropriate Account allocation under which you would like to use the resources.
  • Partition:
    • This determines which partition on the Rocket cluster your job will run on.
    • In most cases, then 'main' partition should be used. More information about partitions.
  • CPU cores:
    • Select the number of CPU cores needed for your RStudio instance.
    • Generally, 1 core is sufficient. Consider parallel processing with R to utilize multiple cores.
  • Memory (GB):
    • Choose the amount of memory required by the RStudio instance.
    • On you very first run, allocate more memory - 12 GB. Otherwise the job may run out of memory. On first startup the image is being built for your user.
    • Typically, 4-6 GB is sufficient, but larger datasets may require more.
  • R version:
    • Select the desired R version.
  • Number of hours:
    • Since RStudio runs within a Slurm job, you must specify a time limit.
    • The job does not stop automatically when idle; it only stops when the time limit is reached.
  • data location:
    • This specifies where the RStudio session data is saved.
    • It can be left blank, but if collaborating on a project, a shared folder might be convenient.
    • Using a project folder allows another user to start an RStudio instance referencing the same folder, enabling shared session history and environment variables.
    • Note: This is not the default home folder where RStudio code runs; a different default folder to start code from must be accessed manually.

Job states

After clicking Launch, the job is submitted to the cluster. You will be redirected to a job status screen where the job state is displayed. The Slurm job ID is shown in brackets next to RStudio, which may be useful for debugging.

  • Queued: The job is waiting in the Slurm queue.
  • Starting: The Singularity container for RStudio is being built. The first startup may take up to 5 minutes.
  • To monitor progress, click on the Session ID number.
  • In the session’s filesystem view, check output.log for real-time updates.
  • Additional files in this directory may provide insight into the app's background processes.
  • Running: The container is ready, and you can connect to RStudio by clicking Connect to RStudio Server at the bottom of the job screen.

Tips and Best Practices

Debugging

If you are having issues starting up your RStudio instance, check the logs from you rocket user at the path ondemand/data/sys/dashboard/batch_connect/sys/bc_rstudio/output/<session_id>/output.log. If there were any issues the error should be shown there.

If the first startup of your RStudio instance failed, clean up the RStudio session folder before trying again. They are located at your specified path or default ~/.local/share/rstudio.

Change the Working Directory

To set the working directory, run the following command:

setwd("/intended_working_directory/")

Then in the Files tab, navigate to More and click Go To Working Directory. Now, your workspace operates from the specified directory, allowing you to browse files conveniently.

The RStudio instance provides access to project folders located at /gpfs/space/projects and /gpfs/helios/projects.

Adding a Library Path

To add a library path, run:

.libPaths( c( "~/userLibrary" , .libPaths() ) )

This will add the user library to the top of the path list, making it the first place a package is searched from. Verify the library paths using .libPaths().

Monitoring Memory Usage

To check memory usage in RStudio navigate to Tools Memory Memory Usage Report. This shows the memory usage of R inside the container.

For broader monitoring, visit elk.hpc.ut.ee to track job-level resource usage. Note that this displays overall job metrics rather than the specific resources utilized within RStudio.

Cleaning Up Resources

Once you have finished working in RStudio, consider terminating the job if significant time remains. This helps free up cluster resources for other users.

To delete a running job:

  1. Go to My Interactive Sessions.
  2. Click Delete next to the RStudio job.

This ensures efficient resource utilization within the cluster.

Important notice

Billing is based on the RStudio instance you have requested from the cluster as a Slurm job being active with the resource specification requested upon launch. It does not dive into the processes run inside your RStudio instance itself. Accounting will stop when the time expires or you shut down the instance manually.