RStudio on Great Lakes

Spatial Statistics - BIOSTAT 696/896

Michele Peruzzi

University of Michigan

Introduction

  • Goal: use U-M resources for computing rather than your laptop
  • Not required! OK to use whatever you prefer
  • I assume you now have setup your account
  • I assume you have U-M’s VPN setup on your computer
  • Establish a VPN connection
  • Login to https://greatlakes.arc-ts.umich.edu/pun/sys/dashboard

Main page

First time setup

  • We will now make sure R runs optimally using the Intel MKL linear algebra library
  • This will give linear algebra operations a 20x speed boost, sometimes more

Go to Files > Home Directory

Go to Files > Home Directory

On your laptop, create a new file rstudio-mkl.sh

Contents of the file:

#!/bin/bash
module load RStudio
module load R/4.3.2-mkl

Upload rstudio-mkl.sh to your home folder

End of first-time setup

  • Previous steps only necessary once

Using RStudio

Select Interactive Apps > Advanced Desktop

Setup

Setup

  • Number of hours: estimate how long you’re going to use this session. How long is the code going to run? Guess, then round up
  • Remember: files will be stored persistently in your home folder
  • Number of nodes: 1
  • Number of taks per node: 1
  • Number of cores per task: 4
  • Memory per core: 8. If you get memory errors, increase
  • Then choose Submission environment: Source setup file
  • Write /home/[YOUR USERNAME]/rstudio-mkl.sh. For me, this is /home/peruzzi/rstudio-mkl.sh

Setup

Launch and wait for the session to start

Launch and wait for the session to start

Initiate VNC session to the remote Desktop

Start a terminal and run rstudio

Start a terminal and run rstudio

We’re in!

sessionInfo() to check that we are using Intel MKL

Without Intel MKL:

With Intel MKL:

Open source software comment

  • Intel MKL is closed source
  • OpenBLAS is an open source alternative
  • OpenBLAS is almost as fast as Intel MKL
  • If you feel strongly about open source software, use rstudio-openblas.sh as follows:
#!/bin/bash
module load RStudio
module unload R
module load Ropenblas

Tip for students with Apple computers and M-series CPUs

cd /Library/Frameworks/R.framework/Resources/lib
ln -sf libRblas.vecLib.dylib libRblas.dylib

Before/after: