Preemption Plans
Preemption plans are the building blocks of preemption methods and allow the implementation of custom, complex multi-step preemption sequences.
Preemption plans are defined in the SWD/policy.tcl file, using
the following configuration command:
vtk_preemptionplan_set <METHOD-NAME> <PREEMPTION-PLAN>
A preemption plan is a space-separated list of instructions. Each instruction
consists of 3 colon-separated fields: TIME
, STATE
,
and ACTION
TIME
can be: *
= any time- N = N seconds after start of preemption has begun. More specifically, this is the longest time we would wait for the job to reach the required state. If the specified time has elapsed and the job is not in the required state, the preemption plan is considered to have failed.
STATE
can be:*
= any stateSUSPENDED
= the job is known to be in a suspended stateRETRACING
= the job is known to be still retracing (orange)RUNNING
= the job is known to be still running (yellow)WITHDRAWN
= the job has been killed by preemptionLMREMOVED
= the job has the property PREEMPT_LMREMOVEDWAIT
= enter a wait state for the specified number of seconds in the TIME fieldSSRSUSPENDED
= the job has the property SSR_STATUS (SmartSuspend integration) (OBSOLETE)
ACTION
can be: NOP
= No operation, mainly used for no-op wait statesSUSPEND
= Suspend job (SIGSTOP)SIGTSTP
orTSTP
= SendSIGTSTP
SIGUSR1
orUSR1
= SendSIGUSR1
SIGUSR2
orUSR2
= SendSIGUSR2
EXT,<SIG>[,includeRx][,excludeRx]
= Send a signal using the EXTernal methodLMREMOVE
= Remove licenses using vovlmremoveNOLMREMOVE
= Do not call the utility vovlmremove on the preempted job. This is essentially the same asNOP
DONE
= Similar toNOP
but also signifies the end of preemption the planRESUBMIT
= Resubmit a withdrawn job (not yet implemented)
The legacy method
MODELSIM
is essentially a one-step preemption plan
of the form *:*:EXT,TSTP,vish
, which means "at any time, in any
state, send the signal TSTP
to the vish process.
Note: The preemption will fail if the time has passed and an expected state have
not been attained. In the following example, if the job is not suspended at 10
seconds, or if the license is not removed at 20 seconds, the preemption will
fail.
*:*:SUSPEND 10:SUSPENDED:LMREMOVE 20:LMREMOVED:DONE
Examples
Below are some examples of 3-step preemption
plans:
*:RETRACING:TSTP 10:WAIT:SUSPEND 15:SUSPENDED:DONE
- At the beginning, if the job is RETRACING, send its process tree the TSTP (temporary stop) signal.
- Wait at least 10 seconds from preemption start and send the SUSPEND signal.
- Up to 15 seconds from preemption start, if the state is SUSPENDED, the preemption is done. Otherwise, preemption fails.
*:*:SUSPEND 10:SUSPENDED:LMREMOVE 20:LMREMOVED:DONE
- At any time, in any state SUSPEND a job.
- At any time up to 10 seconds from preemption start, if the job is SUSPENDED, remove license(s) from the job.
- At any time up to 20 seconds from preemption start, if the licenses have been removed, preemption is done. Otherwise, preemption fails.
*:*:EXT,HUP,licd 10:*:EXT,TSTP,licd 20:SUSPENDED:LMREMOVE
- At any time, in any state, use the external method to send the HUP (hangup) signal to the licd process.
- At any time up to 10 seconds from preemption start, whether or not the previous step (HUP) was successful, use the external method to send the TSTP signal to the licd process.
- At any time up to 20 seconds from preemption start, if the job is SUSPENDED, remove license(s) from the job.