0% found this document useful (0 votes)
91 views31 pages

Simso: A Simulation Tool To Evaluate Real-Time Multiprocessor Scheduling Algorithms

The document describes a simulation tool called SimSo that is used to evaluate real-time multiprocessor scheduling algorithms. SimSo allows users to configure systems, simulate scheduling configurations, and view results. It can be used via a graphical interface or as a Python module to automate multiple simulations and collect metrics. The document provides an overview of SimSo and gives an example of experimenting with it.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
91 views31 pages

Simso: A Simulation Tool To Evaluate Real-Time Multiprocessor Scheduling Algorithms

The document describes a simulation tool called SimSo that is used to evaluate real-time multiprocessor scheduling algorithms. SimSo allows users to configure systems, simulate scheduling configurations, and view results. It can be used via a graphical interface or as a Python module to automate multiple simulations and collect metrics. The document provides an overview of SimSo and gives an example of experimenting with it.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 31

Objective

SimSo
Example
Conclusion and Future Work

SimSo: A Simulation Tool to Evaluate Real-Time


Multiprocessor Scheduling Algorithms

Maxime Chéramy, Pierre-Emmanuel Hladik and


Anne-Marie Déplanche
[email protected]

July 8, 2014
5th International Workshop on Analysis Tools
and Methodologies for Embedded and Real-time Systems (WATERS)

1 / 31 Chéramy, Hladik and Déplanche SimSo: Simulation of Real-Time Scheduling


Objective
SimSo
Example
Conclusion and Future Work

1 Objective

2 SimSo

3 Example

4 Conclusion and Future Work

2 / 31 Chéramy, Hladik and Déplanche SimSo: Simulation of Real-Time Scheduling


Objective
SimSo
Example
Conclusion and Future Work

1 Objective

2 SimSo

3 Example

4 Conclusion and Future Work

3 / 31 Chéramy, Hladik and Déplanche SimSo: Simulation of Real-Time Scheduling


Objective
SimSo
Example
Conclusion and Future Work

Problem Denition

Schedule
τ1 τ2 CPU1 τ1 τ2 τ3 τ1
t
τ3 τ4

CPU2 τ5 τ4 τ2 τ5
τ5 t

Independent Multiprocessor
and periodic tasks Architecture

4 / 31 Chéramy, Hladik and Déplanche SimSo: Simulation of Real-Time Scheduling


Objective
SimSo
Example
Conclusion and Future Work

Many Real-Time Multiprocessor Scheduling Algorithms

Objective
To evaluate their behavior and performance.
5 / 31 Chéramy, Hladik and Déplanche SimSo: Simulation of Real-Time Scheduling
Objective
SimSo
Example
Conclusion and Future Work

Several Approaches

Theoretical analysis
Good way to prove schedulability, but hard to take into
consideration some aspects
Empirical studies on real systems
Realistic. But require a signicant amount of time and skills to
handle the tools and the results are specic to a certain platform
Simulations
Easy to use and very exible but less accurate than a real system

6 / 31 Chéramy, Hladik and Déplanche SimSo: Simulation of Real-Time Scheduling


Objective
SimSo Overview
Example Experimenting with SimSo
Conclusion and Future Work

1 Objective

2 SimSo

3 Example

4 Conclusion and Future Work

7 / 31 Chéramy, Hladik and Déplanche SimSo: Simulation of Real-Time Scheduling


Objective
SimSo Overview
Example Experimenting with SimSo
Conclusion and Future Work

SimSo : A Simulator to Evaluate Scheduling Algorithms

SimSo 1

I Simulator dedicated to the study of new scheduling algorithms.


I Designed to be easy to use, and also easy to extend for new needs.
I Open Source : http://homepages.laas.fr/mcheramy/simso/

1
Simulation of Multiprocessor Scheduling with Overheads
8 / 31 Chéramy, Hladik and Déplanche SimSo: Simulation of Real-Time Scheduling
Objective
SimSo Overview
Example Experimenting with SimSo
Conclusion and Future Work

Two ways of using SimSo

Using the graphical user interface


I Congure a new system
I Save and load congurations
(in an XML le)
I Simulate a conguration
I Display the resulting schedule as a
Gantt chart
I Access usual metrics

