Skip to content

Farm Interactive Use

Jeffrey Ross-Ibarra edited this page Apr 1, 2024 · 3 revisions

In scientific computing, we usually need to work interactively. Normally we interact with SLURM by submitting batch scripts with sbatch. To work with the cluster interactively, we need to use srun. As these jobs may often take some time, it is usually recommended to run them from within a screen login.

Workflow: Using a bigmem Machine for an Interactive R Session

First, calculate how much memory you need in megabytes. 1 gigabyte is 1024 megabytes. You can also use Google, i.e. 16GB in megabytes.

The best approach is to use the implementation of R Studio available on Farm here

Alternatively, you can launch bash which will give you a shell, from which you can launch R.

$ ssh -X farm
$ srun -p bigmemh -t 2:00:00 --mem 16384 --pty bash  
$ module load R  
$ R  

This will open up an R session directly on your local machine, and from there you can work with it interactively.

A very important bit of advice: remember to save and close your R sessions, as a network interruption will lead to a loss of your connection and data. Be sure to maintain your work in a script locally too. Also, when you're done, always close your R session. If not, SLURM will assume you are still using the session and its resources will held from other users.

Workflow: Using bigmemh to Work Interactively with Bash

If you need to use samtools or other programs to interactively inspect data, you'll need to use a similar approach to above. To do this, launch:

$ ssh -X farm
$ srun -p bigmemh -t 2:00:00 --mem 16384 --pty bash

Then, you can work with bash directly. Remember, close your bash session (exit) after you are done!

Clone this wiki locally