This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
howtouseslurm_004 [2020/12/17 11:04] – created tmatejuk | howtouseslurm_004 [2023/08/01 01:08] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | **Using dependencies in Slurm** | ||
+ | |||
+ | Slurm has a fairly robust set of dependencies you can use. These are set when you submit the job and can be used for setting up pipelines. | ||
+ | |||
+ | To use dependencies, | ||
+ | < | ||
+ | -d, --dependency=< | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
You may want to run a set of jobs sequentially, | You may want to run a set of jobs sequentially, | ||
Line 7: | Line 18: | ||
[user@lnode002]$ sbatch --dependency=afterany: | [user@lnode002]$ sbatch --dependency=afterany: | ||
Submitted batch job 112 | Submitted batch job 112 | ||
- | <code/> | + | </code> |
- | The flag --dependency=afterany: | + | The flag '' |
Once job 111 completes, job 112 will be released by the batch system and then will run as the appropriate nodes become available. | Once job 111 completes, job 112 will be released by the batch system and then will run as the appropriate nodes become available. | ||
Line 15: | Line 26: | ||
**Exit status**: The exit status of a job is the exit status of the last command that was run in the batch script. An exit status of ' | **Exit status**: The exit status of a job is the exit status of the last command that was run in the batch script. An exit status of ' | ||
- | There are several options for the ' | + | There are several options for the '' |
< | < | ||
--dependency=afterany: | --dependency=afterany: | ||
Line 23: | Line 34: | ||
</ | </ | ||
+ | ---- | ||
+ | |||
+ | Making a job depend on the completion of several other jobs: example below : | ||
+ | < | ||
+ | [user@lnode002]$ sbatch job1.batch | ||
+ | Submitted batch job 201 | ||
+ | |||
+ | [user@lnode002]$ sbatch job2.batch | ||
+ | Submitted batch job 202 | ||
+ | |||
+ | [user@lnode002]$ sbatch --dependency=afterany: | ||
+ | Submitted batch job 203 | ||
+ | |||
+ | [user@lnode002]$ squeue -u $USER -S S,i,M -o "%12i %15j %4t %30E" | ||
+ | JOBID NAME ST | ||
+ | 201 job1.batch | ||
+ | 202 job2.batch | ||
+ | 203 job3.batch | ||
+ | </ | ||
+ | ---- | ||
- | *) see more at [[https:// | + | *) [[https:// |
+ | *) [[http:// | ||