Traversal techniques for concurrent systems
This presentation is the property of its rightful owner.
Sponsored Links
1 / 61

Traversal techniques for concurrent systems PowerPoint PPT Presentation


  • 46 Views
  • Uploaded on
  • Presentation posted in: General

Traversal techniques for concurrent systems. Marc Solé & Enric Pastor Departament of Computer Architecture UPC [email protected] Introduction. General objective: checking of safety properties in concurrent systems. Accomplished through Reachability Analisys.

Download Presentation

Traversal techniques for concurrent systems

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Traversal techniques for concurrent systems

Traversal techniques for concurrent systems

Marc Solé & Enric Pastor

Departament of Computer Architecture

UPC

[email protected]


Introduction

Introduction

  • General objective: checking of safety properties in concurrent systems.

  • Accomplished through Reachability Analisys.

  • Lot of work done for synchronous systems, but not for concurrent ones.

In this work: traversal methods for concurrent systems.


Concurrent systems particularities

s0

a

b

s0

s1

s2

{a,b}

b

a

s3

s3

Concurrent systems particularities

  • Transition relations (TR) partitioned in smaller independent parts (events).

  • Each event is “fired” producing new states.

Synchronous

Concurrent


Traditional approach

Traditional Approach

  • Breadth First Search (BFS) does not take advantage of these particularities.

  • Our proposal: schedule the application of the events in a hybrid approach (BFS/DFS).


Overview

Overview

  • Hypothesis

    • Speeding State Generation

    • Causality Detection

  • Four traversal methods

    • Token traverse

    • Weighed token traverse

    • Dynamic event-clustered traverse

    • TR cluster-closure traverse

  • Results & Conclusions


Hypothesis

Hypothesis

  • “The faster, the better”.

  • Intuition:

    • if you need less iterations to complete the process, then the probabilities of encountering an intermediate “big” BDD diminish.

  • Obviously not true in all cases.


Speeding state generation

s0

s0

Speeding state generation

  • Great results with a very simple technique: chaining.

BFS

BFS with chaining

s0

s0

a

b

a

b

s1

s2

s1

s2

b

a

b

a

s3

s3


Speeding state generation1

Speeding state generation

  • Great results with a very simple technique: chaining.

BFS

BFS with chaining

s0

s0

a

b

a

b

s1

s2

s1

s1

s2

b

a

b

a

s3

s3


Speeding state generation2

Speeding state generation

  • Great results with a very simple technique: chaining.

BFS

BFS with chaining

s0

s0

a

b

a

b

s1

s2

s1

s2

b

a

b

a

s3

s3


Maximizing the chaining

Maximizing the chaining

  • The order of event firing has a significant impact on the performance.


Traversal techniques for concurrent systems

s0

b

a

s1

s2

b

a

c

b

s3

s4

s5

e

d

c

e

d

s6

s7

s8

a

b

e

b

f

f

d

s9

s10

s11

a

g

s12


Traversal techniques for concurrent systems

BFS

BFS with chaining

BFS with chaining

s0

s0

s0

b

b

b

a

a

a

s1

s1

s1

s2

s2

s2

b

b

b

a

a

a

c

c

c

b

b

b

s3

s3

s3

s4

s4

s4

s5

s5

s5

e

e

e

d

d

d

c

c

c

e

e

e

d

d

d

s6

s6

s6

s7

s7

s7

s8

s8

s8

a

a

a

b

b

b

e

e

e

b

b

b

f

f

f

f

f

f

d

d

d

s9

s9

s9

s10

s10

s10

s11

s11

s11

a

a

a

g

g

g

s12

s12

s12

{a,b,c,d,e,f,g}

{a,b,c,d,e,f,g}

{e,a,g,c,b,f,d}


Traversal techniques for concurrent systems

BFS

BFS with chaining

BFS with chaining

s0

s0

s0

b

b

b

a

a

a

s1

