Job Templates
Moab Workload Manager®

11.10 Job Templates

11.10.1 Job Template Overview

Job templates are used for two primary purposes: (1) to provide a means of generically matching and categorizing jobs, and (2) to provide a means of setting arbitrary default attributes for certain jobs. Job templates can be used in many aspects of scheduling but they are most commonly applied in the areas of Dynamic Jobs and Peer Based Grid usage policies. Job templates are defined using the JOBCFG configuration parameter.

11.10.2 Job Template Extension Attributes

When creating a job template, any attribute acceptable within the WIKI command language can be used. In addition, job templates can use any of the following extension attributes:

Attribute Format Description Example
ACCOUNT <ACCOUNT>[,<ACCOUNT>]... Account credentials associated with job. Used in job template matching.
moab.cfg
JOBCFG[public]      FLAGS=preemptee
JOBCFG[public.min]  ACCOUNT=public_acct
JOBMATCHCFG[public] JMIN=public.min JSET=public
ALLOCSIZE <MINSIZE>[,<MAXSIZE>] Number of application tasks to allocate at each allocation adjustment.
moab.cfg
JOBCFG[webdb] ALLOCSIZE=4
ALLOCSYNCTIME [[[DD]:HH]:MM]:SS Time indicating maximum duration Moab will wait before forcing allocation decisions via provisioning or other steps.

