Section outline

  • The classic first job is a one-line script that prints the hostname of whatever node it lands on:

    #!/bin/bash
    echo -n "This script is running on "
    hostname

    Save it as example-job.sh, mark it executable (chmod +x), then submit with sbatch. On Saga the minimum required flags are --account, --time, --mem:

    sbatch --account=nn9970k --mem=1G --time=01:00 example-job.sh

    Check what's queued or running with squeue -u $USER. To watch it refresh: squeue -u $USER --iterate 5 (Ctrl-C to stop).

    Mandatory flags differ per cluster — Betzy also needs --nodes and a partition. The job script generator is the quickest way to get a working starter for each cluster.

    Read the canonical section →

    • Submitting, queueing, finding the output.