How to Queue Jobs When Submitting PBS Jobs
Overview
When submitting jobs to PBS, you can set them to wait and run after existing jobs finish using the following code.
Code1
-W depend=after:{jod_id}-W depend=afterok:{jod_id}-W depend=afternotok:{jod_id}
Using the -W option, you can configure a job to run after a specific job finishes as shown above. If you want to submit the job file named test to run after job number 12345 finishes, submit the job as follows.
(base) [user ~]$ qsub -W depend=after:12345 test
afterok is the option that causes execution only after the specified jobs have completed successfully without errors. afternotok is the option that causes execution only after the specified jobs have terminated with an error. If you want to make a job dependent on multiple jobs, concatenate them with a colon : as shown below.
(base) [user ~]$ qsub -W depend=after:12345:12346:12347
If you want to use multiple dependency types, separate them with commas , with no spaces.
(base) [user ~]$ qsub -W depend=after:12345:12346,afterok:20001 test