s2

s1

s2

s1

s2

b

a

b

a

b

a

c

c

c

b

b

b

s3

s4

s5

s3

s4

s5

s3

s4

s5

e

d

e

d

e

d

c

c

c

e

e

e

d

d

d

s6

s7

s8

s6

s7

s8

s6

s7

s8

a

b

a

b

a

b

e

e

e

b

f

b

f

b

f

f

d

f

d

f

d

s9

s10

s11

s9

s10

s11

s9

s10

s11

a

g

a

g

a

g

s12

s12

s12

{a,b,c,d,e,f,g}

{a,b,c,d,e,f,g}

{e,a,g,c,b,f,d}


Traversal techniques for concurrent systems

BFS

BFS with chaining

BFS with chaining

s0

s0

s0

b

b

b

a

a

a

s1

s2

s1

s2

s1

s2

b

a

b

a

b

a

c

c

c

b

b

b

s3

s4

s5

s3

s4

s5

s3

s4

s5

e

d

e

d

e

d

c

c

c

e

e

e

d

d

d

s6

s7

s8

s6

s7

s8

s6

s7

s8

a

b

a

b

a

b

e

e

e

b

f

b

f

b

f

f

d

f

d

f

d

s9

s10

s11

s9

s10

s11

s9

s10

s11

a

g

a

g

a

g

s12

s12

s12

{a,b,c,d,e,f,g}

{a,b,c,d,e,f,g}

{e,a,g,c,b,f,d}


Traversal techniques for concurrent systems

BFS

BFS with chaining

BFS with chaining

s0

s0

s0

b

b

b

a

a

a

s1

s2

s1

s2

s1

s2

b

a

b

a

b

a

c

c

c

b

b

b

s3

s4

s5

s3

s4

s5

s3

s4

s5

e

d

e

d

e

d

c

c

c

e

e

e

d

d

d

s6

s7

s8

s6

s7

s8

s6

s7

s8

a

b

a

b

a

b

e

e

e

b

f

b

f

b

f

f

d

f

d

f

d

s9

s10

s11

s9

s10

s11

s9

s10

s11

a

g

a

g

a

g

s12

s12

s12

{a,b,c,d,e,f,g}

{a,b,c,d,e,f,g}

{e,a,g,c,b,f,d}


Traversal techniques for concurrent systems

BFS

BFS with chaining

BFS with chaining

s0

s0

s0

b

b

b

a

a

a

s1

s2

s1

s2

s1

s2

b

a

b

a

b

a

c

c

c

b

b

b

s3

s4

s5

s3

s4

s5

s3

s4

s5

e

d

e

d

e

d

c

c

c

e

e

e

d

d

d

s6

s7

s8

s6

s7

s8

s6

s7

s8

a

b

a

b

a

b

e

e

e

b

f

b

f

b

f

f

d

f

d

f

d

s9

s10

s11

s9

s10

s11

s9

s10

s11

a

g

a

g

a

g

s12

s12

s12

{a,b,c,d,e,f,g}

{a,b,c,d,e,f,g}

{e,a,g,c,b,f,d}


Traversal techniques for concurrent systems

BFS

BFS with chaining

BFS with chaining

s0

s0

s0

b

b

b

a

a

a

s1

s2

s1

s2

s1

s2

b

a

b

a

b

a

c

c

c

b

b

b

s3

s4

s5

s3

s4

s5

s3

s4

s5

e

d

e

d

e

d

c

c

c

e

e

e

d

d

d

s6

s7

s8

s6

s7

s8

s6

s7

s8

a

b

a

b

a

b

e

e

e

b

f

b

f

b

f

f

d

f

d

f

d

s9

s10

s11

s9

s10

s11

s9

s10

s11

a

g

a

g

a

g

s12

s12

s12

{a,b,c,d,e,f,g}

{a,b,c,d,e,f,g}

{e,a,g,c,b,f,d}