NOTE: By default, when de-allocating resources, Moab does not re-assign resources from one service to another until the service/job initially assigned the resources reports successful de-allocation via the workload query response.
moab.cfg
JOBCFG[webdb]  ALLOCSYNCTIME=00:04:00
JOBCFG[sirius] ALLOCSYNCTIME=00:00:20
Moab forces the de-allocation of resources assigned to webdb if the application does not release them within 4 minutes of a de-allocation request. For the sirius application, Moab forces de-allocation if not released by the application within 20 seconds of a de-allocation request.
CLASS <CLASS>[,<CLASS>]... Class credentials associated with job. Used in job template matching.
moab.cfg
JOBCFG[night]      FLAGS=preemptor
JOBCFG[night.min]  CLASS=night_class
JOBMATCHCFG[night] JMIN=night.min JSET=night
DESCRIPTION <STRING> Description of the job.
moab.cfg
JOBCFG[webdb] DESCRIPTION="Template job"
FLAGS <JOBFLAG>[,<JOBFLAG>]... One or more legal job flag values.
moab.cfg
JOBCFG[webdb] FLAGS=NORMSTART
GNAME <STRING> Group credential associated with job.
moab.cfg
JOBCFG[webserv] GNAME=service
GROUP <GROUP>[,<GROUP>]... Group credentials associated with job. Used in job template matching.
moab.cfg
JOBCFG[admin]      FLAGS=preemptor
JOBCFG[admin.min]  GROUP=admin_group
JOBMATCHCFG[admin] JMIN=admin.min JSET=admin
IFLAGS <IJOBFLAG>[,<IJOBFLAG>]... One or more of the following: HIDDEN, HWJOB, GLOBALRSVACCESS, SYNCJOBID.
moab.cfg
JOBCFG[webdb] IFLAGS=HIDDEN
MEM <INTEGER> Maximum amount of physical memory used by the job. See Requesting Resources for more information.
moab.cfg
JOBCFG[smalljobs] MEM=25
NODEACCESSPOLICY one of the following: SHARED, SHAREDONLY, SINGLEJOB, SINGLETASK , SINGLEUSER, or UNIQUEUSER Specifies how node resources will be shared by a job. (See the Node Access Overview for more information)
moab.cfg
JOBCFG[serverapp] NODEACCESSPOLICY=SINGLEJOB
NODERANGE <MIN>[,<MAX>] Minimum and maximum nodes allowed to be allocated to job. (See Dynamic Jobs.)
moab.cfg
JOBCFG[vizserver] NODERANGE=1,16
PRIORITY <INTEGER> Relative job priority.
moab.cfg
JOBCFG[meis] PRIORITY=25000
PROCRANGE <MIN>[,<MAX>] Minimum and maximum processors allowed to be allocated to job.
moab.cfg
JOBCFG[meis] PROCRANGE=2,64
QOS <QOS>[,<QOS>]... QoS credentials associated with job. Used in job template matching.
moab.cfg
JOBCFG[admin]      RFEATURES=bigmem
JOBCFG[admin.min]  QOS=admin_qos
JOBMATCHCFG[admin] JMIN=admin.min JSET=admin
RFEATURES <FEATURE>[,<FEATURE>]... List of features required by job.
moab.cfg
JOBCFG[servapp] RFEATURES=fast,bigmem
RM <STRING> Destination resource manager to be associated with job.
moab.cfg
JOBCFG[webdb] RM=slurm
SELECT <BOOLEAN> : TRUE | FALSE Job template can be directly requested by job at submission.
moab.cfg
JOBCFG[servapp] SELECT=TRUE
TARGETBACKLOG <MIN>[,<MAX>] Minimum and maximum backlog for application within job. In the case of dynamic jobs, Moab allocates/deallocates resources as needed to keep the job within the target range.
moab.cfg
JOBCFG[pdb] TARGETBACKLOG=0.5,2.0
TARGETLOAD <MIN>[,<MAX>] Minimum and maximum load for application within job. In the case of dynamic jobs, Moab allocates/deallocates resources as needed to keep the job within the target range.
moab.cfg
JOBCFG[pdb] TARGETLOAD=0.5,2.0
TARGETRESPONSETIME <MIN>[,<MAX>] Minimum and maximum response time for application within job. In the case of dynamic jobs, Moab allocates/deallocates resources as needed to keep the job within the target range.
moab.cfg
JOBCFG[pdb] TARGETRESPONSETIME=0.5,2.0
TARGETTHROUGHPUT <MIN>[,<MAX>] Minimum and maximum throughput for application within job. In the case of dynamic jobs, Moab allocates/deallocates resources as needed to keep the job within the target range.
moab.cfg
JOBCFG[pdb] TARGETTHROUGHPUT=0.5,2.0
TARGETVIOLATIONTIME <ALLOCATIONTIME>[,<DEALLOCATIONTIME>] where values are specified using the format [[[DD:]HH:]MM:]SS Amount of time an application performance target must be exceeded before Moab adjusts the resource allocation of a dynamic job. By default, Moab allocates/deallocates resources as soon as a performance target violation is detected.
moab.cfg
JOBCFG[pdb] TARGETRESPONSETIME=0.5,2.0
JOBCFG[pdb] TARGETVIOLATIONTIME 00:00:10,00:15:00
Additional resources are allocated to the pdb service for any performance slow-down lasting more than 10 seconds. Excess resources are deallocated if they are not required for at least 15 minutes. The TARGETVIOLATIONTIME parameter allows management of workload spikes to be adjusted based on workload priority, allocation overhead, and other system characteristics.
UNAME <STRING> User credential associated with job.
moab.cfg
JOBCFG[webserv] UNAME=service
USER <USER>[,<USER>]... User credentials associated with job.
moab.cfg
JOBCFG[webserv] USER=service

11.10.3 Job Template Matching

The JOBMATCHCFG parameter allows relationships to be established between a number of job templates. With this parameter, five types of templates can be specified as described in the following table:

AttributeDescription
JMAX A potential job is rejected if it has matching attributes set or has resource requests that exceed those specified in this template.
JMIN A potential job is rejected if it does not have matching attributes set or has resource requests that do not meet or exceed those specified in this template.
JDEF A matching job has the specified attributes set as defaults but all values can be overridden by the user if the matching attribute is explicitly set at job submission time.
JSET A matching job has the specified attributes forced to these values and these values override any values specified by the submittor at job submission time.
JSTAT A matching job has its usage statistics reported into this template.

NOTE: For JMAX, a job template can specify only positive non-zero numbers as maximum limits for generic resources. If a job requests a generic resource that is not limited by the template, then the template can still be used.

11.10.4 Resource Manager Templates

