Interactive vs. Batch Job

Interactive vs. Batch Job

SLURM (Simple Linux Utility for Resource Management) is the workload manager used to schedule and manage jobs on the cluster. Jobs submitted to SLURM generally fall into two categories: interactive jobs and batch jobs.


Interactive Jobs

Interactive jobs allow users to run commands in a live session on a compute node. This is useful when developing or testing software, debugging code, or exploring data interactively.

To start an interactive session, use the srun command with the --pty option.

Example:

srun --pty bash

This command allocates resources and starts a shell on a compute node where commands can be executed interactively.

Interactive jobs are useful for:

  • testing scripts

  • debugging software

  • running commands that require user input


Batch Jobs

Batch jobs are designed for automated workloads that run without user interaction. These jobs are submitted to SLURM using the sbatch command along with a job script that specifies the required resources and commands to execute.

Example:

sbatch job_script.sh

The job script defines parameters such as:

  • CPU count

  • memory requirements

  • runtime limits

  • number of nodes

SLURM schedules the job according to resource availability and system priority policies.

Batch jobs are typically used for:

  • data processing

  • simulations

  • long-running scientific computations

Center for Computational Sciences