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.

The time condition can be one of the following:
  • Sun, Mon, Tue, Wed, Thu, Fri or Sat
The TIMEVAR procedure is used to initialize a jobclass, where it is parsed by vovresourced; the conditions in the TIMEVAR clauses are evaluated at the rate of the refresh cycle for vovresourced, which is controlled by the variable RESD(refresh) and is typically 60000 (one minute, in milliseconds). The first condition that is true is the condition that is executed.
# 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

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.

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.