The Timing Parameters system table controls several scheduler settings and other computational parameters.
Defining the Scheduler Mode
The Scheduling-mode attribute defines the timing mode of the scheduler (how the G2 clock ticks), and how tasks are scheduled. G2 has three scheduler modes:
real time
simulated time
as fast as possible
Scheduler-mode attribute. real time, a clock tick corresponds to one second of real time. If G2 completes all of the tasks that are scheduled for a particular second before the second ends, G2 waits until the second is over before starting to process tasks scheduled for the next second.If G2 has tasks left over at the end of a second, it begins processing tasks scheduled for the next second, anyway. When this happens, G2 schedules the remaining old tasks with the tasks scheduled for the new second, preserving the priority of all tasks, and preserving temporal ordering within priorities. G2 performs tasks from the previous second before it performs tasks with an equal priority from the next second. It does not, however, perform lower priority tasks from the previous second before higher priority tasks from the next second. The default mode is
real time.
simulated time, G2 completes all of the tasks scheduled for one second before moving on to the tasks scheduled for the next second. As a result, a second of simulated time may last longer than a second of real time. Consequently, the simulator clock may run slower than the real-time clock.If you pause a KB, reach a breakpoint, or suspend G2, the simulated time stops. When you resume, the simulated time does not leap ahead to match real time. Thus, simulated time lags behind real time as a result of such interruptions.
Scheduler-mode is set to as-fast-as-possible, and all tasks in the current task queue are complete, the scheduler checks to see if tasks are scheduled on the future task queue. If tasks are scheduled, the scheduler ticks the clock forward all the way to the time of the next scheduled task and starts its execution cycle. If no tasks are in the future task queue, the scheduler becomes idle and does not tick the clock until tasks appear on the future task queue. For more information about the scheduler and the current and future task queues, see Scheduling and Prioritizing Tasks.
As fast as possible time is a convenient scheduler mode for discrete event simulations, so that tests that might otherwise require hours to complete require only minutes.
Caution: The G2 clock has a limit of 17 calendar years. Reaching that limit, for example when running simulations using the as fast as possible mode, will abort G2.
Specifying the Minimum Scheduling Interval
The Minimum-scheduling-interval attribute specifies the length of time for a clock tick, which determines how long the scheduler has to perform tasks between clock ticks. The default value is the time interval 1 second. Possible values for the attribute are any non-negative-number time interval, or continuous. continuous as the interval), the interval value must be a multiple of a second, or divide evenly into a second. If you enter another kind of value, G2 rounds the value up to the next valid minimum scheduling interval. For example, if you enter .333 seconds as the minimum scheduling interval, G2 rounds that number up to .334 upon completing the edit. Entering .666 seconds causes G2 to behave as if the value were 1.0, rounding it to 1 second. Minimum-scheduling-interval attribute is set to a time interval, the scheduler advances the G2 clock by multiples of that amount (for instance, .333 seconds, or 1 second). When a time interval is in effect, G2 rounds the execution times of scheduled tasks up to the next clock tick. For example, if the current subsecond time is 5.0, and the Minimum-scheduling-interval is set to 0.25 seconds, G2 schedules the action start update report after 0.6 seconds to run at 5.75 seconds, current subsecond time. continuous, the scheduler ticks the clock at the task schedule times, and remains idle between those tasks. Continuous scheduling incurs clock ticks of various lengths, as tasks are scheduled. For example, if the scheduler ticks the clock, completes the tasks on the current task queue, and then sees that there is something scheduled on the future task queue in .2 seconds, the clock ticks at that time. Conversely, if nothing is scheduled on the future task queue for 5 minutes after the current task completes, the scheduler does not tick the clock until then. Controlling the G2 Sleep Interval Under VMS
When G2 has nothing to do, it relinquishes the CPU (sleeps) until some event awakens it. G2 is event-driven for all types of events on all platforms except VMS: it can sleep indefinitely, and wakes as soon as an event gives it something to do.Milliseconds-to-sleep-when-idle attribute sets the maximum time, in milliseconds, that G2 can sleep under VMS. When this time expires, G2 wakes and polls for GUI events. The attribute has no effect on G2's processing speed: it is strictly a timeout that triggers polling when G2 is idle. Setting Milliseconds-to-sleep-when-idle has no effect except under VMS.use default, is 40 milliseconds. By adjusting this value you can trade off between the CPU load when G2 is idle and G2's response time to GUI events. percent-run-time meter shows higher and higher values. If the sleep interval is zero, the meter returns 100.0, and G2 does not sleep at all. The result is maximum GUI response time, and considerable waste of CPU cycles. Specifying the G2-Meter Lag Time
The Meter-lag-time attribute tells G2 how many seconds of data to use when computing values for G2 meters. Meter-lag-time attribute controls how many seconds worth of data G2 uses in evaluating each meter.Meter-lag-time attribute holds a value of 0 seconds or any longer time interval. If it holds 0 seconds, G2 meters reflect only the activity in the most recently completed clock tick. As its value increases, the values of G2 meters change more smoothly over time.
|
new lagged value =
|
(1 - ) * previous lagged value + ( * current value)
|
where:
|
Is equal to min (1.0, clock tick length / meter lag time)
|
This is an Euler approximation of first-order delay. Note that if the meter lag time is zero or is less than the latest clock tick length, then
= 1.0, and the new lagged value = the current value, with no lag. Specifying the Interface Mode to Use
The Interface-mode attribute specifies which interface mode G2 uses, as follows:
Adjusting the G2 Clock
The Clock-adjustment-in-minutes attribute adjusts G2's clock as follows:
Controlling the Foreign Function Timeout Interval
The Foreign-function-timeout-interval attribute controls the interval of time that G2 waits for a return value after calling a foreign function. If the interval is exceeded, G2 signals an error. Specify an integer to represent the interval in seconds.
Note: Setting the Timeout-interval attribute of an individual foreign function definition overrides the value set for the Foreign-function-timeout-interval attribute of the Timing Parameters system table for that function.
Controlling Foreign Image Reconnection
The Reconnect-to-foreign-image-after-timeout? attribute controls whether G2 reconnects to a foreign image (a group of foreign functions) after the foreign function timeout interval expires. If the value for this attribute is yes, G2 makes a single attempt to reconnect to the foreign image. If the value is no, G2 does not attempt to reconnect. Setting the Uninterrupted Procedure Limit
The Uninterrupted-procedure-execution-limit attribute sets a limit on the amount of execution time a procedure can use without entering a wait state that allows other processing to occur. Specify an integer to represent the number of seconds, or none. The actual limit for this attribute is 24 hours. Note that setting the execution time limit locally for a procedure overrides the limit set for this attribute. Class-Specific Attributes of Timing Parameters
The class-specific attributes of the Timing Parameters system table are: