Note: SLURM jobs are submitted with sbatch
using a script, or run interactively with srun
. Below are a few simple examples.
Example 1: Hello World Script
Create a file called hello.slurm
:
#!/bin/bash #SBATCH -p short-40core #SBATCH -N 1 #SBATCH -n 1 #SBATCH -t 00:05:00 #SBATCH -o hello.out echo "Hello from SeaWulf!"
Submit the job:
sbatch hello.slurm
Example 2: Run Python
Create python_job.slurm
:
#!/bin/bash #SBATCH -p short-40core #SBATCH -N 1 #SBATCH -n 1 #SBATCH -t 00:10:00 #SBATCH -o python.out module load anaconda/3 python -c "print('Hello from Python on SeaWulf')"
Submit with:
sbatch python_job.slurm
Example 3: Interactive Test
For quick experiments, use an interactive job:
srun -p short-40core -N 1 -n 1 --time=00:30:00 --pty bash
This gives you a shell on a compute node to run commands directly.
Tips
- Always include
#SBATCH
lines for partition, nodes, tasks, time, and output. - Check your output files (
.out
) for results. - Use interactive jobs for testing, batch jobs for longer runs.