1

I have been trying to search around for an example of how to use the following option for job dependencies, -d, --dependency=<dependency_list>.

In the documentation, the syntax is shown to be after:job_id[[+time][:jobid[+time]...]] But I am unable to find any examples of this, and to be honest I find the presentation of the syntax confusing.

I have tried sbatch --dependency=after:123456[+5] myjob.slurm and sbatch --dependency=after:123456+5 myjob.slurm, but this yields the error

sbatch: error: Batch job submission failed: Job dependency problem.

How can I add a dependency to Job B so that it starts X minutes after Job A starts?

mhovd
  • 3,724
  • 2
  • 21
  • 47

2 Answers2

3

The square brackets [...] indicate an optional parameter value and should not appear in the actual parameter value. Try with

sbatch --dependency=after:123456+5 myjob.slurm
damienfrancois
  • 52,978
  • 9
  • 96
  • 110
  • 1
    Sorry, I forgot to include in the original post that I tried that as well. The line above (without the trailing comma) yields the error `sbatch: error: Batch job submission failed: Job dependency problem` – mhovd Oct 23 '20 at 11:15
  • Then you probably have a too old version of Slurm installed on the cluster you are using. You can find out with `scontrol version`. I believe this feature was introduced in 20.02. – damienfrancois Oct 23 '20 at 11:20
  • That makes sense, it seems my cluster is running version `19.05.07` – mhovd Oct 23 '20 at 11:22
1

With guidance from damienfrancois to exclude the brackets, I tried the following

sbatch --dependency=after:123456:+5 myjob.slurm

Which seems to work beautifully, listing it in the queue as dependent.

EDIT: This is for version 19.05.07

mhovd
  • 3,724
  • 2
  • 21
  • 47