Skip to content

Slurm Job Email Notifications

Availability: Email notifications for Slurm jobs will be available on the ORFEO HPC cluster starting December 1, 2026.

Slurm can send you an email when your job starts, finishes, fails, or reaches its time limit. This feature is available on the ORFEO HPC cluster and is useful when running long jobs without continuously checking their status.

Email notifications are optional: you must enable them when submitting a job.

1. Enable notifications in your job script

Add the following lines to your Slurm batch script, replacing the example email address with your own:

#SBATCH --mail-user=your.name@example.com
#SBATCH --mail-type=END,FAIL
  • --mail-user specifies the email address that will receive notifications.
  • --mail-type specifies which job events should trigger a notification.

2. Example batch script

#!/bin/bash
#SBATCH --job-name=my_analysis
#SBATCH --partition=EPYC
#SBATCH --time=01:00:00
#SBATCH --mail-user=your.name@example.com
#SBATCH --mail-type=BEGIN,END,FAIL,TIME_LIMIT

python3 my_analysis.py

Submit the job as usual:

sbatch job.sh

With this configuration, Slurm will notify you when the job starts, ends, fails, or reaches its time limit.

3. Available notification events

Event When you receive an email
BEGIN The job starts running.
END The job finishes, whether successfully or unsuccessfully.
FAIL The job terminates with a failure status.
TIME_LIMIT The job reaches its allocated time limit.
TIME_LIMIT_90 The job reaches 90% of its time limit.
ARRAY_TASKS When used with other notification events, sends emails for each individual task in a job array instead of only for the array as a whole.
ALL Enables the standard Slurm job notification events. For more precise control, select individual events instead.
NONE Disables email notifications.

You can combine multiple events by separating them with commas, for example:

#SBATCH --mail-type=BEGIN,END,FAIL,TIME_LIMIT

Job arrays: By default, BEGIN, END, and FAIL notifications apply to the job array as a whole. To receive notifications for each individual array task, add ARRAY_TASKS to --mail-type:

#SBATCH --array=1-3
#SBATCH --mail-type=BEGIN,END,FAIL,ARRAY_TASKS

This may generate many emails for large job arrays. ARRAY_TASKS is used together with the events you want to monitor; it is not a notification event by itself.

Note: A job can trigger more than one selected event. For example, a failed job may generate both an END and a FAIL notification.

4. Enable notifications when submitting a job

You can also specify the options directly in the sbatch command without editing your script:

sbatch --mail-user=your.name@example.com --mail-type=END,FAIL job.sh

Options supplied on the command line take precedence over the corresponding #SBATCH settings in the script.

5. What will the email contain?

Notifications are sent by the ORFEO Slurm mail service, using slurm@areasciencepark.it as the sender.

Messages help identify the job and the event that triggered the email. For jobs that complete successfully, the ORFEO completion notification may also include a summary of job execution and resource usage.

6. Notes and troubleshooting

  • No email received? Check that you used a valid email address and look in your spam or junk folder.
  • No notifications by default: If --mail-type is not specified, Slurm does not send job-event emails.

For the full list of options, see the official Slurm sbatch documentation.