Trigger Components
Moab Workload Manager®

19.3 Trigger Components

19.3.1 Trigger Attributes

Table1: Trigger Attributes
Name Description Possible Values Usage Notes
AType Specifies what kind of action the trigger will take when it fires. cancel
changeparam
jobpreempt
mail
exec
query
internal
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.

query allows a trigger to import variables from another object.
Action 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). String  
BlockTime Time (in seconds) Moab will suspend normal operation to wait for trigger execution to finish. [[HH:]MM:]SS Use caution as Moab will completely stop normal operation until BlockTime expires.
Description A string containing a description of the trigger.   May not contain any quotes (" or ').
ExpireTime Time at which trigger should be terminated if it has not already been activated.    
EType The type of event that signals that the trigger can fire. cancel
checkpoint
create
end
epoch
fail
hold
migrate
modify
preempt
standing
start
threshold
threshold only applies to reservation triggers

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).
FailOffset Specifies the time (in seconds) that the threshold condition must exist before the trigger fires. [[HH:]MM:]SS  
Flags Specifies various trigger behaviors and actions. (See Table 2.)  
Interval When used in conjunction with MultiFire and RearmTime trigger will fire at regular intervals. <BOOLEAN> Can be used with EType epoch to create a Standing Trigger.
MaxRetry Specifies the number of times Action will be attempted before the trigger is designated a failure. Integer 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 Specifies whether this trigger can fire multiple times. <BOOLEAN>  
Name Name of trigger String 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 Relative time offset from event when trigger can fire. [-][[HH:]MM:]SS Offset cannot be used with cancel.

NOTE: Only a negative Offset can be used with end triggers.
Period Can be used in conjunction with Offset to have a trigger fire at the beginning of the specified period. Hour
Day
Week
Month
Can be used with EType epoch to create a standing trigger.
RearmTime Time between MultiFire triggers - rearm time is enforced from trigger launch to trigger launch. [[HH:]MM:]SS  
Requires Variables this trigger requires to be set or not set before it will fire. '.' delimited string Preceding the string with an exclamation mark (!) indicates this variable must NOT be set.

Used in conjunction with Sets to create trigger dependencies.
Sets Variable values this trigger sets upon success or failure. '.' delimited string 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 Variable this trigger destroys upon success or failure. '.' delimited string
Threshold Reservation usage threshold - When reservation usage drops below Threshold, trigger will fire. {<METRIC>[<METRICNAME>]}{> >= < <= == !=}<FLOAT>
Where <METRIC> is one of
     usage
     gmetric
     availability
     backlog
     xfactor
     queuetime
Threshold usage support is only enabled for reservations and applies to percent processor utilization. gmetric thresholds are supported with job, node, credential, and reservation triggers. (See 19.4.3 Threshold Triggers for more information.)
Timeout Time allotted to this trigger before it is marked as unsuccessful and its process (if any) killed. [+|-][[HH:]MM:]SS Specifying '+' or a '-' calculates the timeout relative to the parent object's duration.

20.3.1  Trigger Flags

Table 2: Trigger Flag Values
Flag Description
attacherror If the trigger outputs anything to stderr, Moab will attach this as a message to the trigger object.
cleanup If the trigger is still running when the parent object completes or is canceled, the trigger will be killed.
globalvars 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
interval Trigger is periodic.
multifire Trigger can fired multiple times.
probe The trigger's stdout will be monitored.
probeall The trigger's stdout will be monitored.
user 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][probe] or Flags=user:cleanup:probe

See Also