Versionen im Vergleich

Schlüssel

  • Diese Zeile wurde hinzugefügt.
  • Diese Zeile wurde entfernt.
  • Formatierung wurde geändert.

...

Dependent Jobs - How to pass the 12h walltime limit

If your simulation is restartable, a follow-up job can be triggered automatically. You need to hand over only Simply provide the ID of the previous job . Simply copy, paste and execute the following linesas an additional sbatch argument:

Codeblock
titleExample of a job chain with 3 parts
# submit a first job, extract job id
sbatch_output=$(sbatch job1.sbatch)
jobid=${sbatch_output##* }

# submit a second job with dependency: starts only if previous job terminates successfully)
sbatch_output=$(sbatch --dependency=afterok:$jobid job2.sbatch)
jobid=${sbatch_output##* }

# submit a third job with dependency: starts only if previous job terminates successfully)
sbatch_output=$(sbatch --dependency=afterok:$jobid job3.sbatch)

squeue -l -u $USER will mark all your dependent jobs with "(Dependency)" in the column "NODELIST(REASON)".

Please note: As soon as a follow-up jobscript (sbatch file) is submitted, you can not change its content any more. Lines starting with #SBATCH will be evaluated immediately. The remaining content of the jobscript is evaluated as soon as the dependency condition is fulfilled and compute nodes are available. Besides afterok there exist many other dependency types (sbatch man page).

Job Arrays

Job arrays are the preferred way to submit many similar job. Jobs, for instance, if you need to run the same program on a number of input files, or with different settings or run them with a range of parameters. Arrays are created with the -a start-finish sbatch parameter. E.g. sbatch -a 0-19 will create 20 jobs indexed from 0 to 19. There are different ways to index the arrays, which are described below.

...