Search code examples
scriptingjob-schedulingpbsqsubtorque

PBS programming


some short and probably stupid questions about PBS:

1- I submit jobs using

qsub job_file

is it possible to submit a (sub)job inside a job file?

2- I have the following script:

qsub job_a
qsub job_b

For launching job_b, it would be great to have before the results of job_a finished. Is it possible to put some kind of barrier or some otehr workaround so job_b is not launched until job_a finished?

Thanks


Solution

  • Answer to the first question:

    Typically you're only allowed to submit jobs from the host where the PBS server is running, but it depends how your PBS system is set up.

    Answer to the second question:

    You can use dependencies. Read about the -W option in the qsub documentation. Here's an example bash script:

    dependency_id=$(qsub job_a)
    qsub -W depend=afterok:$dependency_id job_b
    

    job_b will start after job_a has finished successfully.