Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen Revision Vorhergehende Überarbeitung Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
hpc:scheduling:slurm_commands [2024/09/26 14:56] – | hpc:scheduling:slurm_commands [2024/10/25 15:03] (aktuell) – | ||
---|---|---|---|
Zeile 4: | Zeile 4: | ||
**srun** | **srun** | ||
- | This is the simplest way to run a job on a cluster. Initiate parallel job steps within a job or start an interactive job (with --pty). | + | |
+ | This is the simplest way to run a job on a cluster. | ||
+ | Initiate parallel job steps within a job or start an interactive job (with --pty). | ||
**salloc** | **salloc** | ||
- | Request interactive jobs/ | + | |
+ | Request interactive jobs/ | ||
+ | When the job is started a shell (or other program specified on the command line) it is started on the submission host (Frontend). | ||
+ | From this shell you should use srun to interactively start a parallel applications. | ||
+ | The allocation is released when the user exits the shell. | ||
**sbatch** | **sbatch** | ||
- | submit a batch script. The script will be executed on the first node of the allocation. The working directory coincides with the working directory of the sbatch directory. Within the script one or multiple srun commands can be used to create job steps and execute parallel applications. | ||
- | === Examples | + | Submit a batch script. |
+ | The script will be executed on the first node of the allocation. | ||
+ | The working directory coincides with the working directory of the sbatch directory. | ||
+ | Within the script one or multiple srun commands can be used to create job steps and execute parallel applications. | ||
+ | |||
+ | **Examples** | ||
< | < | ||
# General: | # General: | ||
- | sbatch --job-name=$jobname | + | sbatch --job-name=<name of job shown in squeue> |
# A start date/time can be set via the --begin parameter: | # A start date/time can be set via the --begin parameter: | ||
Zeile 22: | Zeile 32: | ||
--begin=now+60 (seconds by default) | --begin=now+60 (seconds by default) | ||
--begin=2010-01-20T12: | --begin=2010-01-20T12: | ||
+ | </ | ||
+ | |||
+ | A sbatch script of the command above would look like | ||
+ | < | ||
+ | #!/bin/bash | ||
+ | #SBATCH --job-name=< | ||
+ | #SBATCH -N <num nodes> | ||
+ | #SBATCH --ntasks-per-node=< | ||
+ | #SBATCH --begin=2010-01-20T12: | ||
+ | |||
+ | / | ||
</ | </ | ||
Zeile 27: | Zeile 48: | ||
All parameters used there can also be specified in the job script itself using #SBATCH. | All parameters used there can also be specified in the job script itself using #SBATCH. | ||
- | === Check the status of your own jobs === | + | Also, more examples can be found [[hpc: |
+ | |||
+ | === Check the status of your job submissions | ||
< | < | ||
- | squeue | + | squeue |
</ | </ | ||
- | === Check the status of the nodes === | + | === Check the status of nodes === |
< | < | ||
sinfo | sinfo | ||
Zeile 46: | Zeile 69: | ||
</ | </ | ||
+ | === Slurm Cheat Sheet === | ||
+ | |||
+ | A summary of the most common commands can be found [[https:// |