Interactive Jobs
Overview¶
Interactive jobs allow users to directly access a compute node in real time — as if you were working on your personal computer, but with the power of HPC behind it.
Unlike batch jobs, which are queued and run in the background, interactive jobs open a live terminal session on a compute node. This is useful for:
- Testing code or software modules
- Debugging runtime issues
- Running Jupyter notebooks
- Exploring the system environment or dependencies
You still need to request resources via Slurm, but instead of submitting a script with sbatch, you request an interactive shell using our interactive command.
The interactive Command¶
We provide a built-in shortcut command, interactive, that allows you to quickly and easily request a session in compute node.
The interactive command acts as a convenient wrapper for Slurm’s salloc command. Similar to sbatch, which is used for batch jobs, salloc is specifically designed for interactive jobs.
Replace $PI_UCID with PI's NJIT UCID.
Now, once you get the confirmation of job allocation, you will be assigned to a compute node.
Customizing Your Resources¶
Please note that, by default, this interactive session will request 1 core (for CPU jobs), 1 GPU (for GPU jobs), with a 1-hour walltime. To customize the resources, use the -h option for help. Run interactive -h for more details. Here is an explanation of each flag given below.
| Flag | Explanation | Example |
|---|---|---|
-a |
Mandatory option. This is followed by your group's name. Use quota_info to check the account/group name. |
-a $PI_UCID |
-q |
Mandatory option. Used to access the priority | -q standard |
-j |
Mandatory option. Specify whether you want CPU or GPU node. | -j cpu |
-n |
Optional. The total number of CPUs. Default is 1 core unless specified. | -n 1 |
-t |
Optional. The amount of walltime to reserve for your job in hours. Default is 1 hour unless specified. | -t 1 |
-g |
Optional. The total number of GPUs. Default is 1 GPU unless specified. | -g 1 |
-p |
Optional. Specify the name of the partition. (Default: general for CPU jobs, gpu for GPU jobs). |
-p debug |
Warning
Login nodes are not designed for running computationally intensive jobs. You can use the head node to edit and manage your files, or to run small-scale interactive jobs. The CPU usage is limited per user on the head node. Therefore, for serious computing either submit the job using sbatch command or start an interactive session on the compute node.
Note
Please note that if you are using GPUs, check whether your script is parallelized. If your script is not parallelized and only depends on GPU, then you don't need to request more cores per node. In that case, do not use -n while executing the interactive command, as the default option will request 1 CPU per GPU. It's important to keep in mind that using multiple cores on GPU nodes may result in unnecessary CPU hour charges. Additionally, implementing this practice can make service unit accounting significantly easier.