Introduction to Batch Jobs¶
You may also be interested in:
- Standard Practices - important policies, recommendations, and helpful tips
- Compute Resources - details on the number and type of compute nodes
- Resource Optimization - improve the efficiency of your jobs on HPC
- Frequently Asked Questions - solutions to common issues
-
Details regarding various Slurm job configuration options
-
A list of relevant environment variables that get created during a job
-
How to submit many similar jobs with a single batch script
-
An overview of the GNU utility for parallelization of tasks
-
Split jobs into sections with conditions for completion
-
The basics of
sbatchand job submission
What are Batch Jobs?¶
Batch jobs differ from interactive jobs and graphical jobs because they do not require user input while running. Instead, the user writes a script containing the instructions (code) that is sent to a compute node via the scheduler (Slurm). This allows your workflow to run automatically without you needing to be physically present. Here are a few benefits of using batch jobs:
-
No Need to Stay Logged In: You don’t have to remain logged into the HPC system for your work to continue. This avoids potential issues like your terminal timing out, local internet disruptions, or your computer going to sleep—all of which could prematurely end your analysis, especially for long-running jobs.
-
Submit Many Jobs at Once: Some workflows require running hundreds or thousands of analyses. For example, you might want to run the same script with different input values multiple times. Doing this interactively could be cumbersome or even impossible. Batch jobs can easily handle this use case.
Batch Job Workflow and Analogy¶
Think of a batch job like a researcher who wants something custom-made at a factory. There are a few steps they need to take:
- Get the Address: First, they need to know where the factory is so they can contact the right person to make their request.
- Provide Instructions: Next, they need to write instructions, or schematics, for the person who will do the manufacturing.
- Send the Instructions: Finally, they need to send these instructions to the factory so the builder can receive them and start working.

We'll continue with this analogy, breaking down each step in more detail in the Batch Tutorial.