Overview
Interactive jobs let you run commands directly on a compute node โ useful for testing, debugging, or running short tasks. They provide a live shell rather than a batch script submission. (They're unsuitable for full-scale MPI benchmarking because of performance variability.)
Basic command
srun -p queue_name --pty bash
Replace queue_name with your desired partition (e.g. short-40core, gpu).
Examples
Standard session:
srun -p short-40core --pty bash
Full node with time limit:
srun -p short-40core -N 1 -n 40 --time=01:00:00 --pty bash
Shared partition with memory specification:
srun -p short-40core-shared -N 1 -n 10 --mem=32GB --time=02:00:00 --pty bash
GPU access:
srun -p a100 --gres=gpu:1 --time=01:00:00 --pty bash
Common options
| Option | Purpose | Example |
|---|---|---|
-p | Partition/queue | -p short-40core |
-N | Number of nodes | -N 1 |
-n | Number of tasks | -n 20 |
-c | Cores per task | -c 2 |
--mem | Memory per node | --mem=64GB |
--time | Time limit | --time=02:00:00 |
--gres | Generic resources | --gres=gpu:1 |
--pty bash | Interactive shell | Required at command end |
During the session
Load software, compile code, run programs, and test MPI/OpenMP behavior. Exit with exit to release the resources.
Best practices
- Request only the resources you need
- Set appropriate time limits with
--time - Use interactive jobs primarily for testing and debugging
- Exit sessions when finished to prevent resource waste
Applies to