From d5cd39902366a8de1666849e1e923a604aca4d97 Mon Sep 17 00:00:00 2001 From: comeani Date: Mon, 6 Nov 2023 15:10:50 -0500 Subject: [PATCH] content for SLURM > interactive-jobs --- docs/slurm/interactive-jobs.md | 105 ++++++++++++++++++++++++++++++++- 1 file changed, 104 insertions(+), 1 deletion(-) diff --git a/docs/slurm/interactive-jobs.md b/docs/slurm/interactive-jobs.md index f6f4e96..8adaa22 100644 --- a/docs/slurm/interactive-jobs.md +++ b/docs/slurm/interactive-jobs.md @@ -1 +1,104 @@ -# Interactive Jobs \ No newline at end of file +# Interactive Jobs + +Often times it is prudent to test that a smaller version of your slurm job works correctly before submitting +the whole thing and to be able to debug your code more interactively. + +You may also want to perform benchmarking or work through a tutorial for new software, but without disrupting +the experience of other users by +running resource intensive commands on the login node.

+ +Interactive jobs can be used to create an instance for this kind of work on a compute node. + +## Submitting an Interactive Job +Submitting an interactive job is similar to submitting a batch job, except you use the +srun command instead of sbatch. For example: + +```commandline +srun -n1 -t02:00:00 --pty bash +``` + +Will prompt the scheduler to start a job on a cluster node with 1 `task` (or `core`, -n1) for 2 hours wall clock +time (-t02:00:00), and in terminal mode. + +When the interactive job starts, you will notice that you are no longer on a login node, but rather one of the +compute nodes. + +```commandline +[fangping@login0a ~]$ srun -n1 -t02:00:00 --pty bash +[fangping@n409 ~]$ +``` + +Interactive jobs draw service units from the slurm allocation that your CRC user is associated with. + +!!! note + + If your user account is associated with multiple PI compute resource allocations, you can specify which one your + interactive session will charge with the '-A' or '--account' arguments, followed by the group name. To check which + account your user charges by default, use the command `sacctmgr show assoc onlydefaults | grep USERNAME` + Where USERNAME is your username. + +## Interactive jobs with x11 forwarding + +If you would like to run an application that has a GUI interface, X11 forwarding is required. + +You should allocate a job to a node with your parameters, then SSH authenticated X11 session from the login node to +your interactive session on that compute node. You can follow the following steps: + +First, allocate a job +```commandline +salloc -n1 -t02:00:00 +salloc: Granted job allocation 874773 +salloc: Waiting for resource configuration +salloc: Nodes htc-n1 are ready for job +``` +Then use ssh to connect to the node that is ready for you. +```commandline +ssh -X htc-n1 +``` + +Once in your interactive session you can load software that provide GUI with the module system and launch them from +the command line. + +## Open Ondemand + +We have implemented Open Ondemand to run common GUI tools, such as RStudio, +Jupyter NotebookD, Jupyter Lab and Matlab. This interface is often easier to use if you are unfamiliar with slurm and +submitting jobs via the command line. This is also the best method for launching an interactive session with a +GUI desktop. + +## Quality of Service +All jobs submitted to Slurm must be assigned a Quality of Service (QoS). QoS levels define resource +limitations. The default QoS is `normal`. + + + + + + + + + + + + + + + + + + + + + + + + + + +
Quality of ServiceMax WalltimePriority factor
short12:00:001.0
normal3-00:00:000.75
long6-00:00:000.5
+ + + +If your job does not meet these requirements it will be not be accepted