Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revisionLast revisionBoth sides next revision | ||
doku:job_chains [2014/06/03 13:18] – ir | doku:job_chains [2014/06/05 12:56] – [Solution II] ir | ||
---|---|---|---|
Line 5: | Line 5: | ||
There are several ways how to create job chains and we will discuss three different solutions below: | There are several ways how to create job chains and we will discuss three different solutions below: | ||
==== Solution I ===== | ==== Solution I ===== | ||
- | Create one single job script and list several different jobs inside it. E.g.: | + | Create one single job script, e.g., named // |
< | < | ||
- | user@l01 $ cat allInOne.sge | ||
#$ -N allInOne | #$ -N allInOne | ||
Line 14: | Line 13: | ||
./doJob3 | ./doJob3 | ||
</ | </ | ||
+ | job submission | ||
< | < | ||
user@l01 $ qsub allInOne.sge | user@l01 $ qsub allInOne.sge | ||
Line 20: | Line 19: | ||
</ | </ | ||
+ | This solution is suitable if the jobs are small and the whole job finishes within the maximum run time. For larger jobs, solution II is more convenient. | ||
==== Solution II ==== | ==== Solution II ==== | ||
- | In order to realize interdependencies of submitted jobs, qsub allows for the following options | + | qsub allows |
- | *[-hold_jid job_identifier_list] | + | * [-hold_jid job_identifier_list] |
- | *[-hold_jid_ad job_identifier_list] | + | * [-hold_jid_ad job_identifier_list] |
+ | The job identifier may be the **job id** or the **job name**. | ||
- | -hold_jid <job id|job name>. | + | The script of the first job is called //holdJob.sge//: |
< | < | ||
- | user@l01 $ cat holdJob.sge | ||
#$ -N holdJob | #$ -N holdJob | ||
./doJob1 | ./doJob1 | ||
</ | </ | ||
+ | The script of the interdependent second job is called // | ||
< | < | ||
- | user@l01 $ cat Job2.sge | ||
#$ -N Job2 | #$ -N Job2 | ||
#$ -hold_jid holdJob | #$ -hold_jid holdJob | ||
Line 41: | Line 41: | ||
./doJob2 | ./doJob2 | ||
</ | </ | ||
- | ... | + | job submission: |
< | < | ||
user@l01 $ qsub holdJob.sge | user@l01 $ qsub holdJob.sge |