Multi-Core Reachability for Timed Automata Andreas Dalsgaard 2 Alfons - - PowerPoint PPT Presentation

multi core reachability for timed automata
SMART_READER_LITE
LIVE PREVIEW

Multi-Core Reachability for Timed Automata Andreas Dalsgaard 2 Alfons - - PowerPoint PPT Presentation

Multi-Core Reachability for Timed Automata Andreas Dalsgaard 2 Alfons Laarman 1 Kim G. Larsen 2 Mads Chr. Olesen 2 Jaco van de Pol 1 1 Formal Methods and Tools, University of Twente { a.w.laarman,vdpol } @cs.utwente.nl 2 Department of Computer


slide-1
SLIDE 1

Multi-Core Reachability for Timed Automata

Andreas Dalsgaard2 Alfons Laarman1 Kim G. Larsen2 Mads Chr. Olesen2 Jaco van de Pol1

1Formal Methods and Tools, University of Twente {a.w.laarman,vdpol}@cs.utwente.nl 2Department of Computer Science, Aalborg University {andrease,kgl,mchro}@cs.aau.dk

FORMATS’2012, London, 19th September 2012

slide-2
SLIDE 2

Introduction LTSmin

  • paal

Experiments Conclusion

Hammers

1 core

safe unsafe y1 >= 5 y1 >= 5 L == 1 L == 0 take! release! release! y1 = 0 y1 = 0 take!

1/20

slide-3
SLIDE 3

Introduction LTSmin

  • paal

Experiments Conclusion

Hammers

Many cores

safe unsafe y1 >= 5 y1 >= 5 L == 1 L == 0 take! release! release! y1 = 0 y1 = 0 take!

1/20

slide-4
SLIDE 4

Introduction LTSmin

  • paal

Experiments Conclusion

Timed Automata

safe unsafe y1 >= 5 y1 >= 5 L == 1 L == 0 take! release! release! y1 = 0 y1 = 0 take!

Clocks, etc. Model checking symbolic Partial order on behaviour (clock zones, represented as Difference Bounded Matrix (DBM)) Viewed as Well-Structured Transition System State (s, σ) has discrete part, and symbolic part with comparison

  • perator ⊑

2/20

slide-5
SLIDE 5

Introduction LTSmin

  • paal

Experiments Conclusion

Toolchain

3/20

slide-6
SLIDE 6

Introduction LTSmin

  • paal

Experiments Conclusion

LTSmin

4/20

slide-7
SLIDE 7

Introduction LTSmin

  • paal

Experiments Conclusion

PINS Interface with subsumption

initial-state() = ( s0 , σ0 ) next-state((s, σ)) = {(s1, σ1), . . . , (sn, σn)} returning all successors

  • f (s, σ), (s, σ) → (si, σi)

covers(σ′, σ) = σ ⊑ σ′ returning whether the symbolic part σ′ subsumes σ Implementation-wise, a state is a vector of 32-bit integers, and a pointer to a DBM: i1, . . . , im , DBM

5/20

slide-8
SLIDE 8

Introduction LTSmin

  • paal

Experiments Conclusion

Reachability with subsumption

Algorithm 1 Reachability with subsumption

1

proc reachability(sg)

2

W := { initial-state() }; P := ∅

3

while W = ∅

4

W := W \ (s, σ) for some (s, σ) ∈ W

5

P := P ∪ {(s, σ)}

6

for (t, τ) ∈ next-state((s, σ)) do

7

if t = sg then report & exit

8

if ∃ρ: (t, ρ) ∈ W ∪ P ∧ covers(ρ, τ)

9

W := W \ {(t, ρ) | covers(τ, ρ)} ∪ (t, τ) 6/20

slide-9
SLIDE 9

Introduction LTSmin

  • paal

Experiments Conclusion

Multicore LTSmin Passed-Waiting List

Hash table optimized for multicore Open addressing Separate data Lockless (CAS + write bit) Pre-allocation of entire structure (no allocation there-after)

7/20

slide-10
SLIDE 10

Introduction LTSmin

  • paal

Experiments Conclusion

DBM Storage Data Structure

N L σ D(s) D(t) I τ ρ υ L.add(s, π) L′ τ ρ υ σ π L′.del(t, τ) L′′ ρ υ σ π

Figure: Data structure for L, and operations

Updates can be either blocking or non-blocking

Blocking maintains invariant: waiting states in L do not subsume each

  • ther

Another hash table used for duplicate detection of DBMs

8/20

slide-11
SLIDE 11

Introduction LTSmin

  • paal

Experiments Conclusion

Parallel Reachability

More searchers Share Passed hash table Local Waiting list Work-stealing

global L : S → (Σ × {waiting, passed})∗ proc search((s0, σ0), sg, p) Qp := if p = 1 then {(s0, σ0)} else ∅ while Qp = ∅ ∨ balance(Qp) Qp := Qp \ (s, σ) for some (s, σ) ∈ Qp if ¬grab(s, σ) then continue for (t, τ) ∈ next-state((s, σ)) do if t = sg then report & exit if ¬update(t, τ) Qp := Qp ∪ (t, τ) 9/20

slide-12
SLIDE 12

Introduction LTSmin

  • paal

Experiments Conclusion

  • paal

10/20

slide-13
SLIDE 13

Introduction LTSmin

  • paal

Experiments Conclusion

Successor Generator Generator

Generate C++ code specific for the model Max clock constant analysis (location-based k-extrapolation) Python

safe unsafe y1 >= 5 y1 >= 5 L == 1 L == 0 take! release! release! y1 = 0 y1 = 0 take!

State vector: Process1 int L DBM: y1

