Learn more about Platform products at http://www.platform.com

[ Platform Documentation ] [ Title ] [ Contents ] [ Previous ] [ Next ] [ Index ]



Time Syntax and Configuration


Contents

[ 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: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 (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-time2

Time 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

Daily window

To specify a daily window omit the day field from the time window. Use either the hour-hour or hour: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 than time2. 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

[ 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 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
             | !expression

Example

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)

[ 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 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 restarting mbatchd, providing continuous system availability.

lsb.hosts example

In the following example, the #if, #else, #endif are 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 Host

lsb.queues example

Begin Queue
...
#if time(8:30-18:30)
   INTERACTIVE  = ONLY  # interactive only during day shift
#endif
...
End Queue

Creating 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
#else
statement
#endif

The #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
#else
statement
#endif

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