Note: Interactive jobs let you run commands directly on a compute node, useful for testing, debugging, or running short tasks.
What Interactive Jobs Do
Instead of submitting a batch script, interactive jobs give you a live shell on a compute node. This lets you try commands, load modules, and run programs in real time.
Starting an Interactive Job
Use the srun
command with --pty bash
to open an interactive session:
srun -p queue_name --pty bash
Replace queue_name
with the partition you want (e.g., short-40core
, gpu
).
You can also request resources, for example:
srun -p short-40core -N 1 -n 40 --time=01:00:00 --pty bash
This starts an interactive job on one node with 40 cores and a 1-hour limit.
Tips and Notes
- Always request only the resources you need.
- Interactive jobs are best for testing or short runs. Use batch scripts for long jobs.
- When finished, type
exit
to leave the interactive session and free resources.