18.3 Trigger Components

18.3.1 Trigger Attributes

Table1: Trigger Attributes

AType
cancel, changeparam, jobpreempt, mail, exec, internal
Specifies what kind of action the trigger will take when it fires.
jobpreempt indicates that the trigger should preempt all jobs currently allocating resources assigned to the trigger's parent object.

cancel and jobpreempt only apply to reservation triggers.
   
Action
<STRING>
For exec atype triggers, signifies executable and arguments. For jobpreempt atype triggers, signifies PREEMPTPOLICY to apply to jobs that are running on allocated resources. For changeparam atype triggers, specifies the parameter to change and its new value (using the same syntax and behavior as the changeparam command).
   
BlockTime
[[HH:]MM:]SS
Time (in seconds) Moab will suspend normal operation to wait for trigger execution to finish.
Use caution as Moab will completely stop normal operation until BlockTime expires.
   
Description
<STRING>
Description of the trigger.
   
ExpireTime
<INTEGER>
Time at which trigger should be terminated if it has not already been activated.
   
EType
cancel, checkpoint, create, end, epoch, fail, hold, migrate, modify, preempt, standing, start, threshold
The type of event that signals that the trigger can fire.
The threshold value applies to reservation triggers, gmetrics on nodes, and gmetrics on virtual containers (VCs). Cancel triggers are the only triggers to fire when the parent object is either canceled or deleted (though its dependencies, if any, must still be satisfied). Hold, preempt, and checkpoint only apply to job triggers. Standing allows regular periodic triggers that fire at regular offsets (standing triggers automatically set the interval and multifire attributes). Standing triggers can be used with only the scheduler; they are not valid for any other object type. End triggers fire when the object finishes, is shut down, or becomes idle. When attached to a job, an end trigger fires when the job ends, the walltime expires, or following both events if the trigger is rearmable.
   
FailOffset
[[HH:]MM:]SS
Specifies the time (in seconds) that the threshold condition must exist before the trigger fires.
   
Flags
(See Table 2.)
Specifies various trigger behaviors and actions.
   
Interval
<BOOLEAN>
When used in conjunction with MultiFire and RearmTime trigger will fire at regular intervals.
Can be used with EType epoch to create a Standing Trigger.
   
MaxRetry
<INTEGER>
Specifies the number of times Actionwill be attempted before the trigger is designated a failure.
If Action fails, the trigger will be restarted immediately (up to MaxRetry times). If it fails more than MaxRetry times, the trigger will be considered to have failed. This restart ignores FailOffset and RearmTime. Multifire does not need to be specified in order to get this behavior.
   
MultiFire
<BOOLEAN>
Specifies whether this trigger can fire multiple times.
This flag is set automatically when the RearmTime attribute is set.
   
Name
<STRING>
Name of trigger
Because Moab uses its own internal ID to distinguish triggers, the Name need not be unique. Only the first 16 characters of Name are stored by Moab.
   
Offset
[-][[[D+:]h+:]m+:]s+
Relative time offset from event when trigger can fire.
Offset cannot be used with cancel.
NoteA negative Offset can only be applied to end triggers.
   
Period
Minute, Hour, Day, Week, Month
Can be used in conjunction with Offset to have a trigger fire at the beginning of the specified period.
Can be used with EType epoch to create a standing trigger.
   
RearmTime
[[HH:]MM:]SS
Time between MultiFire triggers; rearm time is enforced from the trigger event time.
Setting a RearmTime on a trigger automatically sets the Multifire flag to True.
Requires
'.' delimited string
Variables this trigger requires to be set or not set before it will fire.
Preceding the string with an exclamation mark (!) indicates this variable must NOT be set. Used in conjunction with Sets to create trigger dependencies.
   
Sets
'.' delimited string
Variable values this trigger sets upon success or failure.
Preceding the string with an exclamation mark (!) indicates this variable is set upon trigger failure. Preceding the string with a caret (^) indicates this variable is to be exported to the parent object when the current object is destroyed through a completion event. Used in conjunction with Requires to create trigger dependencies.
   
UnSets
'.' delimited string
Variable this trigger destroys upon success or failure.
   
Threshold
{<METRIC>[<METRICNAME>]}{> >= < <= == !=}<FLOAT>
Where <METRIC> is one of:
  • availability
  • backlog
  • gmetric
  • queuetime
  • usage
  • xfactor
