Running jobs: Difference between revisions

Jump to navigation Jump to search
no edit summary
(Marked this version for translation)
No edit summary
Line 85: Line 85:
<!--T:64-->
<!--T:64-->
By default the output is placed in a file named "slurm-", suffixed with the job ID number and ".out", ''e.g.'' <code>slurm-123456.out</code>, in the directory from which the job was submitted.
By default the output is placed in a file named "slurm-", suffixed with the job ID number and ".out", ''e.g.'' <code>slurm-123456.out</code>, in the directory from which the job was submitted.
You can use <code>--output</code> to specify a different name or location.
Having the job ID as part of the file name is convenient for troubleshooting.
Certain replacement symbols can be used in the filename, ''e.g.'' <code>%j</code> will be replaced
by the job ID number. See [https://slurm.schedmd.com/sbatch.html sbatch] for a complete list.


<!--T:65-->
A different name or location can be specified if your workflow requires it by using the <code>--output</code> directive.
The following sample script sets a ''job name'' (which appears in <code>squeue</code> output) and sends the output to a file with a name constructed from the job name (%x) and the job ID number (%j).  
Certain replacement symbols can be used in a filename specified this way, such as the job ID number, the job name, or the [[Job arrays|job array]] task ID.
 
See the [https://slurm.schedmd.com/sbatch.html vendor documentation on sbatch] for a complete list of replacement symbols and some examples of their use.
<!--T:15-->
{{File
  |name=name_output.sh
  |lang="sh"
  |contents=
#!/bin/bash
#SBATCH --account=def-someuser
#SBATCH --time=00:01:00
#SBATCH --job-name=test
#SBATCH --output=%x-%j.out
echo 'Hello, world!'
}}


<!--T:16-->
<!--T:16-->
Bureaucrats, cc_docs_admin, cc_staff
2,773

edits

Navigation menu