This is an old revision of the document!


Running jobs

In order to submit an already created job script, the command sbatch has to be used. The simplest invocation of sbatch is:

sbatch jobscript

This will submit the file named jobscript, containing the #SBATCH parameters and the commands to run, to the system for execution.
It is also possible to give extra arguments to sbatch. For instance, if you want to send the job to a specific partition without having to edit your job script, this can also be done from the command-line using the same kind of options as shown before:

sbatch --partition=gpu jobscript

Note that if you have options defined in your job script and as sbatch command-line arguments, the latter ones will override the values in the job script. So the last example will always send the job to the “short” partition, regardless of what you may have defined in the job script itself. For more detailed (and complete) examples, please look at the Examples/templates section.

Jobs will always start in the same directory as from which they were submitted. Furthermore, your complete environment during job submission will be stored and transferred to the job; this includes all loaded modules. The latter can be modified by using the --export option in your job script:

#SBATCH --export=var1,var2,...,varN

It takes a list of names of environment variables that should be transferred to the job. Special values that can be given are ALL (default) and NONE. By using the latter, the job will start with a clean/empty environment.