|
|
A quick presentation of the main slurm options:
|
|
|
Slurm options help you to define the amount of resources you will request to the job scheduler in order to run your application.
|
|
|
|
|
|
Here are the main options used at CINES, presented as an example:
|
|
|
|
|
|
| Option | Argument | Definition |
|
|
|
| :----------- | :------: | :------------ |
|
|
|
| --nodes, -N | <nodes> (integer) | Request that a set of <nodes> nodes be allocated to this job |
|
|
|
| --ntasks, -n | <ntasks> (integer) | Request that srun allocate resources for <ntasks> tasks |
|
|
|
| Slurm option | Definition |
|
|
|
| -----------: | :------------ |
|
|
|
| --job-name=example | Set the name of the job |
|
|
|
| --time=00:30:00 | Set a limit on the total run time of the job allocation, here 30 minutes. |
|
|
|
| --nodes=2 | Request that a set of 2 nodes be allocated to this job |
|
|
|
| --ntasks=28 | Request that srun runs 56 MPI tasks |
|
|
|
| --cpus-per-task=2 | Advise Slurm that the job will require 2 cpus per MPI task |
|
|
|
| --threads-per-core=1 | Define the number of threads per core you intend to use |
|
|
|
| --mem=50GB | Specify the real memory required per node|
|
|
|
| --exclusive | The job allocation can not share nodes with other running jobs |
|
|
|
| --output output.slurm | Define the batch script's standard output file |
|
|
|
| --constraint=BDW28 | Define the type of processor you want to use |
|
|
|
|
|
|
Arguments can be used with srun, or inserted in a bash script.
|
|
|
In a bash script, you have to add the option using the #SBATCH keyword, for instance:
|
|
|
A typical bash script, using the options seen before, may look like the following:
|
|
|
|
|
|
***slurm.batch***
|
|
|
*****************
|
|
|
```
|
|
|
#!/bin/bash
|
|
|
#SBATCH -J example
|
|
|
#SBATCH --time=0:30:00
|
|
|
#SBATCH --nodes=2
|
|
|
#SBATCH --ntasks=28
|
|
|
#SBATCH --cpus-per-task=2
|
|
|
#SBATCH --threads-per-core=1
|
|
|
#SBATCH --mem=50GB
|
|
|
#SBATCH --exclusive
|
|
|
#SBATCH --output and_hybrid.output.slurm
|
|
|
#SBATCH --constraint=BDW28
|
|
|
|
|
|
#Then load your environment and run your application using srun
|
|
|
|
|
|
module load intel intelmpi
|
|
|
|
|
|
srun ./my_app.exe
|
|
|
```
|
|
|
#SBATCH --nodes=7
|
|
|
#SBATCH --ntasks=168
|
|
|
``` |
|
|
\ No newline at end of file |
|
|
You can then run your script on the supercomputer using the _sbatch_ command:
|
|
|
|
|
|
```
|
|
|
sbatch slurm.batch
|
|
|
```
|
|
|
|
|
|
The _squeue_ command will tell you if your job is waiting or running. Once your job is completed, you can get your results in your directory. |
|
|
\ No newline at end of file |