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
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.
Yes, It is possible to submit a job from another job, though it has some caveats.
-Your moms must have client commands (qsub) in the path
-$USECP will attempt to copy the files from the node that the 1st job is running on.
-Be careful submitting jobs from other jobs because you can easily crash pbs_server if your submit script calls too many qsubs.
You can have jobs b - z dependent on job 'a' with the following syntax
qsub foo.sh -W depend=afterok:jobA
Job arrays might also be a good solution.
http://docs.adaptivecomputing.com/torque/help.htm#topics/2-jobs/multiJobSubmission.htm