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.
- 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
}
}
}