diff --git a/docs.it4i/general/slurm-job-submission-and-execution.md b/docs.it4i/general/slurm-job-submission-and-execution.md index 3160cd660a5b4a99d00880a14f235f7085b031a8..2c4fac1f559ee8696782966a79284c20368ff6e7 100644 --- a/docs.it4i/general/slurm-job-submission-and-execution.md +++ b/docs.it4i/general/slurm-job-submission-and-execution.md @@ -40,13 +40,19 @@ $ squeue --me Show job details for specific job ```console -$ scontrol -d show job JOBID +$ scontrol show job JOBID ``` Show job details for executing job from job session ```console -$ scontrol -d show job $SLURM_JOBID +$ scontrol show job $SLURM_JOBID +``` + +Show my jobs with long output format (includes time limit) + +```console +$ squeue --me -l ``` Show all jobs @@ -79,7 +85,7 @@ Run interactive job - queue qcpu_exp, one node by default, one task by default $ salloc -A PROJECT-ID -p qcpu_exp ``` -Run interactive job on four nodes, 36 tasks per node (Barbora cluster, cpu partition recommended value based on core count), two hours time limit +Run interactive job on four nodes, 36 tasks per node (Barbora cluster, cpu partition recommended value based on node core count), two hours time limit ```console $ salloc -A PROJECT-ID -p qcpu -N 4 --ntasks-per-node 36 -t 2:00:00 @@ -106,7 +112,7 @@ File script content: ```shell #!/usr/bin/bash #SBATCH -J MyJobName -#SBATCH -A OPEN-00-00 +#SBATCH -A PROJECT-ID #SBATCH -N 4 #SBATCH --ntasks-per-node 36 #SBATCH -p qcpu @@ -158,7 +164,7 @@ cn[101-102] Expand nodelist to list of nodes. ``` -$ scontrol show hostnames $SLURM_JOB_NODELIST +$ scontrol show hostnames cn101 cn102 ``` @@ -169,7 +175,13 @@ cn102 $ scontrol update JobId=JOBID ATTR=VALUE ``` -for example +Modify job's time limit + +``` +scontrol update job JOBID timelimit=4:00:00 +``` + +Set/modify job's comment ``` $ scontrol update JobId=JOBID Comment='The best job ever' @@ -177,9 +189,42 @@ $ scontrol update JobId=JOBID Comment='The best job ever' ## Deleting Jobs +Delete job by job id. ``` $ scancel JOBID ``` +Delete all my jobs + +``` +$ scancel --me +``` + +Delete all my jobs in interactive mode + +``` +$ scancel --me -i +``` + + +Delete all my running jobs + +``` +$ scancel --me -t running +``` + +Delete all my pending jobs + +``` +$ scancel --me -t pending +``` + +Delete all my pending jobs for project PROJECT-ID + +``` +$ scancel --me -t pending -A PROJECT-ID +``` + + [1]: https://slurm.schedmd.com/ [2]: https://slurm.schedmd.com/srun.html#SECTION_OUTPUT-ENVIRONMENT-VARIABLES