Traversal techniques for concurrent systems

BFS

BFS with chaining

BFS with chaining

s0

s0

s0

b

b

b

a

a

a

s1

s2

s1

s2

s1

s2

b

a

b

a

b

a

c

c

c

b

b

b

s3

s4

s5

s3

s4

s5

s3

s4

s5

e

d

e

d

e

d

c

c

c

e

e

e

d

d

d

s6

s7

s8

s6

s7

s8

s6

s7

s8

a

b

a

b

a

b

e

e

e

b

f

b

f

b

f

f

d

f

d

f

d

s9

s10

s11

s9

s10

s11

s9

s10

s11

a

g

a

g

a

g

s12

s12

s12

{a,b,c,d,e,f,g}

{a,b,c,d,e,f,g}

{e,a,g,c,b,f,d}


Traversal techniques for concurrent systems

BFS

BFS with chaining

BFS with chaining

s0

s0

s0

b

b

b

a

a

a

s1

s2

s1

s2

s1

s2

b

a

b

a

b

a

c

c

c

b

b

b

s3

s4

s5

s3

s4

s5

s3

s4

s5

e

d

e

d

e

d

c

c

c

e

e

e

d

d

d

s6

s7

s8

s6

s7

s8

s6

s7

s8

a

b

a

b

a

b

e

e

e

b

f

b

f

b

f

f

d

f

d

f

d

s9

s10

s11

s9

s10

s11

s9

s10

s11

a

g

a

g

a

g

s12

s12

s12

{a,b,c,d,e,f,g}

{a,b,c,d,e,f,g}

{e,a,g,c,b,f,d}


Traversal techniques for concurrent systems

BFS

BFS with chaining

BFS with chaining

s0

s0

s0

b

b

b

a

a

a

s1

s2

s1

s2

s1

s2

b

a

b

a

b

a

c

c

c

b

b

b

s3

s4

s5

s3

s4

s5

s3

s4

s5

e

d

e

d

e

d

c

c

c

e

e

e

d

d

d

s6

s7

s8

s6

s7

s8

s6

s7

s8

a

b

a

b

a

b

e

e

e

b

f

b

f

b

f

f

d

f

d

f

d

s9

s10

s11

s9

s10

s11

s9

s10

s11

a

g

a

g

a

g

s12

s12

s12

{a,b,c,d,e,f,g}

{a,b,c,d,e,f,g}

{e,a,g,c,b,f,d}


Traversal techniques for concurrent systems

BFS

BFS with chaining

BFS with chaining

s0

s0

s0

b

b

b

a

a

a

s1

s2

s1

s2

s1

s2

b

a

b

a

b

a

c

c

c

b

b

b

s3

s4

s5

s3

s4

s5

s3

s4

s5

e

d

e

d

e

d

c

c

c

e

e

e

d

d

d

s6

s7

s8

s6

s7

s8

s6

s7

s8

a

b

a

b

a

b

e

e

e

b

f

b

f

b

f

f

d

f

d

f

d

s9

s10

s11

s9

s10

s11

s9

s10

s11

a

g

a

g

a

g

s12

s12

s12

{a,b,c,d,e,f,g}

{a,b,c,d,e,f,g}

{e,a,g,c,b,f,d}


Traversal techniques for concurrent systems

BFS

BFS with chaining

BFS with chaining

s0

s0

s0

b

b

b

a

a

a

s1

s2

s1

s2

s1

s2

b

a

b

a

b

a

c

c

c

b

b

b

s3

s4

s5

s3

s4

s5

s3

s4

s5

e

d

e

d

e

d

c

c

c

e

e

e

d

d

d

s6

s7

s8

s6

s7

s8

s6

s7

s8

a

b

a

b

a

b

e

e

e

b

f

b

f

b

f

f

d

f

d

f

d

s9

s10

s11

s9

s10

s11

s9

s10

s11

a

g