11/20

slide-14
SLIDE 14

Introduction LTSmin

  • paal

Experiments Conclusion

Successor Generator Generator

Generate C++ code specific for the model Max clock constant analysis (location-based k-extrapolation) Python

safe unsafe y1 >= 5 y1 >= 5 L == 1 L == 0 take! release! release! y1 = 0 y1 = 0 take!

State vector: Process1 int L DBM: y1

11/20

slide-15
SLIDE 15

Introduction LTSmin

  • paal

Experiments Conclusion

Successor Generator Generator

Generate C++ code specific for the model Max clock constant analysis (location-based k-extrapolation) Python

safe unsafe y1 >= 5 y1 >= 5 L == 1 L == 0 take! release! release! y1 = 0 y1 = 0 take!

State vector: Process1 int L DBM: y1

11/20

slide-16
SLIDE 16

Introduction LTSmin

  • paal

Experiments Conclusion

Successor Generator Generator

Generate C++ code specific for the model Max clock constant analysis (location-based k-extrapolation) Python

safe unsafe y1 >= 5 y1 >= 5 L == 1 L == 0 take! release! release! y1 = 0 y1 = 0 take!

State vector: Process1 int L DBM: y1

11/20

slide-17
SLIDE 17

Introduction LTSmin

  • paal

Experiments Conclusion

Structure of generated code

1

switch (Process1 location) {

2

case 1:

3

if (guard1) //normal transition

4

callback with successor

5

if (guard2) { //synchronisation on chan!

6

switch (Process2 location) {

7

case X:

8

if (guardX) callback with successor

9

}

10

...

11

}

12

...

13

}

14

//Transitions for Process2

15

... 12/20

slide-18
SLIDE 18

Introduction LTSmin

  • paal

Experiments Conclusion

Supported Language Features

Templates constants bounded integer variables arrays selects guards updates invariants on both variables and clocks committed and urgent locations binary synchronisation broadcast channels urgent synchronisation much of the C-like language that uppaal uses to express guards and variable updates

13/20

slide-19
SLIDE 19

Introduction LTSmin

  • paal

Experiments Conclusion

Experiments

14/20

slide-20
SLIDE 20

Introduction LTSmin

  • paal

Experiments Conclusion

Expectations

Search order matters! Finding larger zones faster allow faster termination Multi-core means search order depends on interleaving Hope for linear speedup

15/20

slide-21
SLIDE 21

Introduction LTSmin

  • paal

Experiments Conclusion

Experiments

Table: Runtimes, strict BFS

uppaal

  • paal+LTSmin (cores)

T T1 T2 T8 T16 T32 T48 train-gate-N10 837.4 573.3 297.8 76.7 39.4 21.1 14.4 viking17 207.8 331.5 172.5 44.2 22.7 11.9 8.6 train-gate-N9 76.8 52.4 28.5 7.7 4.1 2.4 2.0 viking15 38.0 67.0 34.8 9.7 5.1 3.0 2.3 train-crossing 48.3 24.5 37.2 5.8 2.7 2.0 2.1 fischer6 0.1 219.2 129.2 46.4 36.1 32.9 31.8

16/20

slide-22
SLIDE 22

Introduction LTSmin

  • paal

Experiments Conclusion

Scalability Strict Search Order

10 20 30 40

  • 10

20 30 40 50

Threads Speedup

Model

  • fischer6

train−crossing−stdred−5 train−gate−N10 train−gate−N9 viking15 viking17

Figure: Speedup strict BFS

10 20 30 40

  • 10

20 30 40 50

Threads Speedup

Model

  • fischer6

train−crossing−stdred−5 train−gate−N10 train−gate−N9 viking15 viking17

Figure: Speedup non-blocking strict BFS 17/20

slide-23
SLIDE 23

Introduction LTSmin

  • paal

Experiments Conclusion

Scalability Non-Strict Search Order

10 20 30 40

  • 10

20 30 40 50

Threads Speedup

Model

  • fischer6

train−crossing−stdred−5 train−gate−N10 train−gate−N9 viking15 viking17

Figure: Speedup Pseudo BFS

10 20 30 40

  • 10

20 30 40 50

Threads Speedup

Model

  • fischer6

train−crossing−stdred−5 train−gate−N10 train−gate−N9 viking15 viking17

Figure: Speedup Randomized Pseudo DFS 18/20

slide-24
SLIDE 24

Introduction LTSmin

  • paal

Experiments Conclusion

Conclusion

A scalable hammer Promising experiments Lots of efficiency improvements (LU-clock extrapolation, symmetry, partial order reduction, memory consumption, . . . ) Multi-core liveness?

Websites

http://opaal-modelchecker.com/ http://fmt.cs.utwente.nl/tools/ltsmin/

19/20

slide-25
SLIDE 25

Introduction LTSmin

  • paal

Experiments Conclusion

Conclusion

Websites

http://opaal-modelchecker.com/ http://fmt.cs.utwente.nl/tools/ltsmin/

10 20 30 40

  • 10

20 30 40 50

Threads Speedup

Model

  • fischer6

train−crossing−stdred−5 train−gate−N10 train−gate−N9 viking15 viking17

Questions?

19/20

slide-26
SLIDE 26

1

Introduction Hammers Timed Automata Toolchain

2

LTSmin PINS Interface with subsumption Reachability with subsumption Multicore LTSmin Passed-Waiting List DBM Storage Data Structure Parallel Reachability

3

  • paal

Successor Generator Generator Structure of generated code Supported Language Features

4

Experiments Expectations Experiments Scalability Strict Search Order Scalability Non-Strict Search Order