identifying optimal trade-offs between cpu time usage and temporal constraints

Post on 13-Jun-2015

188 Views

Category:

Software

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Identifying Optimal Trade-Offs between CPU Time Usage and Temporal Constraints

Using Search"

Shiva Nejati, Lionel C. Briand"SnT Centre, University of Luxembourg"

""

Today’s cars are developed in a distributed way

2

Integration of software from different sources is essential in most embedded software industries

3

Software integration involves multiple stakeholders

4

Car Makers Software

Part Suppliers Software

Integrator

Software integrators have to fulfill conflicting objectives

5

Objective: Effective execution and synchronization of runnables

Some runnables should execute simultaneously or in a certain order

Objective: Effective usage of CPU time The CPU time used by all the runnables should remain as low as possible over time

Car Makers Part Suppliers

0ms 5ms 10ms 15ms 20ms 25ms 30ms

0ms 5ms 10ms 15ms 20ms 25ms 30ms

0ms 5ms 10ms 15ms 20ms 25ms 30ms

It is challenging to satisfy all objectives

6

4ms

3ms

2ms

Car Makers Part Suppliers r0 r1 r2 r3

Minimize CPU time usage

1 slot

2 slots

3 slots

Execute r0 to r3 close to one another.

7

An multi-objective decision support approach

# of

slo

ts

CPU time usage 4ms 3ms 2ms

1

2

3

Pareto Front Solutions/ Tradeoff Solutions

Car Makers

Part Suppliers

Constrained Optimization Problem (COP)

8

Objective Function(s): Minimizing CPU time usage Minimizing # of time slots Constraint model: Tasks and their timing properties Scheduling policy Search Space: Vectors of Task Offsets

0ms 5ms 10ms 15ms 20ms 25ms 30ms

9

Constraint model

period = 5ms period = 10ms

•  Tasks and their timing properties •  Static Cyclic Scheduling

10

4ms

3ms

Vectors of task offsets (initial delays)

0ms 5ms 10ms 15ms 20ms 25ms 30ms

0ms 5ms 10ms 15ms 20ms 25ms 30ms

o0=0, o1=0, o2=0, o3=0

o0=0, o1=5, o2=5, o3=0

r0 r1 r2 r3

Search Space

0ms 5ms 10ms 15ms 20ms 25ms 30ms

11

Objective Functions

Runnables r0, r1, r2, and r3 run in within at most two consecutive time slots infinitely often iff

for every ri, rj 2 {r0, r1, r2, r3}, for some l < 2

oi ⌘ oj + l⇥ 5 mod(gcd(periodi, periodj))

(1) CPU time usage

(2) Number of Time slots

0ms 5ms 10ms 15ms 20ms 25ms 30ms

3ms

12

Solution Overview

13

Multi-Objective Search algorithm Non-dominated Sorting Genetic Algorithm version 2 (NSGA-II)

Solution Representation a vector of offset values: o0=0, o1=5, o2=5, o3=0

Search operators

Selection: Binary tournament selection with replacement Crossover: uniform cross over Mutation:

o0=0, o1=5, o2=5, o3=0 à o0=0, o1=5, o2=10, o3=0

Fitness Functions max CPU time usage per time slot, and number of time slots during which the tasks run

14

Case Study and Experiments

An automotive software project with 430 tasks. These 430 tasks can be scheduled in almost 10^320 different ways.

15

5.34ms 5.34ms5 ms

Time

CPU

tim

e us

age

(ms)

CPU time usage exceeds the size of the slot (5ms)

Naïve execution of the runnables

16

Depending on the number of slots, CPU time usage is between 2.04ms to 1.45ms. So, around 60% to 70% of each time slot is guaranteed to be free.

After applying our work

[2.04ms … 1.45ms]

5 ms

Time

CPU

tim

e us

age

(ms)

17

Research Questions RQ1 Sanity Check

Do we do better than a trivial (random search) solution?

RQ2 Effectiveness Are we able to find solutions that are close to known lower bounds?

RQ3 Performance How long does it take to compute solutions?

RQ4 Usefulness Are we able to find useful trade-off solutions?

18

RQ2: Effectiveness most relaxed temporal constraint (# of time slots = ∞)

most restricted temporal constraint (# of time slots for each group = 1)

1.43 ms

2.03 ms

most relaxed temporal constraint (# of time slots = ∞) 1.45 ms

most restricted temporal constraint (# of time slots for each group = 1)

2.04 ms

Idea

l CPU

usa

ge

Our

Res

ults

19

RQ3: Performance Our approach generates optimal results in about 5 min

40

50

60

70

80

90

Tim

e (m

in)

Random(25,000)NSGA-II(25,000)

Tim

e (m

in)

4

5

6

7

8

NSGA-II(250,000) Random(250,000)

20

RQ4: Usefulness #

of s

lots

CPU time usage (ms) 2.04 1.45

12

21

14

1.56

1

2 3

Boundary Trade Offs

Interesting Solutions

•  Feasibility analysis

–  Schedulable or not? v  We perform optimization by finding the best solutions among all

the feasible ones

•  Logical models –  Correct/incorrect?

v  We provide an explicit time model enabling us to perform a quantitative analysis

•  Symbolically represent the model and rely on model-checkers or

constraint solvers –  State explosion problem

v  We scale to very large search spaces: 10^320

Related Work

21

Our Contributions

22

Casting a schedulability analysis problem as a multi-objective constrained optimization problem

Objective Functions Constraint models Search Space

Scaling to a very large industry case study

Search Space of 10^320 Our approach is applicable to similar CPU utilization problems if

Tasks timing properties are known although tasks may come from third parties A constraint model capturing the scheduling policy can be defined

top related