24.0 Job templates > Job template references > Job template workflow examples

Conventions

24.9 Job template workflow examples

Example 24-5: A workflow with multiple dependencies

In this example the job will depend on the completion of two other jobs Moab creates. Both jobs execute at the same time.

# Engineering2

JOBCFG[engineering2] TEMPLATEDEPEND=AFTER:engineering2.pre2 TEMPLATEDEPEND=AFTER:engineering2.pre

JOBCFG[engineering2.pre2] TASKS=2 WCLIMIT=00:01:00 SELECT=TRUE EXEC=/usr/tools/engineering2.pre2.sh

JOBCFG[engineering2.pre] TASKS=2 WCLIMIT=00:01:00 SELECT=TRUE EXEC=/usr/tools/engineering2.pre.sh

JOBCFG[engineering2.match] ACCOUNT=engineering2

JOBMATCHCFG[engineering2.job] JMIN=engineering2.match JSET=engineering2

Example 24-6: Jobs that run after the submission job

Three additional jobs are created that depend on the submitted job.

# Workflow 2

JOBCFG[workflow2] TEMPLATEDEPEND=BEFORE:workflow2.post1 TEMPLATEDEPEND=BEFORE:workflow2.post2 TEMPLATEDEPEND=BEFORE:workflow2.post3

JOBCFG[workflow2.post1] TASKS=2 WCLIMIT=00:01:00 SELECT=TRUE EXEC=/usr/tools/workflow2.post1.sh

JOBCFG[workflow2.post2] TASKS=2 WCLIMIT=00:01:00 SELECT=TRUE EXEC=/usr/tools/workflow2.post2.sh

JOBCFG[workflow2.post3] TASKS=2 WCLIMIT=00:01:00 SELECT=TRUE EXEC=/usr/tools/workflow2.post3.sh

JOBCFG[workflow2.match] ACCOUNT=workflow2

JOBMATCHCFG[workflow2.job] JMIN=workflow2.match JSET=workflow2

Example 24-7: A complex workflow

A complex workflow that handles failures.

# Workflow 4

JOBCFG[workflow4.step1] TASKS=1 WCLIMIT=00:01:00 SELECT=TRUE EXEC=/usr/tools/workflow.step1.sh TEMPLATEDEPEND=BEFOREFAIL:workflow4.fail1

JOBCFG[workflow4.fail1] TASKS=1 WCLIMIT=00:00:30 SELECT=TRUE EXEC=/usr/tools/workflow.fail.1.sh TEMPLATEDEPEND=BEFOREANY:workflow4.fail2

JOBCFG[workflow4.fail2] TASKS=1 WCLIMIT=00:00:30 SELECT=TRUE EXEC=/usr/tools/workflow.fail.2.sh

# Submission job

JOBCFG[workflow4.step2] TEMPLATEDEPEND=AFTEROK:workflow4.step1 TEMPLATEDEPEND=BEFOREOK:workflow4.step3.1 TEMPLATEDEPEND=BEFOREOK:workflow4.step3.2

JOBCFG[workflow4.step3.1] TASKS=1 WCLIMIT=00:01:00 SELECT=TRUE EXEC=/usr/tools/workflow.step3.1.sh

JOBCFG[workflow4.step3.2] TASKS=1 WCLIMIT=00:01:00 SELECT=TRUE EXEC=/usr/tools/workflow.step3.2.sh TEMPLATEDEPEND=BEFOREOK:workflow4.step4

JOBCFG[workflow4.step4] TASKS=1 WCLIMIT=00:01:00 SELECT=TRUE EXEC=/usr/tools/workflow.step4.sh

JOBCFG[workflow4.step4] TEMPLATEDEPEND=BEFOREOK:workflow4.step5.1 TEMPLATEDEPEND=BEFOREOK:workflow4.step5.2 TEMPLATEDEPEND=BEFORENOTOK:workflow4.step5.3

JOBCFG[workflow4.step5.1] TASKS=1 WCLIMIT=00:01:00 SELECT=TRUE EXEC=/usr/tools/workflow.step5.1.sh

JOBCFG[workflow4.step5.2] TASKS=1 WCLIMIT=00:01:00 SELECT=TRUE EXEC=/usr/tools/workflow.step5.2.sh

JOBCFG[workflow4.step5.3] TASKS=1 WCLIMIT=00:00:30 SELECT=TRUE EXEC=/usr/tools/workflow.step5.3.sh

JOBCFG[workflow4.match] ACCOUNT=workflow4

Related topics