Submitting a job with sbatch

You will be using the sbatch command to submit jobs to the ACTnowHPC system.  The basic syntax is sbatch followed by the script file.

$ sbatch job-script.sh 

Anatomy of a job submission script

A job submission script is a simple shells script file that lists the commands you want run.  There can be a bunch of comments at the top of the file which gives directives to the scheduler.  These all start with the syntax #SBATCH. While this would normally be a comment in a shell script, it's the equivalent of specifying the argument on the command line.

Example arguments

#!/bin/bash
 
#SBATCH --job-name=MyJob
#SBATCH --time=00:10:00
#SBATCH --partition=hsw-fdr
 
/path/to/some/binary

In the example above, our job's name is "MyJob", it will run for 10 minutes in the hsw-fdr partition.

Common arguments for the sbatch command

Argument Default Description
--partition=XXXX hsw-fdr The name of the partition to run this job in. Make sure you are running in the correct partition. More information about partitions in Running jobs section.
--time=HH:MM:SS 00:05:00 The time to allocate for your job. If you exceed this time limit your job will be killed. The default is 5 minutes.
--mem-per-cpu=XG 3GB If not specified you will get 3GB of RAM allocated per each task. If you need more, you can specify a larger value here.
--job-name=XXXXX sbatch A descriptive name for your job. This is a useful label for you when looking through the accounting logs or squeue output.
--output=XXXX slurm-%j.out The filename to write stdout and stderr to. The variable %j will be replaced with the name of the job.
--account=XXXX none A text field to store with the job. This is often used to classify jobs by project, group, billing account, etc. You are free to put anything you want in this field.