Easy to use Good way to debug an algorithm


Impossible to automate multiple simulations
May not give you the metric you are looking for
9 / 31 Chéramy, Hladik and Déplanche SimSo: Simulation of Real-Time Scheduling
Objective
SimSo Overview
Example Experimenting with SimSo
Conclusion and Future Work

Two ways of using SimSo

Using it as a Python Module


I Generate a set of systems and
launch their simulations from a
script
Effective utilization (%)

Collect raw data


52.50 56.25 60.00 63.75 67.50 71.25 75.00
3500

I G-EDF (WCET)
RUN (WCET)

Sum of preemptions and migrations


3000
U-EDF (WCET)
2500 100

2000

Use predened methods to retrieve G-EDF (ACET)


80
1500
I

Success rate (%)


RUN (ACET)
1000 60 U-EDF (ACET)

common metrics
500
20 tasks
40
0 24 tasks
70 75 80 85 90 95 100
30 tasks
Utilization
20 (%)
40 tasks

50 tasks

...or develop your methods to


0
75 80 85 90 95 100

I Utilization (%)

compute what you need.

Very exible
Require to develop and learn the programming interfaces
10 / 31 Chéramy, Hladik and Déplanche SimSo: Simulation of Real-Time Scheduling
Objective
SimSo Overview
Example Experimenting with SimSo
Conclusion and Future Work

Software Architecture

Discrete-Event Simulation
SimSo is based on SimPy, a process-based discrete-event simulator.

Main classes
→ Control the state of the jobs (run/wait)
→ Call the methods of the scheduler
Model
→ Simulate a job execution
init()
launch
→ Signal
Process the processor
objects launch
when ready or nished
on_activate(job) migration
→ User-provided class that Task
→ Create the objects and launch the simulation
event
schedules the jobs
on_terminated(job)
→ Release the jobs launch

Scheduler → Abort jobs Processor run / interrupt


schedule(cpu)

→ Allow to set(job,cpu)
up timers as in a real system
activated event
Job
schedule event terminated event

Set and timer event

launch Timer

11 / 31 Chéramy, Hladik and Déplanche SimSo: Simulation of Real-Time Scheduling


Objective
SimSo Overview
Example Experimenting with SimSo
Conclusion and Future Work

Software Architecture

Simulation of the computation time of the jobs


SimSo oers multiple ways to simulate the computation time of
a job:
I computation time of the jobs = their WCET

I random durations based on an ACET

I with xed time penalty after a preemption and migration

I using cache models

I considering the speed of the processor (DVFS)

12 / 31 Chéramy, Hladik and Déplanche SimSo: Simulation of Real-Time Scheduling


Objective
SimSo Overview
Example Experimenting with SimSo
Conclusion and Future Work

Software Architecture

Execution Time Model

I Only one ETM for all the system.


I Each job informs the ETM of every change of state.
I The ETM determines the remaining execution time of the job.
I A job is terminated as soon as get_ret returns 0.

13 / 31 Chéramy, Hladik and Déplanche SimSo: Simulation of Real-Time Scheduling


Objective
SimSo Overview
Example Experimenting with SimSo
Conclusion and Future Work

Writing a Scheduler

Interface
Scheduler
A scheduler for SimSo is a Python class that Attributes:
inherits from the abstract class Scheduler.
sim
processors
task_list
...
Methods:
This class is loaded dynamically in SimSo init()
on_activate(job)

and linked to the simulation core. on_terminated(job)


schedule(cpu)
...

14 / 31 Chéramy, Hladik and Déplanche SimSo: Simulation of Real-Time Scheduling


Objective
SimSo Overview
Example Experimenting with SimSo
Conclusion and Future Work

Example

Code for a Global EDF (one possible implementation).

