Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
ift:computing_cluster:slurm [2022/09/28 22:16] kcach created |
ift:computing_cluster:slurm [2023/04/02 20:22] (current) kcach |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Slurm ====== | ====== Slurm ====== | ||
SLURM is the workload manger and job scheduler for tron.ift.uni.wroc.pl | SLURM is the workload manger and job scheduler for tron.ift.uni.wroc.pl | ||
+ | |||
+ | ===== Basic usage ===== | ||
+ | |sinfo -alN|show nodes information| | ||
+ | |squeue|Show job queue| | ||
+ | |squeue -u <username>|List all current jobs for a user| | ||
+ | |squeue -u <username> -t RUNNING|List all running jobs for a user| | ||
+ | |squeue -u <username> -t PENDING|List all pending jobs for a user| | ||
+ | |scancel <jobid>|To cancel one job| | ||
+ | |scancel -u <username>|To cancel all the jobs for a user| | ||
+ | |scancel -t PENDING -u <username>|To cancel all the pending jobs for a user| | ||
+ | |scancel --name myJobName|To cancel one or more jobs by name| | ||
===== Slurm batch ===== | ===== Slurm batch ===== | ||
- | The following parameters can be used as command line parameters with sbatch and srun or in jobscript, see also Job script example below | + | The following parameters can be used as command line parameters with *sbatch* and *srun* or in jobscript, see also Job script example below |
**Basic settings** | **Basic settings** | ||
|**Parameter**|**Function**| | |**Parameter**|**Function**| | ||
Line 42: | Line 54: | ||
==== Job script example ==== | ==== Job script example ==== | ||
+ | <note>Before usage, please adjust parameters</note> | ||
<code bash> | <code bash> | ||
#!/bin/bash -l | #!/bin/bash -l | ||
# Give your job a name, so you can recognize it in the queue overview | # Give your job a name, so you can recognize it in the queue overview | ||
#SBATCH --job-name=example | #SBATCH --job-name=example | ||
+ | |||
+ | #SBATCH -o slurm-%j.output # %j - will return SLURM_JOB_ID | ||
+ | #SBATCH -e slurm-%j.error | ||
# Define, how many nodes you need. Here, we ask for 1 node. | # Define, how many nodes you need. Here, we ask for 1 node. | ||
Line 79: | Line 95: | ||
# Finish the script | # Finish the script | ||
exit 0 | exit 0 | ||
+ | </code> | ||
+ | |||
+ | Put script to job queue with | ||
+ | <code> | ||
+ | sbatch ~/sampleScript.sh | ||
</code> | </code> | ||
Line 85: | Line 106: | ||
<code bash> | <code bash> | ||
srun --nodes=1 --ntasks-per-node=1 --time=01:00:00 --pty bash -i | srun --nodes=1 --ntasks-per-node=1 --time=01:00:00 --pty bash -i | ||
+ | # Request specific node by name | ||
+ | srun --nodelist=node2 --ntasks-per-node=1 --time=01:00:00 --pty bash -i | ||
</code> | </code> | ||