Skip to content

E-mail Notifications

The SLURM batch system allows you to receive e-mail notifications for various stages of your job's execution lifecycle. This feature is mostly helpful for notifying the user upon job completion and for displaying resource utilization information.

Notification-specific job parameters

Option Description
--mail-user=email_address E-mail address where the notification should be sent.
--mail-type=end Type of notification to be sent. In this example, upon completion.

See the man page for more information or type sbatch --help.

E-mail notification example

In this example we are running a two-node job, which should utilize all 128 cores. The notification relevant keywords are displayed in bold.


cat e-mail_job.sh
  #!/bin/bash
  #SBATCH -J "e-mail test"
  #SBATCH --partition=short  # Devana: short; Perun: cpu_short
  #SBATCH --nodes=2
  #SBATCH --ntasks-per-node=64
  #SBATCH -o %J.out 
  #SBATCH -e %J.err
  #SBATCH --mail-user=lukas.demovic@savba.sk
  #SBATCH --mail-type=end
  #SBATCH --exclusive

  module purge
  module load intel/2022a
  ulimit -s unlimited
  export OMP_NUM_THREADS=1

  mpirun /home/demovic/benchmark/hpl-2.3/bin/xhpl

sbatch e-mail_job.sh 
  sbatch: slurm_job_submit: Job's time limit was set to partition limit of 1440 minutes.
  Submitted batch job 41034

When the job was completed, the following e-mail was sent to the specified address:

Sender: no-reply@devana.nscc.sk
Subject: devana Slurm Job_id=41034 Name=e-mail test Ended, Run time 00:28:37, COMPLETED, ExitCode 0

Job ID: 41034
Cluster: devana
User/Group: demovic/demovic
State: COMPLETED (exit code 0)
Nodes: 2
Cores per node: 64
CPU Utilized: 2-12:15:39
CPU Efficiency: 98.71% of 2-13:02:56 core-walltime
Job Wall-clock time: 00:28:37
Memory Utilized: 512.92 GB (estimated maximum)
Memory Efficiency: 102.58% of 500.00 GB (3.91 GB/core)
Created by: Lukas Demovic, Marek Štekláč, Marek Štekláč