Knowledge Center Contents Previous Next Index |
Time Syntax and Configuration
Contents
- Specifying Time Values
- Specifying Time Windows
- Specifying Time Expressions
- Using Automatic Time-based Configuration
Specifying Time Values
To specify a time value, a specific point in time, specify at least the hour. Day and minutes are optional.
Time value syntax
time
=hour
|hour
:minute
|day
:hour
:minute
hour
Integer from 0 to 23, representing the hour of the day.
minute
Integer from 0 to 59, representing the minute of the hour.
If you do not specify the minute, LSF assumes the first minute of the hour (:00).
day
Integer from 0 to 7, representing the day of the week, where 0 represents every day, 1 represents Monday, and 7 represents Sunday.
If you do not specify the day, LSF assumes every day. If you do specify the day, you must also specify the minute.
Specifying Time Windows
To specify a time window, specify two time values separated by a hyphen (-), with no space in between.
time_window
=begin_time
-end_time
Time format
Times are specified in the format:
[day
:]hour[:minute
]where all fields are numbers with the following ranges:
day of the week
: 0-6 (0 is Sunday)hour
: 0-23minute
: 0-59Specify a time window one of the following ways:
hour
-hour
hour
:minute
-hour
:minute
day
:hour
:minute
-day
:hour
:minute
The default value for minute is 0 (on the hour); the default value for day is every day of the week.
You must specify at least the hour. Day of the week and minute are optional. Both the start time and end time values must use the same syntax. If you do not specify a minute, LSF assumes the first minute of the hour (
:00
). If you do not specify a day, LSF assumes every day of the week. If you do specify the day, you must also specify the minute.You can specify multiple time windows, but they cannot overlap. For example:
timeWindow(8:00-14:00 18:00-22:00)is correct, but
timeWindow(8:00-14:00 11:00-15:00)is not valid.
Examples of time windows
Daily window
To specify a daily window omit the day field from the time window. Use either the
hour-hour
orhour:minute-hour:minute
format. For example, to specify a daily 8:30 a.m. to 6:30 p.m window:8:30-18:30
Overnight window
To specify an overnight window make
time1
greater thantime2
. For example, to specify 6:30 p.m. to 8:30 a.m. the following day:18:30-8:30
Weekend window
To specify a weekend window use the day field. For example, to specify Friday at 6:30 p.m to Monday at 8:30 a.m.:
5:18:30-1:8:30
Specifying Time Expressions
Time expressions use time windows to specify when to change configurations.
Time expression syntax
A time expression is made up of the
time
keyword followed by one or more space-separated time windows enclosed in parenthesis. Time expressions can be combined using the&&
,||
, and!
logical operators.The syntax for a time expression is:
expression = time(time_window
[time_window
...]) | expression && expression | expression || expression | !expressionExample
Both of the following expressions specify weekends (Friday evening at 6:30 p.m. until Monday morning at 8:30 a.m.) and nights (8:00 p.m. to 8:30 a.m. daily).
time(5:18:30-1:8:30 20:00-8:30) time(5:18:30-1:8:30) || time(20:00-8:30)Using Automatic Time-based Configuration
Variable configuration is used to automatically change LSF configuration based on time windows. It is supported in the following files:
lsb.hosts
lsb.params
lsb.queues
lsb.resources
lsb.users
lsf.licensescheduler
You define automatic configuration changes in configuration files by using if-else constructs and time expressions. After you change the files, reconfigure the cluster with the
badmin reconfig
command.The expressions are evaluated by LSF every 10 minutes based on
mbatchd
start time. When an expression evaluates true, LSF dynamically changes the configuration based on the associated configuration statements. Reconfiguration is done in real time without restartingmbatchd
, providing continuous system availability.In the following examples, the
#if
,#else
,#endif
are not interpreted as comments by LSF but as if-else constructs.lsb.hosts example
Begin Host HOST_NAME r15s r1m pg host1 3/5 3/5 12/20 #if time(5:16:30-1:8:30 20:00-8:30) host2 3/5 3/5 12/20 #else host2 2/3 2/3 10/12 #endif host3 3/5 3/5 12/20 End Hostlsb.params example
# if 18:30-19:30 is your short job express period, but # you want all jobs going to the short queue by default # and be subject to the thresholds of that queue # for all other hours, normal is the default queue #if time(18:30-19:30) DEFAULT_QUEUE=short #else DEFAULT_QUEUE=normal #endiflsb.queues example
Begin Queue ... #if time(8:30-18:30) INTERACTIVE = ONLY # interactive only during day shift #endif ... End Queuelsb.resources example
# Example: limit usage of hosts in 'license1' group and time based configuration # - 10 jobs can run from normal queue # - any number can run from short queue between 18:30 and 19:30 # all other hours you are limited to 100 slots in the short queue # - each other queue can run 30 jobs Begin Limit PER_QUEUE HOSTS SLOTS # Example normal license1 10 # if time(18:30-19:30) short license1 - #else short license1 100 #endif (all ~normal ~short) license1 30 End Limitlsb.users example
From 12 - 1 p.m. daily, user
smith
has 10 job slots, but during other hours, user has only 5 job slots.Begin User USER_NAME MAX_JOBS JL/P #if time (12-13) smith 10 - #else smith 5 - default 1 - #endif End Userlsf.licensescheduler example
Begin Feature NAME = f1 #if time(5:16:30-1:8:30 20:00-8:30) DISTRIBUTION=Lan(P1 2/5 P2 1) #elif time(3:8:30-3:18:30) DISTRIBUTION=Lan(P3 1) #else DISTRIBUTION=Lan(P1 1 P2 2/5) #endif End FeatureCreating if-else constructs
The if-else construct can express single decisions and multi-way decisions by including elif statements in the construct.
If-else
The syntax for constructing if-else expressions is:
#if time(expression
)statement
#elsestatement
#endifThe
#endif
part is mandatory and the#else
part is optional.For syntax of a time expression, see Specifying Time Expressions.
elif
The
#elif
expressions are evaluated in order. If any expression is true, the associated statement is used, and this terminates the whole chain.The
#else
part handles the default case where none of the other conditions are satisfied.When you use
#elif
, the#else
and#endif
parts are mandatory.#if time(expression
)statement
#elif time(expression
)statement
#elif time(expression
)statement
#elsestatement
#endifVerify configuration
- Use the following LSF commands to verify configuration:
bhosts
bladmin ckconfig
blimits -c
blinfo
blstat
bparams
bqueues
bresources
busers
Platform Computing Inc.
www.platform.com |
Knowledge Center Contents Previous Next Index |