24.0 Job templates > Job template how-to's > Creating workflows with job templates

Conventions

24.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.). 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 STAGEIN=TRUE

    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).

    Since the setup.pre.sh script is not on an NFS mount, it must be staged in. STAGEIN has a value of TRUE or FALSE. If set to TRUE, Moab ensures the executable is staged out to the compute host where the dependent job runs. If set to FALSE, Moab assumes the executable is already available on the compute host.

  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