Resources That Change Over Time

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:
  • 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.

The TIMEVAR procedure is used to initialize of 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
       }
    }
}
Note: If you use TIMEVAR in an initJobClass{} procedure as above, remember to restart the vovresourced daemon after changing any of the clauses to put them into effect.