from simso.core import Scheduler key = lambda x: (


1 if not x.running else 0,
class G_EDF(Scheduler): x.running.absolute_deadline if x.running else 0)
"""Global Earliest Deadline First""" cpu_min = max(self.processors, key=key)
def init(self):
self.ready_list = [] # Obtain the job with the highest priority
# within the ready list.
def on_activate(self, job): job = min(self.ready_list,
self.ready_list.append(job) key=lambda x: x.absolute_deadline)
# Send a "schedule" event to the processor.
job.cpu.resched() # If the selected job has a higher priority
# than the one running on the selected cpu:
def on_terminated(self, job): if (cpu_min.running is None or
# Send a "schedule" event to the processor. cpu_min.running.absolute_deadline >
job.cpu.resched() job.absolute_deadline):
self.ready_list.remove(job)
def schedule(self, cpu): if cpu_min.running:
decision = None # No change. self.ready_list.append(cpu_min.running)
# Schedule job on cpu_min.
if self.ready_list: decision = (job, cpu_min)
# Look for a free processor or the processor
# running the job with the least priority. return decision

15 / 31 Chéramy, Hladik and Déplanche SimSo: Simulation of Real-Time Scheduling


Objective
SimSo Overview
Example Experimenting with SimSo
Conclusion and Future Work

Available Schedulers

Uniprocessor
RM, DM, FP, EDF, LLF, M-LLF, Static-EDF, CC-EDF

Partitioned
Any uniprocessor scheduler combined with various bin packing
algorithms (Best Fit, First Fit, Next Fit, Worst Fit...)

Global
G-RM, G-EDF, G-FL, EDF-US, PriD, EDZL, LLF, M-LLF, U-EDF
PFair: PD2 , ER-PD2
DP-Fair and BFair: LLREF, LRE-TL, DP-WRAP, BF, NVNLF

Semi-Partitioned
EDHS, EKG, RUN

16 / 31 Chéramy, Hladik and Déplanche SimSo: Simulation of Real-Time Scheduling


Objective
SimSo Overview
Example Experimenting with SimSo
Conclusion and Future Work

Generation of Tasksets

Task utilization
The following generators are available:
I RandFixedSum

I UUniFast-Discard

I and other generators

Task periods
The periods can be generated using:
I Uniform distribution

I Log-Uniform distribution

I Discrete uniform distribution

17 / 31 Chéramy, Hladik and Déplanche SimSo: Simulation of Real-Time Scheduling


Objective
SimSo Overview
Example Experimenting with SimSo
Conclusion and Future Work

Generation of Tasksets

Use of an external generator


I When SimSo is used from a Python script, it is possible to
manually create the tasks with any characteristics.
I It is also possible to generate an XML le compatible with
SimSo.

18 / 31 Chéramy, Hladik and Déplanche SimSo: Simulation of Real-Time Scheduling


Objective
SimSo Overview
Example Experimenting with SimSo
Conclusion and Future Work

Simulation

Ready for simulation


When a system is fully congured (tasks, processors, simulation
parameters, etc.), it can be simulated.

Speed
SimSo is able to run thousands simulations per hour
(depending on the scheduler and system conguration).

19 / 31 Chéramy, Hladik and Déplanche SimSo: Simulation of Real-Time Scheduling


Objective
SimSo Overview
Example Experimenting with SimSo
Conclusion and Future Work

Simulation output

Output
The output of the simulation is a trace of the events that occurred.

Example of events: start of a job (together with its processors),


interruption, resumption, scheduling decision, etc.

Analysis
It is possible to parse the trace to retrieve any specic metric.

But, in order to ease the retrieval of usual metrics, some functions are
provided.

20 / 31 Chéramy, Hladik and Déplanche SimSo: Simulation of Real-Time Scheduling


Objective
SimSo
Example
Conclusion and Future Work

1 Objective

2 SimSo

3 Example

4 Conclusion and Future Work

21 / 31 Chéramy, Hladik and Déplanche SimSo: Simulation of Real-Time Scheduling


Objective
SimSo
Example
Conclusion and Future Work

Objective

To show how SimSo can be used to conduct an experiment on


scheduling policies.
Example
Comparison of the number of preemptions and migrations in function
of the number of tasks.

Studied Schedulers: G-EDF, NVNLF, EKG2 , RUN and U-EDF.

2
with K=number of processors
22 / 31 Chéramy, Hladik and Déplanche SimSo: Simulation of Real-Time Scheduling
Objective
SimSo
Example
Conclusion and Future Work

Generation of the Congurations

