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

Conventions

24.1 Creating job templates

To create a job template

  1. Open moab.cfg. Add the JOBCFG parameter and give the new job template a unique name.
  2. JOBCFG[newtemplate]

  3. Configure any desired attributes (see Job template extension attributes.). Some of the important attributes include:
    • FLAGS - Lets you specify any job flags that should be applied.
      JOBCFG[newtemplate] FLAGS=SUSPENDABLE

      When Moab applies newtemplate to a job, the job is marked as suspendable.

    • SELECT - Lets you apply the template directly at job submission.
      JOBCFG[newtemplate] FLAGS=SUSPENDABLE SELECT=TRUE

      When you submit a job via msub, you can specify that your job has newtemplate applied to it. When Moab applies the template to a job, that job is marked as suspendable.

    • TEMPLATEDEPEND - Lets you create dependencies when you create a job template workflow (see Creating workflows with job templates.).
      JOBCFG[newtemplate] FLAGS=SUSPENDABLE SELECT=TRUE TEMPLATEDEPEND=AFTER:job1.pre

      When Moab applies newtemplate to a job, the job cannot run until job job1.pre has finished running; the job is also marked as suspendable. You can specify that Moab apply this template to a job as you submit it.

  4. If you want to automate job template application, see Applying templates based on job attributes for instructions. If you want to apply the template manually on job submission, see Requesting job templates directly for instructions.

Related topics