[ Platform Documentation ] [ Title ] [ Contents ] [ Previous ] [ Next ] [ Index ]
- Specifying Time Values
- Specifying Time Windows
- Specifying Time Expressions
- Automatic Time-based Configuration
[ Top ]
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:minuteinteger from 0 to 23, representing the hour of the day.
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).
integer from 0 (Sunday) to 6 (Saturday), representing the day of the week.
If you do not specify the day, LSF assumes every day. If you do specify the day, you must also specify the minute.
[ Top ]
Specifying Time Windows
To specify a time window, specify two time values separated by a hyphen (-), with no space in between.
time_window = time1-time2Time 1 is the start of the window and time 2 is the end of the window. Both time values must use the same syntax. There are 3 different ways to specify a time window:
Examples of time windows
To specify a daily window omit the day field from the time window. Use either the
hour-hourorhour:minute-hour:minuteformat. For example, to specify a daily 8:30 a.m. to 6:30 p.m window:8:30-18:30To specify an overnight window make
time1greater thantime2. For example, to specify 6:30 p.m. to 8:30 a.m. the following day:18:30-8:30To 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[ Top ]
Specifying Time Expressions
Time expressions use time windows to specify when to change configurations. For more details on time windows, see Specifying Time Windows.
Time expression syntax
A time expression is made up of the
timekeyword 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 | !expressionBoth 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)[ Top ]
Automatic Time-based Configuration
Variable configuration is used to automatically change LSF configuration based on time windows. It is supported in the following files:
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 reconfigcommand.The expressions are evaluated by LSF every 10 minutes based on
mbatchdstart 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 example, the
#if,#else,#endifare not interpreted as comments by LSF but as if-else constructs.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 HostBegin Queue ... #if time(8:30-18:30) INTERACTIVE = ONLY # interactive only during day shift #endif ... End QueueCreating if-else constructs
The if-else construct can express single decisions and multi-way decisions by including elif statements in the construct.
The syntax for constructing if-else expressions is:
#if time(expression) statement #else statement #endifThe
#endifpart is mandatory and the#elsepart is optional.For syntax of a time expression, see Specifying Time Expressions.
The
#elifexpressions are evaluated in order. If any expression is true, the associated statement is used, and this terminates the whole chain.The
#elsepart handles the default case where none of the other conditions are satisfied.When you use
#elif, the#elseand#endifparts are mandatory.#if time(expression) statement #elif time(expression) statement #elif time(expression) statement #else statement #endifVerifying configuration
Use the following LSF commands to verify configuration:
[ Top ]
[ Platform Documentation ] [ Title ] [ Contents ] [ Previous ] [ Next ] [ Index ]
Date Modified: January 12, 2004
Platform Computing: www.platform.com
Platform Support: support@platform.com
Platform Information Development: doc@platform.com
Copyright © 1994-2004 Platform Computing Corporation. All rights reserved.