a

g

a

g

s12

s12

s12

{a,b,c,d,e,f,g}

{a,b,c,d,e,f,g}

{e,a,g,c,b,f,d}


Traversal techniques for concurrent systems

BFS

BFS with chaining

BFS with chaining

s0

s0

s0

b

b

b

a

a

a

s1

s2

s1

s2

s1

s2

b

a

b

a

b

a

c

c

c

b

b

b

s3

s4

s5

s3

s4

s5

s3

s4

s5

e

d

e

d

e

d

c

c

c

e

e

e

d

d

d

s6

s7

s8

s6

s7

s8

s6

s7

s8

a

b

a

b

a

b

e

e

e

b

f

b

f

b

f

f

d

f

d

f

d

s9

s10

s11

s9

s10

s11

s9

s10

s11

a

g

a

g

a

g

s12

s12

s12

{a,b,c,d,e,f,g}

{a,b,c,d,e,f,g}

{e,a,g,c,b,f,d}


Traversal techniques for concurrent systems

BFS

BFS with chaining

BFS with chaining

s0

s0

s0

b

b

b

a

a

a

s1

s2

s1

s2

s1

s2

b

a

b

a

b

a

c

c

c

b

b

b

s3

s4

s5

s3

s4

s5

s3

s4

s5

e

d

e

d

e

d

c

c

c

e

e

e

d

d

d

s6

s7

s8

s6

s7

s8

s6

s7

s8

a

b

a

b

a

b

e

e

e

b

f

b

f

b

f

f

d

f

d

f

d

s9

s10

s11

s9

s10

s11

s9

s10

s11

a

g

a

g

a

g

s12

s12

s12

{a,b,c,d,e,f,g}

{a,b,c,d,e,f,g}

{e,a,g,c,b,f,d}


Traversal techniques for concurrent systems

BFS

BFS with chaining

BFS with chaining

s0

s0

s0

b

b

b

a

a

a

s1

s2

s1

s2

s1

s2

b

a

b

a

b

a

c

c

c

b

b

b

s3

s4

s5

s3

s4

s5

s3

s4

s5

e

d

e

d

e

d

c

c

c

e

e

e

d

d

d

s6

s7

s8

s6

s7

s8

s6

s7

s8

a

b

a

b

a

b

e

e

e

b

f

b

f

b

f

f

d

f

d

f

d

s9

s10

s11

s9

s10

s11

s9

s10

s11

a

g

a

g

a

g

s12

s12

s12

{a,b,c,d,e,f,g}

{a,b,c,d,e,f,g}

{e,a,g,c,b,f,d}


Traversal techniques for concurrent systems

BFS

BFS with chaining

BFS with chaining

s0

s0

s0

b

b

b

a

a

a

s1

s2

s1

s2

s1

s2

b

a

b

a

b

a

c

c

c

b

b

b

s3

s4

s5

s3

s4

s5

s3

s4

s5

e

d

e

d

e

d

c

c

c

e

e

e

d

d

d

s6

s7

s8

s6

s7

s8

s6

s7

s8

a

b

a

b

a

b

e

e

e

b

f

b

f

b

f

f

d

f

d

f

d

s9

s10

s11

s9

s10

s11

s9

s10

s11

a

g

a

g

a

g

s12

s12

s12

{a,b,c,d,e,f,g}

{a,b,c,d,e,f,g}

{e,a,g,c,b,f,d}


Maximizing the chaining1

Maximizing the chaining

  • Information to obtain a good scheduling

    Causality analisys between events.

  • Main idea: If I have fired event X, which events are fireable now.


Notation definitions

Notation & Definitions

  • The set of states in which an event is “fireable” is called Firing Function (FF).

  • In fact, characteristic function of the set.

  • Example:

    • FF(a)

a

b

s0

s1

s2

b

a

c

b

s3

s4

s5

e

d

c

e

d

s6

s7

