This guide takes you from a brand-new account to your first finished job on SeaWulf in about 30 minutes. You'll connect, load software, write a tiny job script, submit it, and read the result.
On this page: Before you start ยท 1. Connect ยท 2. Load software ยท 3. Your first job ยท 4. Watch it run ยท What next ยท If something goes wrong
Before you start
- A SeaWulf account. Accounts sit under a project led by a Stony Brook faculty member. See Requesting accounts & project numbers.
- Duo set up on your phone. Every login asks for it. See Duo authentication.
1. Connect
The easiest start is Open OnDemand in your browser at sn-ood.seawulf.stonybrook.edu. Sign in with your NetID, approve Duo, then open the SeaWulf Cluster Shell Access app for a terminal. See the OnDemand overview.
Prefer a terminal on your own computer? Use SSH:
ssh <netid>@milan.seawulf.stonybrook.edu
Windows users can use MobaXterm or the built-in Windows Terminal. Connecting to the cluster has step-by-step instructions and explains which login address to use.
2. Load software
Software on SeaWulf comes as modules that you load when you need them. Start by loading Slurm, the job scheduler, which you'll need in every session:
module load slurm # job commands: sbatch, squeue, scancel module avail # see what software is available module load gcc/12.3.0 # load a specific package and version module list # check what's loaded
More in Using modules and the software catalog.
3. Your first job
- Make a folder for it.
mkdir ~/my_first_job && cd ~/my_first_job
- Create a job script called
hello.slurm. Open an editor withnano hello.slurm, paste this in, then save with Ctrl+O and exit with Ctrl+X:#!/bin/bash #SBATCH --job-name=hello_world #SBATCH --partition=short-40core-shared # a small, shared queue #SBATCH --nodes=1 #SBATCH --ntasks=1 #SBATCH --mem=1G #SBATCH --time=00:05:00 # 5 minutes is plenty #SBATCH --output=hello_%j.out # %j becomes the job ID #SBATCH --error=hello_%j.err echo "Hello from SeaWulf!" echo "Job ID: $SLURM_JOB_ID" echo "Running on node: $(hostname)" echo "Date and time: $(date)"
- Submit it.
sbatch hello.slurm
Slurm replies with something likeSubmitted batch job 12345. That number is your job ID. - Read the result once it finishes (use your own job ID):
cat hello_12345.out
4. Watch it run
squeue -u $USER
The ST column shows where your job is:
| State | Meaning |
|---|---|
PD Pending | Waiting in the queue for resources |
R Running | Running now |
CG Completing | Finishing up |
When the job disappears from squeue, it's done. Check how it went with sacct -j <jobid>.
What next
- Writing job scripts: the full template and every common option.
- Queue selection guide: pick the right queue for your job size and length.
- Interactive jobs: a live shell on a compute node for testing.
- File transfer: get your data onto the cluster.
- Job script builder: answer a few questions and get a script.
- HPC cheat sheet: the commands you'll use every day, on one page.
If something goes wrong
"sbatch: command not found"
Load Slurm first with module load slurm.
My job stays in PD (pending) for a long time
The queue may be busy, or you may have asked for more than the queue allows. Check the reason in the last column of squeue -u $USER, try a smaller request, or test your script without running it:
sbatch --test-only hello.slurm
"invalid partition specified"
Each set of login nodes reaches different queues. The queues in this guide run from milan.seawulf.stonybrook.edu. See Which SeaWulf login node?
I can't log in
Repeated failed logins can block your address or lock your Duo. See login troubleshooting and Duo troubleshooting.
A graphical program won't open
Connect with ssh -X, or use WolfieHPCDesktop in Open OnDemand. See X11 forwarding.
Still stuck? When to ask for help explains how to reach HPC support and virtual office hours.