... | @@ -2,8 +2,8 @@ |
... | @@ -2,8 +2,8 @@ |
|
# Running a job on the cluster
|
|
# Running a job on the cluster
|
|
|
|
|
|
Jobs can be run on the cluster through the [srun](https://slurm.schedmd.com/srun.html) or [sbatch](https://slurm.schedmd.com/sbatch.html) commands. Both command supports common options, the main differences being that
|
|
Jobs can be run on the cluster through the [srun](https://slurm.schedmd.com/srun.html) or [sbatch](https://slurm.schedmd.com/sbatch.html) commands. Both command supports common options, the main differences being that
|
|
* `srun` is blocking, will print on the standard output and can run arbitrary commands, including sbatch scripts. Please refer to the [srun manual](https://slurm.schedmd.com/srun.html) for a full description.
|
|
* `srun` will block until the needed resources are available (or time out). It will print on the standard output and can run arbitrary commands, including sbatch scripts. Please refer to the [srun manual](https://slurm.schedmd.com/srun.html) for a full description.
|
|
* `sbatch` will schedule the job for later execution and will only work with an executable sbatch script. Please refer to the [sbatch manual](https://slurm.schedmd.com/sbatch.html) for a full description.
|
|
* `sbatch` will schedule the job for later execution, when the requested resources are available. It will only work with an executable [sbatch script](). Please refer to the [sbatch manual](https://slurm.schedmd.com/sbatch.html) for a full description.
|
|
|
|
|
|
Here, we will only mention the most common/important options.
|
|
Here, we will only mention the most common/important options.
|
|
|
|
|
... | @@ -54,7 +54,9 @@ $ |
... | @@ -54,7 +54,9 @@ $ |
|
* `--exclusive` wont share the node with another task.
|
|
* `--exclusive` wont share the node with another task.
|
|
* `make -j` our parallel make task
|
|
* `make -j` our parallel make task
|
|
|
|
|
|
## sbatch script
|
|
### Running in batch
|
|
|
|
|
|
|
|
We need to write a slurm/sbatch script.
|
|
|
|
|
|
An sbatch script must start with a [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix)):
|
|
An sbatch script must start with a [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix)):
|
|
```
|
|
```
|
... | | ... | |