Fork me on GitHub

hsSim

The scheduling optimization part of the COBRA contains three analysis levels to select the optimal scheduling algorithm for a given task-set. The second level of analysis is by simulation, and therefor we need a simulator which simulate the schedule of the real-time tasks. Because we optimize in the first place towards the computing resources for real-time virtualization, a minimum of two level scheduling are present due to the extra software layer introduced by virtualization. Therefore we need a simulator which can simulate an n-level hierarchical scheduling structure. We modified the hsSim simulator (link). hsSim is an object-oriented n-level hierarchical scheduling simulator with a broad support of different scheduling policies. The number of scheduling levels is not limited to two. The following modifications and features are added to make to simulator compatible to our framework:

  • Support for the generated task sets from the task-set generator.
  • Support for the periodic interface tasks generated by the CARTS tool.
  • Millisecond to microsecond precision to support a task with microsecond presicion.
  • Implemented the support of partitioned multiprocessor scheduling algorithms.
  • Added a new scheduling algorithm: the McNaughton Algorithm.
  • Added a new logger to log the scheduling states in the same format as the other tools in three level analysis methodology. This logger logs both task schedule and VCPU schedule.

Prerequisites

Because the simulator is written in Java and exported as an executable JAR file, the only prerequisite is the Java JRE or JDK. hsSim is tested with Java JDK version 1.7.


Using the simulator

To use hsSim you can download the JAR file or the source code. When you have the JAR file, you need to pass 4 arguments to start the simulation. The command is:

java -jar hsSim.jar taskset.xml interfaces.xml 4 30000

This will start the simulation of the tasks (TaskSet.xml) with the right interfaces (interfaces.xml) on the selected number of physical processors (10) for the selected simulation time (30 000 ms). The output of this simulation is a small report and the log files. The report of a simulation contains the selected scheduling algorithms for the system and the virtual machines and the time it took the simulate the whole system.

Simulation information:
Scheduler system: GEDF
Scheduler VM1: gRM
Scheduler VM2: gEDF
Scheduler VM3: pEDF
Scheduler VM4: pRM
Time to simulate: 30000 ms
Simulation started
Simulation finished
Simulation execution time = 428178 ms

Two directories will be created in the same directory of the executable JAR file. These directories contain the time traces of both real-time tasks and the interface tasks (virtual processors). For each physical processor a log file is created, which contains the trace events happened on the respectively processor. Four different trace events can be generated for each job of a task:

  • RELEASE: the moment when a job arrives in the run queue, waiting to be executed.
  • SWITCH_TO: the moment when a job gets removed from the run queue and gets executed.
  • SWITCH_AWAY: the moment when a job gets preempted by another job or the processor where it is executing on idled. The job is added to the run queue.
  • COMPLETION: the moment when a job is finished.

Here you can find an example task set with it corresponding interface tasks for each VM.