From 0128bd833f7ec9c5cd71cac0798dc5104d28b720 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Sl=C3=ADva?= <roman.sliva@vsb.cz> Date: Thu, 20 Jul 2023 14:20:23 +0200 Subject: [PATCH] Update slurm-job-submission-and-execution.md --- .../slurm-job-submission-and-execution.md | 55 ++++++++++--------- 1 file changed, 29 insertions(+), 26 deletions(-) diff --git a/docs.it4i/general/slurm-job-submission-and-execution.md b/docs.it4i/general/slurm-job-submission-and-execution.md index 7c577210b..4444bdec5 100644 --- a/docs.it4i/general/slurm-job-submission-and-execution.md +++ b/docs.it4i/general/slurm-job-submission-and-execution.md @@ -6,7 +6,7 @@ ## Getting Partitions Information -Display partitions/queues +Display partitions/queues on system: ```console $ sinfo -s @@ -29,11 +29,11 @@ qviz up 8:00:00 0/2/0/2 vizserv[1-2] On Barbora cluster all queues/partitions provide full node allocation, whole nodes are allocated to job. -On Complementary systems some queues/partitions provide full node allocation, see [Complementary systems documentation][2] for details. +On Complementary systems only some queues/partitions provide full node allocation, see [Complementary systems documentation][2] for details. ## Getting Job Information -Show my jobs +Show my jobs: ```console $ squeue --me @@ -41,41 +41,43 @@ $ squeue --me 104 qcpu interact user R 1:48 2 cn[101-102] ``` -Show job details for specific job +Show job details for specific job: ```console $ scontrol show job JOBID ``` -Show job details for executing job from job session +Show job details for executing job from job session: ```console $ scontrol show job $SLURM_JOBID ``` -Show my jobs with long output format (includes time limit) +Show my jobs using long output format (includes time limit): ```console $ squeue --me -l ``` -Show all jobs +Show all jobs on system: ```console $ squeue ``` -Show my jobs in given state +Show my jobs in running state: ```console $ squeue --me -t running ``` +Show my jobs in pending state: + ```console $ squeue --me -t pending ``` -Show jobs for given project (Slurm account). +Show jobs for given project: ```console squeue -A PROJECT-ID @@ -83,19 +85,19 @@ squeue -A PROJECT-ID ## Running Interactive Jobs -Run interactive job - queue qcpu_exp, one node by default, one task by default +Run interactive job - queue qcpu_exp, one node by default, one task by default: ```console $ 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 node 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 ``` -Run interactive job, with X11 forwarding +Run interactive job, with X11 forwarding: ```console $ salloc -A PROJECT-ID -p qcpu_exp --x11 @@ -106,7 +108,7 @@ Run interactive job, with X11 forwarding ## Running Batch Jobs -Run batch job +Run batch job: ```console $ sbatch script.sh @@ -158,14 +160,14 @@ set | grep ^SLURM See relevant [Slurm srun documentation][3] for details. -Get job nodelist +Get job nodelist: ``` $ echo $SLURM_JOB_NODELIST cn[101-102] ``` -Expand nodelist to list of nodes. +Expand nodelist to list of nodes: ``` $ scontrol show hostnames @@ -175,17 +177,19 @@ cn102 ## Modifying Jobs +In general: + ``` $ scontrol update JobId=JOBID ATTR=VALUE ``` -Modify job's time limit +Modify job's time limit: ``` scontrol update job JOBID timelimit=4:00:00 ``` -Set/modify job's comment +Set/modify job's comment: ``` $ scontrol update JobId=JOBID Comment='The best job ever' @@ -193,43 +197,42 @@ $ scontrol update JobId=JOBID Comment='The best job ever' ## Deleting Jobs -Delete job by job id. +Delete job by job id: + ``` $ scancel JOBID ``` -Delete all my jobs +Delete all my jobs: ``` $ scancel --me ``` -Delete all my jobs in interactive mode +Delete all my jobs in interactive mode, confirming every action: ``` $ scancel --me -i ``` - -Delete all my running jobs +Delete all my running jobs: ``` $ scancel --me -t running ``` -Delete all my pending jobs +Delete all my pending jobs: ``` $ scancel --me -t pending ``` -Delete all my pending jobs for project PROJECT-ID +Delete all my pending jobs for project PROJECT-ID: ``` $ scancel --me -t pending -A PROJECT-ID ``` - [1]: https://slurm.schedmd.com/ -[2]: /cs/job-scheduling/ +[2]: /cs/job-scheduling/#partitions [3]: https://slurm.schedmd.com/srun.html#SECTION_OUTPUT-ENVIRONMENT-VARIABLES -- GitLab