2.2 Run Interactive Jobs - bu-rcs/SA-Biostatistics GitHub Wiki
For small jobs that take less than 15 minutes of CPU time, you can directly load the module and launch the software:
[aaa@scc4 ~]$ module load R
[aaa@scc4 ~]$ R
R version 4.0.5 (2021-03-31) -- "Shake and Throw"
Copyright (C) 2021 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
>
For larger job that takes more than 15 minutes of CPU time, you can first request an interactive batch session and then launch the software within the session.
[aaa@scc4 ~]$ qsh –l h_rt=24:00:00
Your job 5274760 ("INTERACTIVE") has been submitted
waiting for interactive job to be scheduled .....
Your interactive job 5274760 has been successfully scheduled.
New window comes up after a little while.
[aaa@scc4 ~]$ qrsh –l h_rt=24:00:00
To exit the interactive session, type exit.
The difference of qsh and qrsh is that qsh will have a new window pops up while qrsh allows you to work on the current window.
You can either request an interactive batch session for specific software, like Rstudio server. Or you can request an interactive batch session for Desktop, which gives you a desktop environment to work with.
You can run the following code in linux environment to recover some recent R code that you ran using Rstudio (either by launching Rstudio using OnDemand or using Rstudio module):
[aaa@scc4 ~]$ cat .local/share/rstudio/history_database
Ref: https://www.bu.edu/tech/support/research/system-usage/running-jobs/interactive-jobs/