How does the SimWB Scheduler resolve the execution order of non-base-rate task dependencies?
Contents
Question
How does the SimWB Scheduler resolve the execution order of non-base-rate task dependencies?
Answer
When a test contains models/tasks that depend on other tasks and they all run at the base rate, it is easy to schedule. SimWB runs the task that has no dependencies first and then the next one and so on. However, SimWB provides a way to run tasks at multiple of base rate using Frequency Division setting in test configuration. What happens when a test has tasks that do not run on the base rate and has dependencies? What if the tasks that depend on each other has different frequency division settings? Even though one task may depend on another, it is possible that the task it is waiting on may not execute in the current frame. There are multiple ways of solving this issue. What we do is to make the dependency valid on the frame where a given task finishes. not, when the tasks start. This may cause confusion if user assumes a different way of how things should be than how it actually is. Following examples will shed light on the inner workings of SimWB scheduler:
Example 1
See Figure 1 below for the setup of the test for this example. In this test, a fast rate task (ModelC_1 Freq.Div=1) depends on slower task (ModelB_1 Freq.Div=3). In this scenario, both ‘ModelC_1’ and ‘ModelB_1’ will start at the same time at frame 1. However, the task ‘ModelB_1’ started at frame 1 is expected to finish at frame 3. And at the same frame, the task ‘ModelC_1’ is supposed to start. So at frame 3, ‘ModelC_1’ will wait for ‘ModelB_1’ to finish before starting. See Figure 2. This is the way SimWB scheduler is designed.
Example 2
Consider another scenario. In this test, we have fastest task (ModelC_1 Freq.Div=1) depend on two slower tasks(ModelA_1 Freq.Div=2 and ModelB_1 Freq.Div=3). See Figure 3 for the setup of the test for this example. In this scenario, all the tasks ‘ModelA_1’, ‘ModelB_1’, and ‘ModelC_1’ will start at the same time at frame 1. However at frame 2, the task ‘ModelA_1’ started at frame 1 is expected to finish. In the same frame, ‘ModelC_1’ is supposed to start as well. So at frame 2, ‘ModelC_1’ will wait for ‘ModelA_1’ to finish before starting. Similarly the task ‘ModelB_1’ started at frame 1 is expected to finish at frame 3. And at the same frame 3, the task ‘ModelC_1’ is supposed to start. So at frame 3, ‘ModelC_1’ will wait for ‘ModelB_1’ to finish before starting. The frame 6 is the interesting case. The task ‘ModelA_1’ started at frame 5 and the task ‘ModelB_1’ started at frame 4 are expected to finish at this frame. At the same time ‘ModelC_1’ is also expected to start. According to the test setup, the task ‘ModelC_1’ should wait for both ‘‘ModelA_1’ and ‘ModelB_1’. So in this frame 6, ‘ModelC_1’ will wait for whichever task that finfishes last. See Figure 4.