Submit Your First Job¶
This guide walks you through submitting your first job to the cluster.
Step 1: Find Your Account¶
Every job is charged to an account you belong to, and SLURM rejects jobs that do not name a valid one. List the accounts available to you:
sacctmgr show assoc user=$USER format=account%20,partition,qos
Important
If you omit --account, submission fails with:
sbatch: error: Batch job submission failed: Invalid account or account/partition combination specified
If the command above returns nothing, you do not have a cluster association yet - contact the ARC Helpdesk at help@hpc.msstate.edu.
Step 2: Create a Job Script¶
Create a file called hello.sh. Replace your_account with an account from Step 1.
For the full list of partitions and the QoS each one allows, see Clusters.
#!/bin/bash
#SBATCH --job-name=hello
#SBATCH --account=<your_account>
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=1
#SBATCH --time=00:10:00
#SBATCH --output=hello.out
# Load any required modules
module purge
module load python
# Your command here
echo "Hello from the HPC cluster!"
python --version
Step 3: Submit the Job¶
Replace <your_account> with your project account or your fund number (MSU)
:
sbatch hello.sh
You’ll see output like:
Submitted batch job 12345
Step 4: Check Job Status¶
# Check if your job is running
squeue -u $USER
# Check if it's completed
sacct -j <jobid>
Step 5: View Output¶
# View the output file
cat hello.out
Next Steps¶
Using SLURM - Learn about SLURM directives
Troubleshooting - What to do if your job fails