s8

a

b

e

b

f

f

d

s9

s10

s11

a

g

s12


Causality

Causality

  • Causality between TR a and TR b exists if:

    • You can fire a, but not b.

    • You fire a.

    • Now you can fire b.

FF(a)

FF(b)


Causality1

Causality

  • Causality between TR a and TR b exists if:

    • You can fire a, but not b.

    • You fire a.

    • Now you can fire b.

FF(a)·!FF(b)


Causality2

Causality

  • Causality between TR a and TR b exists if:

    • You can fire a, but not b.

    • You fire a.

    • Now you can fire b.

To

a

a

a

FF(a)·!FF(b)

To = Firing a on FF(a)*!FF(b)


Causality3

If this set exists

[To · FF(b)  ]

then event bpotentially becomes fireable after event a

Causality

  • Causality between TR a and TR b exists if:

    • You can fire a, but not b.

    • You fire a.

    • Now you can fire b.

To

FF(b)

FF(a)·!FF(b)


Causality4

Causality

  • Checking the causality for each pair of events, we can determine the causality relations between all the events in the system.

  • This information can be stored in different ways (i.e. matix).

  • For clarity we use a Petri-Net like model to represent these relations.


Petri nets

Petri Nets

  • Structure to represent relationships (synchronicity/concurrency) between components.

  • Three components:

    • Places: potential state.

    • Transitions: dynamic behaviour.

    • Tokens: present state.


Causality5

Causality

s0

  • Example:

b

a

s1

s2

a

b

b

a

s3

c

s4

a

b

c

s5

s6

b

a

s7


Traversal methods

Traversal methods


Token traverse

Token traverse

  • Put one initial token in all fireable events.

  • Fire the event with highest number of tokens.

  • If firing does not generate any new state, then the token is “absorbed”.

  • When all the tokens have been absorbed, compute the new states generated by this iteration.

  • If no new, fixpoint reached, else restart.


Token traverse1

Token traverse

s0

  • Example:

b

a

s1

s2

a

b

b

a

s3

c

s4

a

b

c

s5

s6

b

a

s7


Token traverse2

Token traverse

s0

  • Example:

b

a

s1

s2

a

b

b

a

s3

c

s4

a

b

c

s5

s6

b

a

Same number of tokens in a and b :

Chose at random which to fire

s7


Token traverse3

Token traverse

s0

  • Example:

b

a

s1

s2

a

b

b

a

s3

c

s4

a

b

c

s5

s6

b

a

Same number of tokens in b and c :

Chose at random which to fire

s7


Token traverse4

Token traverse

s0

  • Example:

b

a

s1

s2

a

b

b

a

s3

c

s4

a

b

c

s5

s6

Worst case: c is fired

No new state produced,

token absorbed

b

a

s7


Token traverse5

Token traverse

s0

  • Example:

b

a

s1

s2

a

b

b

a

s3

c

s4

a

b

c

s5

s6

b

a

s7


Token traverse6

Token traverse

s0

  • Example:

b

a

s1

s2

a

b

b

a

s3

c

s4

a

b

c

s5

s6

b

a

s7


Problems with token traverse

Problems with Token Traverse

  • Ineffective firings. As in the case of event c in the previous example.

s0

a

b

b

a

s1

s2

b

a

s3

c

c


Problems with token traverse1

Problems with Token Traverse

  • To solve this problem and produce a better scheduling we can try to relate:

    • number of tokens in one place

    • number of states in which this event is fireable.


Weighed token traverse

Weighed Token Traverse

  • Every time an event is fired, for each successor, we add a number of tokens equal to the number of states in which this successor is fireable.

s0

a

b

b

a

s1

s2

b

a

s3

c

c


Weighed token traverse1

Weighed Token Traverse

  • In the former example, token from place a is now actually absorbed, as state s1  FF(c).

s0

a

b

b

a

s1

s2

b

a

s3

