The Unix Shell

Writing scripts to submit jobs to the cluster

Overview

Teaching: 15 min
Exercises: 0 min
Questions
  • How do I write scripts to submit to the cluster?

Objectives
  • Learn about the standard headers needed for scripting jobs on the cluster.

Ok, we’ve seen how to submit jobs to the cluster using qsub, but what if we want to avoid typing out all of the arguments every time we submit.

We can modify our scripts with additional headers which will take the place of the command line arguments we were using with qsub.

old_script.sh:

#!/bin/bash
# [your commands below this line]

new_script.qsub

#!/bin/bash
#PBS -l nodes=1:ppn=2
#PBS -l walltime=2:00:00
#PBS -q short
# [your commands below this line]

Exercise

Modify the scripts you’ve previously submitted to use the headers we’ve learned about, save them as *.qsub instead of *.sh files, and then submit them to the cluster.

Key Points