32

I am using slurm on a cluster to run jobs and submit a script that looks like below with sbatch:

#!/usr/bin/env bash

#SBATCH -o slurm.sh.out
#SBATCH -p defq
#SBATCH --mail-type=ALL
#SBATCH --mail-user=my.email@something.com

echo "hello"

Can I somehow comment out a #SBATCH line, e.g. the #SBATCH --mail-user=my.email@something.com in this script? Since the slurm instructions are bash comments themselves I would not know how to achieve this.

user1981275
  • 13,002
  • 8
  • 72
  • 101
  • 2
    I\`m quite sure that `sbatch` treats `#SBATCH` as a single token, so inserting a space between `#` and `SBATCH` can help. – hidefromkgb Oct 31 '16 at 18:03

1 Answers1

43

just add another # at the beginning.

##SBATCH --mail-user...

This will not be processed by Slurm

Carles Fenoy
  • 4,740
  • 1
  • 26
  • 27