An interactive job gives you a live shell on a compute node, so you can test commands, debug code, compile, or try out software with real resources behind you. It's the right place for anything too heavy for the login node but not yet ready to become a batch job.

On this page: Start a session ยท Examples ยท Options ยท During the session ยท Graphical programs ยท Troubleshooting

Start a session

  1. Log in to milan.seawulf.stonybrook.edu and load Slurm:
    module load slurm
  2. Ask for a shell on a compute node. Replace short-40core with the queue you want:
    srun -p short-40core --time=01:00:00 --pty bash
  3. Wait for the prompt to change to a compute node name (for example [netid@dn045 ~]$). You're now on your own node.
  4. When you're done, type exit to give the node back.

Examples

# A quick session on a whole 40-core node for an hour
srun -p short-40core -N 1 -n 40 --time=01:00:00 --pty bash

# Part of a node: 10 cores and 32 GB on a shared queue (starts sooner for small work)
srun -p short-40core-shared -N 1 -n 10 --mem=32GB --time=02:00:00 --pty bash

# One A100 GPU for an hour
srun -p a100 --gres=gpu:1 --time=01:00:00 --pty bash

# A short test in the debug queue
srun -p debug-40core --time=00:30:00 --pty bash

Common options

OptionWhat it setsExample
-pQueue-p short-40core
-NNumber of nodes-N 1
-nNumber of tasks-n 20
-cCores per task-c 2
--memMemory per node (needed on shared queues)--mem=64GB
--timeHow long you need it--time=02:00:00
--gresGPUs--gres=gpu:1
--pty bashGives you the interactive shell. Always put it last.

Not sure which queue? See the queue selection guide.

During the session

  • Load modules, compile, run and test programs, and check how your code behaves with MPI or OpenMP.
  • Everything you had on the login node is here too: home, scratch, and project folders are the same on every node.
  • Interactive sessions aren't good for timing benchmarks at scale, because performance can vary. Use a batch job for that.
  • If your connection drops, the session ends. For long work, write a job script instead.

Graphical programs

To open program windows from a compute node, connect to SeaWulf with ssh -X, get an allocation with salloc, then SSH to the node you were given, again with -X:

module load slurm
salloc -N 1 -p short-40core --time=01:00:00
ssh -X $SLURM_NODELIST

Run your program as usual from there, and type exit twice when done (once to leave the node, once to end the allocation). For a smoother experience, use a WolfieHPCDesktop session in Open OnDemand. See X11 forwarding.

Troubleshooting

The command just waits with "job has been allocated resources" never appearing

The queue is busy. Ask for less (fewer cores, less time), try a shared queue, or check how busy it is with sinfo -p <queue>. Press Ctrl+C to give up waiting.

"srun: command not found"

Run module load slurm first.

"invalid partition specified"

That queue isn't reachable from the login node you're on. See Which SeaWulf login node?

My session ended unexpectedly

It probably reached its time limit or your connection dropped. Ask for a longer --time, and consider a batch job for anything that runs for hours.

Good habits

  • Ask only for what you need, and set a realistic --time.
  • Use interactive sessions for testing and debugging, then move real runs to batch jobs.
  • Always exit when you're finished so the node goes back to others.
Applies to All clusters