Job templates can also be applied to resource managers modifying attributes of jobs submitted to, migrated to, or routed through specified resource manager interfaces. In particular the RMCFG attributes MAX.JOB, MIN.JOB, SET.JOB, and DEFAULT.JOB can be used. However, the meanings of resource manager job templates are slightly different than their JOBMATCHCFG counterparts as described in the following table.

AttributeDescription
MAX.JOB A potential job is not allowed to access the resource manager if it has matching attributes set or has resource requests that exceed those specified in this template.
MIN.JOB A potential job is not allowed to access the resource manager if it does not have matching attributes set or has resource requests that do not meet or exceed those specified in this template.
DEFAULT.JOB A job associated with this resource manager has the specified attributes set as defaults but all values can be overridden by the user if the matching attribute is explicitly set at job submission time.
SET.JOB A job associated with this resource manager has the specified attributes forced to these values and these values override any values specified by the submittor at job submission time.

11.10.5 Job Template Examples

Job templates can be used for a wide range of purposes including enabling automated learning, setting up custom application environments, imposing special account constraints, and applying group default settings. The following examples highlight some of these uses:

11.10.5.1 Example 1: Setting Up Application-Specific Environments

moab.cfg

JOBCFG[xxx] EXEC=*app* JOBPROLOG=/usr/local/appprolog.x

11.10.5.2 Example 2: Applying Job Preferences and Defaults

moab.cfg

JOBCFG[xxx] CLASS=appq EXEC=*app* PREF=clearspeed

NODECFG[DEFAULT] PRIOF=5.0*PREF

11.10.5.3 Example 3: Applying Resource Constraints to Fuzzy Collections

In the following example, a job template match is set up. Using the JOBMATCHCFG parameter, Moab is configured to apply all attributes of the inter.set job template to all jobs that match the constraints of the inter.min job template. In this example, all interactive jobs are assigned the ignpolicies flag that allows them to ignore active, idle, system, and partition level policies. Interactive jobs are also locked into the test standing reservation and thus only allowed to run on the associated nodes.

moab.cfg
# limit all users to a total of two non-interactive jobs

USERCFG[DEFAULT]  MAXJOB=2

SRCFG[test] DESCRIPTION="compute pool for interactive and short duration jobs"
SRCFG[test] JOBATTRLIST=INTERACTIVE
SRCFG[test] MAXTIME=1:00:00
SRCFG[test] HOSTLIST=R:atl[16-63]

JOBCFG[inter.min] FLAGS=interactive
JOBCFG[inter.set] FLAGS=ignpolicies REQRSV=interactive

JOBMATCHCFG[interactive] JMIN=inter.min JSET=inter.set

11.10.5.4 Example 4: Resource Manager Templates

In the following exmple, interactive jobs are not allowed to enter through this resource manager and any job that does route in from this resource manager interface has the preemptee flag set.

moab.cfg
JOBCFG[no_inter]    FLAGS=interactive
JOBCFG[preempt_job] FLAGS=preemptee

RMCFG[gridA.in] MAX.JOB=no_inter SET.JOB=preempt_job

11.10.5.5 Example 5: Size Based Prioritization

In the following example, jobs requesting over 3,000 processors have their priority increased by 10,000. Jobs requesting between 1,024 and 2,999 processors have their priority increased by 2,000.

moab.cfg
JOBCFG[med.min]    TASKS=1024
JOBCFG[med.max]    TASKS=2999
JOBCFG[med.set]    PRIORITY=+2000
JOBMATCHCFG[med]   JMIN=med.min JMAX=med.max JSET=med.set

JOBCFG[large.min]  TASKS=3000
JOBCFG[large.set]  PRIORITY=+10000
JOBMATCHCFG[large] JMIN=large.min JSET=large.set

JOBCFG[large.set]  PRIORITY=+10000
JOBMATCHCFG[large] JMIN=large.min JSET=large.set

11.10.6 Viewing/Managing Job Templates

Job templates can be viewed by specifying "template:" before the template name in checkjob and also by using the command mdiag -j as in the following example:

Example
> mdiag -j --flags=policy

> checkjob -v template:match.min

See Also