You are here: 22 Job Templates > How-to > Creating Workflows with Job Templates

22.5 Creating Workflows with Job Templates

To build a workflow with job templates

  1. Create the jobs in the workflow using the JOBCFG parameter (See Creating Job Templates for more information.). It might be useful to add the PURGEONSUCCESSONLY flag to your setup or destroy jobs; it will allow you to restart the jobs easily if they fail. Specify the order in which they should run with the TEMPLATEDEPEND attribute. Please see the Job dependency syntax table for a list of valid dependency options.
  2. JOBCFG[setup.pre]   TASKS=2 WCLIMIT=00:01:00 SELECT=TRUE EXEC=/usr/tools/setup.pre.sh

    JOBCFG[setup.pre2]  TEMPLATEDEPEND=AFTER:setup.pre SELECT=TRUE EXEC=/nfs/tools/setup.pre2.sh

    JOBCFG[engineering] TEMPLATEDEPEND=AFTER:setup.pre2

    When Moab applies the engineering template to a qualifying job, the job will not run until template job setup.pre and then setup.pre2 are created from the specified EXEC strings and finish running.

    The Moab naming convention for jobs created with job templates is <moabId>.<templateName>. By default, when Moab submits jobs to only one resource manager, the job IDs are synchronized with the resource manager's job IDs. You can use the parameter USEMOABJOBID so that a template-created job is easily associated with its parent job (such as moab.1, moab.1.setup.pre).

  3. Create the job template that will act as the criteria a job must meet for Moab to apply the engineering template. In this situation, the job must be submitted with the account name engineering.
  4. JOBCFG[engineering.match] ACCOUNT=engineering

  5. Create the JOBMATCHCFG configuration to tell Moab that when a job matches the engineering.match template, it should apply the engineering template.
  6. JOBMATCHCFG[engineering.job] JMIN=engineering.match JSET=engineering

Related Topics 

© 2016 Adaptive Computing