Interactive vs. Batch Job

SLURM (Simple Linux Utility for Resource Management) is a workload manager used for managing and scheduling jobs on high-performance computing (HPC) systems. Jobs submitted to SLURM can be categorized into two main types: interactive jobs and batch jobs.

 

Interactive Jobs

Interactive jobs are designed for users who need to run commands or scripts in a live session. These jobs allow users to access a compute node directly and interact with the system in real time. To start an interactive job, you typically use the srun command with the --pty option. This allocates resources and provides a shell session on a compute node where you can execute commands, test scripts, or perform debugging.

Example command: srun --pty bash

Interactive jobs are useful for tasks that require user input or immediate feedback, such as developing and testing software, debugging code, or exploring data.

Batch Jobs

Batch jobs, however, are designed for running long-term, automated tasks that do not require user interaction once started. These jobs are submitted to SLURM using the sbatch command, along with a script specifying the resources needed, job parameters, and the commands to execute. SLURM schedules the batch job to run according to resource availability and job priority.

Example command: sbatch job_script.sh

Batch jobs are suitable for tasks like data processing, simulations, and running complex calculations that can be executed without user intervention. The job script allows you to specify resource requirements such as CPU time, memory, and node count, and SLURM manages the execution based on the specified requirements and scheduling policies.

Center for Computational Sciences