Current SBATCH options

The "sbatch" command receives its parameters from the command line but also allows their definition via "directives" #SBATCH in the form of a comment in the header of the file. Both methods produce the same result but those declared on the command line will have priority in case of conflict. In both cases, these options exist (for the most part) in short and long version (example: -n or --ntasks).

For more information on "sbatch", see the official documentation at : https://slurm.schedmd.com/sbatch.html

 

#SBATCH --partition=<part> Choosing the partition to use for the job
#SBATCH --job-name=<name> Defines the job name as it will be displayed in the different Slurm commands (squeue, sstat, sacct)
#SBATCH --output=<stdOutFile> The standard output (stdOut) will be redirected to the file defined by "--output" or, if not defined, a default file "slurm-% j.out" (Slurm will replace "% j" with the JobID).
#SBATCH --error=<stdErrFile> The error output (stdErr) will be redirected to the file defined by "--error" or, if not defined, to standard output.
#SBATCH --input=<stdInFile> Standard input can also be redirected with "--input". By default, "/dev/null" is used (none / empty).
#SBATCH --open-mode=<append|truncate> The option "--open-mode" defines how to open (write) files and behaves like an open / fopen of most programming languages (2 possibilities: "append" to write after the file (if it exists) and "truncate" to overwrite the file each time the batch is executed (default value).

#SBATCH --mail-user=<e-mail>

#SBATCH --mail-type=<BEGIN|END|FAIL|TIME_LIMIT|TIME_LIMIT_50|...>

Allows to be notified by e-mail of a particular event in the life of the job: start of the execution (BEGIN), end of execution (END, FAIL and TIME_LIMIT) ... Consult the documentation Slurm for the list complete events supported.
#SBATCH --cpus-per-task=<n> Sets the number of CPUs to allocate by Task. The actual use of these CPUs is the responsibility of each Task (creation of processes and / or threads).
#SBATCH --ntasks=<n> Defines the maximum number of Tasks executed in parallel.
#SBATCH --mem-per-cpu=<n>
Sets the RAM in MB allocated to each CPU. By default, 4096 MB is allocated to each CPU, the use of this variable allows to specify a specific RAM size, less than or equal to 7800 MB (maximum allocable per CPU)
#SBATCH --nodes=<minnodes[-maxnodes]> Minimum number [-max] of nodes on which to distribute the Tasks.
#SBATCH --ntasks-per-node=<n> Used in conjunction with --nodes, this option is an alternative to --ntasks that allows you to control the distribution of Tasks on different nodes.