Basic Slurm compute batch job
Here you will find a basic example job script for the Slurm batch system and further links for using the system.
Batch scripts are files that contain the definition of required hardware resources (see #SBATCH
lines) and the code you wish to run on an HPC node.
These batch scripts are submitted to Slurm using a unix console with the command sbatch
. Using the console is required to submit batch scripts using sbatch
.
Basic MPI job script
#!/usr/bin/zsh
### Start of Slurm SBATCH definitions
# ask for eight tasks
#SBATCH --ntasks=8
# Ask for less than 4 GB memory per (cpu) task=MPI rank
#SBATCH --mem-per-cpu=3900M
# Name the job
#SBATCH --job-name=MPI_JOB
# Declare file where the STDOUT/STDERR outputs will be written
#SBATCH --output=output.%J.txt
### end of Slurm SBATCH definitions
### beginning of executable commands
### your program goes here (a.out is an example)
$MPIEXEC $FLAGS_MPI_BATCH ./a.out
Basic Slurm doumentation on hpc-wiki.info:
- What is a scheduler anyways and why should I bother using one?
- For basic documentation on Slurm please look here or at the official docs.
- Submit Jobs
- Write a job script
- Jobscript examples