Reservation usage threshold - When reservation usage drops below Threshold, trigger will fire.
Threshold usage support is only enabled for reservations and applies to percent processor utilization. gmetric thresholds are supported with job, node, virtual container (VC), credential, and reservation triggers. See Threshold Triggers for more information.
   
Timeout
[+|-][[HH:]MM:]SS
Time allotted to this trigger before it is marked as unsuccessful and its process (if any) killed.
Specifying '+' or a '-' calculates the timeout relative to the parent object's duration.
   

18.3.2 Trigger Flags

Table 2: Trigger Flag Values

Flag Description
If the trigger outputs anything to stderr, Moab will attach this as a message to the trigger object.
If the trigger is still running when the parent object completes or is canceled, the trigger will be killed.
Moab should always checkpoint this trigger. See Checkpointing Triggers for more information.
The trigger will look in the name space of all nodes with the globalvars flag in addition to its own name space. A specific node to search can be specified using the following format:
globalvars+node_id

The globalvars flag must be set via NODECFG on the node in addition to the globalvars flag on the trigger.

NODECFG[node001] VARIABLE=var0 FLAGS=globalvars
NODECFG[node002] VARIABLE=var1 FLAGS=globalvars
Trigger is periodic.
Trigger can fired multiple times.
Trigger passes its parent's object XML information into the trigger's stdin. This only works for exec triggers with reservation and job type parents.
The trigger's stdout will be monitored.
The trigger resets if the object it is attached to is modified, even if multifire is not set.
The trigger will execute under the user ID of the object's owner. If the parent object is sched, the user to run under may be explicitly specified using the format user+<username>, for example flags=user+john:
Note When specifying multiple flags, each flag can be delimited by colons (:) or with square brackets ([ and ]); for example:

Flags=[user][cleanup][checkpoint] or Flags=user:cleanup:checkpoint

The following is an example of using objectxmlstdin with a job:

<job AllocNodeList="h9:1"
BlockReason="State:non-idle state 'Running'" CmdFile="/dev/null"
EEDuration="-1" EState="Running" EffPAL="[base][SHARED][hyper]"
Flags="GLOBALQUEUE,NORMSTART,SYSTEMJOB" GAttr="DEFAULT,setup"
GJID="Moab.1.setup" Group="company" IWD="/tmp/ByLLl2wv"
JobGroup="Moab.1" JobID="Moab.1.setup" JobName="bob"
PAL="[base][SHARED][hyper]" RM="internal" ReqAWDuration="300"
ReqProcs="1" RsvStartTime="1320334564" SRMJID="Moab.1.setup"
StartCount="1" StartPriority="1" StartTime="1320334564"
StatMSUtl="0.000" StatPSUtl="0.000" State="Running"
SubmissionTime="1320334564" SubmitLanguage="PBS"
SubmitString="\START\20\20\20\20\20\20\20\20\20\20\20\20\20\20\20\20\20\20\20\20\20\20\20\20\20\0a\23PBS\20-l\20template=VMTracking\0a\23PBS\20-l\20nodes=1\0a\23PBS\20-l\20opsys=linux\0a\0a\23PBS\20-W\20x=template:VMTracking\0a/dev/null\0a\0a"
SuspendDuration="0" TaskMap="h9" TemplateSetList="setup" UMask="18"
User="jgardner" VMUsagePolicy="createvm">
<trig AType="exec" Action="$HOME/vm.py $MASTERHOST $VMID $*.SM"
ETime="1320334564" EType="start"
Flags="[genericsysjob][globaltrig][objectxmlstdin]"
IsComplete="FALSE" LaunchTime="1320334564" OID="Moab.1.setup"
OType="job" Sets="^HV.!^HV" State="Launched" TID="10"
Timeout="300"></trig>
<req Index="0" ReqNodeMem=">=0" ReqNodeProc=">=0"
ReqNodeSwap=">=0" ReqOpsys="linux" ReqPartition="hyper"
ReqProcPerTask="1" TCReqMin="1*"></req>
<Variables>
<Variable name="VMID">vm1</Variable>
</Variables>
<system CompletionPolicy="generic" JobType="generic"></system>
</job>

See Also

Copyright © 2012 Adaptive Computing Enterprises, Inc.®