c

c


Weighed token traverse2

Weighed Token Traverse

  • This solves ineffective firing problem, but increases BDD operations. For each firing we must perform k AND operations, being k the number of successors of an event.

  • Fortunately, in our benchmarks k is usually small (<4).


Weighed token traverse3

Weighed Token Traverse

  • However this method does not consider the fireable states produced by concurrent events.

s0

a

b

b

a

s1

s2

b

a

s3

2 states but only 1 token

c

c


Best fireable event

Best fireable event?

  • Both previous methods try to find out which is the best fireable event at every moment.

  • A possible heuristic: fire the event that will produce more states.

  • Events are usually bijective functions, so the problem is equivalent to find out which event has more states in which it is fireable.


Best fireable event1

Best fireable event?

  • For each event, keep track of the number of states in which it is fireable.

  • Every event has its own from set, that is the smaller BDD from the following:

    • The global from or,

    • The set formed only by its fireable states.

      Dynamic event-clustered traverse


Dynamic event clustered traverse

Dynamic event-clustered traverse

s0

Event a

b

s0

a

s1

s2

Event b

s0

b

a

s3

Ø

Event c

c

s4

a

b

s5

s6

b

a

s7


Dynamic event clustered traverse1

s1

Dynamic event-clustered traverse

s0

Ø

Event a

b

a

s1

s2

Event b

s0

b

a

s3

Ø

Event c

c

s4

a

b

s5

s6

b

a

s7


Dynamic event clustered traverse2

s2

s3

Dynamic event-clustered traverse

s0

Ø

Event a

b

a

s1

s2

Ø

Event b

b

a

s3

Ø

Event c

c

s4

a

b

s5

s6

b

a

s7


There is a limit

There is a limit?

  • If we had the perfect algorithm that selected always the best fireable event, would it be possible to go faster than that?


There is a limit1

There is a limit?

  • TRs may be combined.

  • We can compute the transitive closure of these new TRs.

Original

Combined

Closure

a

b

b

a

a

b

b

a


Tr cluster closure traverse

TR cluster-closure traverse

  • Main idea: keep combining and closuring TRs until we reach a threshold limit (BDD size).

  • Advantages:

    • Reduces considerably the number of steps needed to complete the traversal.

    • This method is orthogonal with the previous ones


Tr cluster closure traverse1

TR cluster-closure traverse

  • Drawbacks:

    • Setup time may be not negligeable if the TRs to combine are not selected carefully.

    • New TRs are bigger and usually have more variables.


Results

Results

  • RGD-arbiter [1], 63 vars, 47 events, reachable set has 5.49046e+13 states.

Steps

#Events

Peak

Time (s)

BFS

>38

>1786

>1755

>14400

BFS chain

24

1175

1755

1476

TOK

8

1430

20

30

WTOK

10

1280

20

26

DEC

N/A

1334

50

82

TRCC man

10

55

63

45

[1] M. R. Greenstreet et al, Proceedings of 5th Int. Symp. on ARACS, pp. 173-185, IEEE, Apr. 1999


Results1

Results

  • STARI(16) [2], 100 vars, 100 events, reachable set has 4.21776e+22 states.

Steps

#Events

Peak

Time (s)

BFS

>329

>33000

-

>8800

BFS chain

127

12800

440

2435

TOK

>34

N/A

>1590

>10800

WTOK

67

10555

698

8890

DEC

N/A

8135

572

7997

TRCC man

48

5550

852

138

[2] M. R. Greenstreet, STARI: A TECHNIQUE for High-Bandwidth COMMUNICATION, PhD. Thesis, 1993


Conclusions

Conclusions

  • Scheduling of individual application of TRs can improve the traversal process.

  • Reducing the number of iterations, helps avoiding the BDD blowups.

  • Four scheduling heuristics introduced.

  • Each one has its own strengths and weaknesses, depending on the class of the system.


  • Login