Setting up Job Dependency with sbatch

The -d option to sbatch allows you to create job dependencies, where jobs are arranged in a sequence in which each step depends on the success or failure of previous ones. For instance, you can ensure that a preliminary step has been accomplished prior to launching the main computation.

Verify preliminary step was successful.
Option Flag Value Example
Job dependency -d type:job_id -d afterok:1234

The example above shows just one of the many kinds of conditions that can be set up for conditional execution of your jobs. The potential uses of job dependencies are explored more fully in the Advanced Slurm roadmap.

scontrol

The scontrol command is used to modify a job's configuration state after it has been submitted. For Frontera users, perhaps its most common function is to manually hold and release jobs that are in the queue:

$ scontrol hold <jobId>

The hold directive is used to prevent a pending job from starting. This is useful if you don't want to cancel a job outright, but instead wish to have some time to complete a task before the job executes (e.g., upload a data file). When you are ready for the job to proceed, it can be released back into the active queue by issuing a release directive:

$ scontrol release <jobId>

Another function of scontrol is to get details about the configuration of a queued or running job:

$ scontrol show job=838514
sacct

The sacct command can show you brief historical information about your past jobs. The following syntax lets you view some basic accounting data about jobs that started on or after a given date:

$ sacct --starttime 2020-05-01
 
©  |   Cornell University    |   Center for Advanced Computing    |   Copyright Statement    |   Inclusivity Statement