Interactive Jobs
How to start interactive sessions for testing, debugging, and GUI applications.
When to Use Interactive Jobs
Interactive sessions are useful for:
- Testing and debugging code before submitting batch jobs
- Running GUI applications that require a display
- Compiling code that needs significant resources
- Exploring data interactively
Production jobs should always use batch scripts. Interactive sessions are intended for short, hands-on work.
Using salloc
Request an interactive allocation using salloc:
salloc --ntasks=4 --nodes=1 --time=00:30:00
This allocates 4 cores on one node for 30 minutes. Once allocated, you'll have a shell on a compute node where you can run commands directly.
Common salloc Options
| Option | Description | Example |
|---|---|---|
| --ntasks=N | Number of CPU cores | --ntasks=4 |
| --nodes=1 | Keep all tasks on one node | --nodes=1 |
| --time=HH:MM:SS | Time limit | --time=00:30:00 |
| --mem=SIZE | Memory request | --mem=16G |
| --partition=NAME | Partition | --partition=gpu |
| --gres=gpu:TYPE:N | GPU request | --gres=gpu:a100:1 |
| --exclusive | Exclusive node access | --exclusive |
Examples
Basic interactive session
salloc --ntasks=1 --time=00:30:00
Multi-core session for testing parallel code
salloc --ntasks=8 --nodes=1 --time=01:00:00
Exclusive node for benchmarking
salloc --ntasks=1 --exclusive --time=00:30:00
Interactive GPU session
salloc --ntasks=1 --partition=gpu --gres=gpu:a100:1 --time=00:30:00
Interactive session with more memory
salloc --ntasks=1 --mem=64G --time=01:00:00
Open OnDemand
Open OnDemand provides a web-based interface for accessing the cluster, including:
- Terminal sessions in your browser
- Interactive applications (Jupyter, RStudio, MATLAB, etc.)
- File browsing and transfer
Open OnDemand is especially useful for GUI applications since it handles display forwarding automatically. See the Open OnDemand documentation for details.
GUI Applications with HPC-VCL
For applications requiring a full graphical desktop, use an HPC-VCL node:
Best Practices
- Keep sessions short: Interactive sessions consume resources even when idle. Request only the time you need.
- Use batch for production: Once your code is tested, convert to a batch script for production runs.
- Exit when done: Type exit to release your allocation when finished.
- Use short QOS: For sessions under 2 hours, use the short QOS for faster scheduling:
salloc --ntasks=1 --partition=compute_partners --qos=short --time=01:00:00
Idle interactive sessions may be terminated per the Acceptable Use Policy.