Background Job

Background Job

Long running and parallel jobs do not work with will interactive jobs. Instead run background jobs using the sbatch command. The sbatch command requires a shell script as an input file.

Create sbatch script

Create a text file named run-job.sh.

#!/bin/bash echo "Background Job"

Start the job

sbatch --account=<GroupName> run-job.sh

You should see output similar to the following:

Submitted batch job 293

The number above is the JobID Slurm created to run your script.

Check Running Job Queue

By default the squeue command shows all running jobs on the cluster. Run the following command to see only your jobs:

squeue -u $LOGNAME

Check Accounting Database

By default the sacct command shows the status of your jobs from the last 24 hours. Run the following command:

sacct

Check Job Log File

By default sbatch creates a log file within your current directory based on the JobID.

For example if your JobID was 293 you would run the following command.

cat slurm-293.out

Using the tail -f command you can follow the progress of a slurm log file. Example for JobID 293:

tail -f slurm-293.out

You will need to press Ctrl-C to terminate the tail -f command.

Check Job Efficiency (after completion)

Find information on a completed job’s efficiency with seff (usage: ‘seff <jobid>’).

 

Next: GPU Jobs