This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Last revision Both sides next revision | ||
guides:slurm:basics [08.10.2019 15:18] Juha Kekäläinen |
guides:slurm:basics [06.04.2023 11:19] Administrator |
||
---|---|---|---|
Line 11: | Line 11: | ||
{{ : | {{ : | ||
+ | |||
### Example | ### Example | ||
+ | |||
+ | In this example we will run simple [MATLAB](https:// | ||
+ | |||
+ | |||
#### Example MATLAB code (matlab.m) | #### Example MATLAB code (matlab.m) | ||
``` | ``` | ||
Line 20: | Line 25: | ||
``` | ``` | ||
#### Example script (submit.sbatch) | #### Example script (submit.sbatch) | ||
+ | |||
+ | Here we have specified the [batch script](https:// | ||
+ | |||
``` | ``` | ||
#!/bin/bash | #!/bin/bash | ||
+ | #SBATCH --ntasks 1 # Number of task | ||
+ | #SBATCH --time 5 # Runtime in minutes. | ||
+ | #SBATCH --mem=2000 # | ||
+ | #SBATCH --partition serial # Partition to submit | ||
module load matlab/ | module load matlab/ | ||
Line 35: | Line 47: | ||
sbatch submit.sbatch | sbatch submit.sbatch | ||
``` | ``` | ||
- | **[sbatch](https:// | + | **[sbatch](https:// |
+ | |||
+ | Here is an another example on how to analyze variants. | ||
``` | ``` | ||
- | less slurm-jobid.out | + | # |
+ | # | ||
+ | #SBATCH --time 00: | ||
+ | #SBATCH --mem 2000 # Reserve 2 GB RAM for the job | ||
+ | #SBATCH --partition serial | ||
+ | |||
+ | module load bcftools # load modules | ||
+ | |||
+ | # filter variants and calculate stats | ||
+ | bcftools filter --include' | ||
``` | ``` | ||
+ | |||
+ | Submit the job to computing queue with the **[sbatch](https:// | ||
+ | |||
+ | ``` | ||
+ | sbatch variants.sbatch | ||
+ | ``` | ||
+ | |||
### Slurm job queue | ### Slurm job queue | ||
- | User can monitor the progress | + | User can monitor the state of the job with the **[squeue](https:// |
``` | ``` | ||
- | squeue -j JOBID | + | squeue -j < |
``` | ``` | ||
+ | |||
+ | ### Output of the job is available in local output file. | ||
+ | |||
+ | ``` | ||
+ | less slurm-< | ||
+ | ``` | ||
+ | |||
+ | ### Scontrol - View or modify Slurm configuration and state. | ||
+ | [Scontrol](https:// | ||
+ | |||
+ | #### List all compute nodes | ||
+ | ``` | ||
+ | scontrol show node | ||
+ | ``` | ||
+ | |||
+ | #### List all compute nodes | ||
+ | ``` | ||
+ | scontrol show node | ||
+ | ``` | ||
+ | |||
+ | #### List all queues/ | ||
+ | ``` | ||
+ | scontrol show partition | ||
+ | ``` | ||
+ | |||
+ | #### List information of the given jobid | ||
+ | ``` | ||
+ | scontrol show job < | ||
+ | ``` | ||
+ | |||
### Slurm job effiency report (seff) | ### Slurm job effiency report (seff) | ||
Line 52: | Line 112: | ||
``` | ``` | ||
- | seff jobid | + | seff <jobid> |
``` | ``` | ||