Parameters
I Number of tasks: 20, 30, 40, 50, 60, 70, 80, 90, 100
I Number of processors: 2, 4, 8
I System utilization: 85%, 95%
I Periods: log-uniform distribution in [2, 100ms]
I Simulation on [0, 1000ms]
I Execution Time Model: ACET (average value=75% of WCET)

Simulations
For each conguration (tasks, processors, utilization), 20 tasksets are
generated.

23 / 31 Chéramy, Hladik and Déplanche SimSo: Simulation of Real-Time Scheduling


Objective
SimSo
Example
Conclusion and Future Work

Simulation

Duration
5400 simulations executed in ∼2 hours.
Collection of the results
The number of preemptions and migrations are extracted from
each simulation and stored in an SQLite3 database.

24 / 31 Chéramy, Hladik and Déplanche SimSo: Simulation of Real-Time Scheduling


Objective
SimSo
Example
Conclusion and Future Work

Analysis

Results
Preemptions and migrations depending on the number of tasks.
Results for 8 processors and a total utilization of 95%:
10000
G-EDF

Sum preemptions and migrations


8000
EKG
Number of preemptions

Number of migrations

6000 NVNLF
RUN
4000 U-EDF
2000

0
20 30 40 50 60 70 80 90 100 20 30 40 50 60 70 80 90 100 20 30 40 50 60 70 80 90 100
Number of tasks Number of tasks Number of tasks

25 / 31 Chéramy, Hladik and Déplanche SimSo: Simulation of Real-Time Scheduling


Objective
SimSo
Example
Conclusion and Future Work

Analysis
A few comments
I EKG generates a lot of migrations
I the results of NVNLF are getting better with more processors
I G-EDF gives the best results but a few jobs missed their deadline
I RUN acts as a partitioned scheduler with more than 30 tasks
I RUN and U-EDF results are good

10000
G-EDF
Sum preemptions and migrations EKG
8000
Number of preemptions

Number of migrations

6000 NVNLF
RUN
4000 U-EDF
2000

0
20 30 40 50 60 70 80 90 100 20 30 40 50 60 70 80 90 100 20 30 40 50 60 70 80 90 100
Number of tasks Number of tasks Number of tasks

26 / 31 Chéramy, Hladik and Déplanche SimSo: Simulation of Real-Time Scheduling


Objective
SimSo
Example
Conclusion and Future Work

Analysis

Possible improvements
I EKG could do less migrations with a better choice of K and
with other improvements
I the implementation of RUN could benet from minor
improvements (see paper about RUN presented at ECRTS)
I U-EDF could probably do better with clustering or with
some improvements (eg. by using the idle times)

27 / 31 Chéramy, Hladik and Déplanche SimSo: Simulation of Real-Time Scheduling


Objective
SimSo
Example
Conclusion and Future Work

1 Objective

2 SimSo

3 Example

4 Conclusion and Future Work

28 / 31 Chéramy, Hladik and Déplanche SimSo: Simulation of Real-Time Scheduling


Objective
SimSo
Example
Conclusion and Future Work

Current and Future Work

Improvement in SimSo
Inclusion of other task models (eg. task dependencies, sporadic tasks).

Validation of the results regarding the use of cache models.

Experiments
SimSo was used to run approximatively 500 000 simulations.

We are currently analyzing the results. In particular, many


existing experiments were reproduced.

29 / 31 Chéramy, Hladik and Déplanche SimSo: Simulation of Real-Time Scheduling


Objective
SimSo
Example
Conclusion and Future Work

Conclusion

SimSo
SimSo is a simulator dedicated to the evaluation of scheduling
algorithms.

Thanks to its design, it is easy to extend it to new models.


Schedulers
I Implementing a scheduler is simplied
I More than 25 scheduling algorithms were implemented
I SimSo is capable of handling partitioned, global and hybrid
scheduling approaches.

30 / 31 Chéramy, Hladik and Déplanche SimSo: Simulation of Real-Time Scheduling


Objective
SimSo
Example
Conclusion and Future Work

Questions?

Thank you for your attention.

31 / 31 Chéramy, Hladik and Déplanche SimSo: Simulation of Real-Time Scheduling

You might also like