Resources That Change Over Time
TIMEVAR should be defined in the $SWD/config/timevars.tcl file.
The procedure TIMEVAR takes two arguments: a label and a list. The list is similar to a switch context, an even number of elements. In each pair, the first element is a time condition and the second element is an executable script.
- HH:MM-HH:MM
- Sun, Mon, Tue, Wed, Thu, Fri or Sat
The example below utilizes TIMEVAR to control the level of the
hsim
simulation resource. Between 2:00am and 6:00am on
weekdays, the available resources are restricted. In this example, the restriction
is an allowance that allows nightly backups to finish. Any other time, the number of
allowed resources is doubled.
# Fragment of the definition of the jobclass 'hsim'
proc initJobClass {} {
TIMEVAR hsim {
Sat,Sun {
vtk_resourcemap_set_limit Limit:u_hsim_@USER@ 20
}
02:00-06:00 {
vtk_resourcemap_set_limit Limit:u_hsim_@USER@ 10
}
default {
vtk_resourcemap_set_limit Limit:u_hsim_@USER@ 20
}
}
}
A new liveness task reads the timevars.tcl file and processes the TIMEVAR procedure. The task script is live_execute_timevars.tcl, and it is automatically enabled when you start Accelerator on version 2021.2.0. Other products can enable this task, if desired, by manually copying the task script from $VOVDIR/etc/liveness into $SWD/tasks.