Moab Workload Manager

19.3 Trigger Components

19.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 and gmetrics on nodes. 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.
   
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 Action will 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.
Behavior will vary depending on which object and event types are associated with the trigger. For more information, see MultiFire Trigger on a Reservation.
   
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
[-][[HH:]MM:]SS
Relative time offset from event when trigger can fire.
Offset cannot be used with cancel.

Note Only a negative Offset can be used with 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.
Behavior will vary depending on which object and event types are associated with the trigger. For more information, see MultiFire Trigger on a Reservation.
   
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
  • statistic
  • 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, credential, and reservation triggers. See 19.4.3 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.
   

19.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
Trigger is periodic.
Trigger can fire multiple times.
Trigger passes its parent's object XML information into the trigger's stdin. This only works for exec triggers with reservation type parents.
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

See Also