I have a scenario where I need to submit a job on a Slurm cluster. This new job should start only after another job with ID 1 has finished running. To achieve this, I attempted to use the command “sbatch -d after:1 job.script”. However, when I checked the status using “scontrol show job 2”, it seems that the dependency is not being recognized, as it displays “Dependency=(null)”.
In an attempt to resolve this issue, I then used the command “scontrol update JobId=2 dependency=after:1”. Despite this, the dependency information still appears as “Dependency=(null)” when I check again using “scontrol show job 2”. This problem only seems to occur when the dependency is a job that is currently running.
Is there a reason why the dependency is being ignored in this case? Are there any alternative approaches I could take to ensure that the new job starts only after the specified job has completed its execution?