Presentation is loading. Please wait.

Presentation is loading. Please wait.

Traversal techniques for concurrent systems Marc Solé & Enric Pastor Departament of Computer Architecture UPC

Similar presentations


Presentation on theme: "Traversal techniques for concurrent systems Marc Solé & Enric Pastor Departament of Computer Architecture UPC"— Presentation transcript:

1 Traversal techniques for concurrent systems Marc Solé & Enric Pastor Departament of Computer Architecture UPC msole@ac.upc.es

2 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.

3 Concurrent systems particularities Transition relations (TR) partitioned in smaller independent parts (events). Each event is “ fired ” producing new states. s0 s1s2 s3 a ab b s0 s3 {a,b} SynchronousConcurrent

4 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).

5 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

6 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.

7 s0 Speeding state generation Great results with a very simple technique: chaining. s1 a s2 b s3 ba s1 a s2 b s3 ba BFSBFS with chaining

8 s0 Speeding state generation Great results with a very simple technique: chaining. s1 a s2 b s3 ba s1 a s2 b s3 ba BFSBFS with chaining s1

9 Speeding state generation Great results with a very simple technique: chaining. s0 s1 a a s2 b b s3 b BFSBFS with chaining a s3 ba

10 Maximizing the chaining The order of event firing has a significant impact on the performance.

11 s0 s1s2 s3s4s5 s6s7s8 s9s10s11 s12 a a b b b c c ed e b e a a d bf f g d

12 s0 s1s2 s3s4s5 s6s7s8 s9s10s11 s12 a a b b b c c ed e b e a a d bf f g d s0 s1s2 s3s4s5 s6s7s8 s9s10s11 s12 a a b b b c c ed e b e a a d bf f g d s0 s1s2 s3s4s5 s6s7s8 s9s10s11 s12 a a b b b c c ed e b e a a d bf f g d BFS BFS with chaining {a,b,c,d,e,f,g}{e,a,g,c,b,f,d}{a,b,c,d,e,f,g}

13 s0 s1s2 s3s4s5 s6s7s8 s9s10s11 s12 a a b b b c c ed e b e a a d bf f g d s0 s1s2 s3s4s5 s6s7s8 s9s10s11 s12 a a b b b c c ed e b e a a d bf f g d s0 s1s2 s3s4s5 s6s7s8 s9s10s11 s12 a a b b b c c ed e b e a a d bf f g d BFS BFS with chaining {a,b,c,d,e,f,g} {e,a,g,c,b,f,d}

14 s0 s1s2 s3s4s5 s6s7s8 s9s10s11 s12 a a b b b c c ed e b e a a d bf f g d s0 s1s2 s3s4s5 s6s7s8 s9s10s11 s12 a a b b b c c ed e b e a a d bf f g d s0 s1s2 s3s4s5 s6s7s8 s9s10s11 s12 a a b b b c c ed e b e a a d bf f g d BFS BFS with chaining {a,b,c,d,e,f,g} {e,a,g,c,b,f,d}

15 s0 s1s2 s3s4s5 s6s7s8 s9s10s11 s12 a a b b b c c ed e b e a a d bf f g d s0 s1s2 s3s4s5 s6s7s8 s9s10s11 s12 a a b b b c c ed e b e a a d bf f g d s0 s1s2 s3s4s5 s6s7s8 s9s10s11 s12 a a b b b c c ed e b e a a d bf f g d BFS BFS with chaining {a,b,c,d,e,f,g} {e,a,g,c,b,f,d}

16 s0 s1s2 s3s4s5 s6s7s8 s9s10s11 s12 a a b b b c c ed e b e a a d bf f g d s0 s1s2 s3s4s5 s6s7s8 s9s10s11 s12 a a b b b c c ed e b e a a d bf f g d s0 s1s2 s3s4s5 s6s7s8 s9s10s11 s12 a a b b b c c ed e b e a a d bf f g d BFS BFS with chaining {a,b,c,d,e,f,g} {e,a,g,c,b,f,d}

17 s0 s1s2 s3s4s5 s6s7s8 s9s10s11 s12 a a b b b c c ed e b e a a d bf f g d s0 s1s2 s3s4s5 s6s7s8 s9s10s11 s12 a a b b b c c ed e b e a a d bf f g d s0 s1s2 s3s4s5 s6s7s8 s9s10s11 s12 a a b b b c c ed e b e a a d bf f g d BFS BFS with chaining {a,b,c,d,e,f,g} {e,a,g,c,b,f,d}

18 s0 s1s2 s3s4s5 s6s7s8 s9s10s11 s12 a a b b b c c ed e b e a a d bf f g d s0 s1s2 s3s4s5 s6s7s8 s9s10s11 s12 a a b b b c c ed e b e a a d bf f g d s0 s1s2 s3s4s5 s6s7s8 s9s10s11 s12 a a b b b c c ed e b e a a d bf f g d BFS BFS with chaining {a,b,c,d,e,f,g} {e,a,g,c,b,f,d}

19 s0 s1s2 s3s4s5 s6s7s8 s9s10s11 s12 a a b b b c c ed e b e a a d bf f g d s0 s1s2 s3s4s5 s6s7s8 s9s10s11 s12 a a b b b c c ed e b e a a d bf f g d s0 s1s2 s3s4s5 s6s7s8 s9s10s11 s12 a a b b b c c ed e b e a a d bf f g d BFS BFS with chaining {a,b,c,d,e,f,g} {e,a,g,c,b,f,d}

20 s0 s1s2 s3s4s5 s6s7s8 s9s10s11 s12 a a b b b c c ed e b e a a d bf f g d s0 s1s2 s3s4s5 s6s7s8 s9s10s11 s12 a a b b b c c ed e b e a a d bf f g d s0 s1s2 s3s4s5 s6s7s8 s9s10s11 s12 a a b b b c c ed e b e a a d bf f g d BFS BFS with chaining {a,b,c,d,e,f,g} {e,a,g,c,b,f,d}

21 s0 s1s2 s3s4s5 s6s7s8 s9s10s11 s12 a a b b b c c ed e b e a a d bf f g d s0 s1s2 s3s4s5 s6s7s8 s9s10s11 s12 a a b b b c c ed e b e a a d bf f g d s0 s1s2 s3s4s5 s6s7s8 s9s10s11 s12 a a b b b c c ed e b e a a d bf f g d BFS BFS with chaining {a,b,c,d,e,f,g} {e,a,g,c,b,f,d}

22 s0 s1s2 s3s4s5 s6s7s8 s9s10s11 s12 a a b b b c c ed e b e a a d bf f g d s0 s1s2 s3s4s5 s6s7s8 s9s10s11 s12 a a b b b c c ed e b e a a d bf f g d s0 s1s2 s3s4s5 s6s7s8 s9s10s11 s12 a a b b b c c ed e b e a a d bf f g d BFS BFS with chaining {a,b,c,d,e,f,g} {e,a,g,c,b,f,d}

23 s0 s1s2 s3s4s5 s6s7s8 s9s10s11 s12 a a b b b c c ed e b e a a d bf f g d s0 s1s2 s3s4s5 s6s7s8 s9s10s11 s12 a a b b b c c ed e b e a a d bf f g d s0 s1s2 s3s4s5 s6s7s8 s9s10s11 s12 a a b b b c c ed e b e a a d bf f g d BFS BFS with chaining {a,b,c,d,e,f,g} {e,a,g,c,b,f,d}

24 s0 s1s2 s3s4s5 s6s7s8 s9s10s11 s12 a a b b b c c ed e b e a a d bf f g d s0 s1s2 s3s4s5 s6s7s8 s9s10s11 s12 a a b b b c c ed e b e a a d bf f g d s0 s1s2 s3s4s5 s6s7s8 s9s10s11 s12 a a b b b c c ed e b e a a d bf f g d BFS BFS with chaining {a,b,c,d,e,f,g} {e,a,g,c,b,f,d}

25 s0 s1s2 s3s4s5 s6s7s8 s9s10s11 s12 a a b b b c c ed e b e a a d bf f g d s0 s1s2 s3s4s5 s6s7s8 s9s10s11 s12 a a b b b c c ed e b e a a d bf f g d s0 s1s2 s3s4s5 s6s7s8 s9s10s11 s12 a a b b b c c ed e b e a a d bf f g d BFS BFS with chaining {a,b,c,d,e,f,g} {e,a,g,c,b,f,d}

26 s0 s1s2 s3s4s5 s6s7s8 s9s10s11 s12 a a b b b c c ed e b e a a d bf f g d s0 s1s2 s3s4s5 s6s7s8 s9s10s11 s12 a a b b b c c ed e b e a a d bf f g d s0 s1s2 s3s4s5 s6s7s8 s9s10s11 s12 a a b b b c c ed e b e a a d bf f g d BFS BFS with chaining {a,b,c,d,e,f,g}{a,b,c,d,e,f,g}{a,b,c,d,e,f,g}{a,b,c,d,e,f,g}{e,a,g,c,b,f,d}{e,a,g,c,b,f,d}

27 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.

28 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) s0 s1s2 s3s4s5 s6s7s8 s9s10s11 s12 a a b b b c c ed e b e a a d bf f g d

29 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)

30 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)

31 Causality To To = Firing a on FF(a)*!FF(b) Causality between TR a and TR b exists if: You can fire a, but not b. You fire a. Now you can fire b. a a a FF(a) · !FF(b)

32 Causality To FF(b) If this set exists [To · FF(b)   ] then event b potentially becomes fireable after event a Causality between TR a and TR b exists if: You can fire a, but not b. You fire a. Now you can fire b.

33 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.

34 Petri Nets Structure to represent relationships (synchronicity/concurrency) between components. Three components: Places: potential state. Transitions: dynamic behaviour. Tokens: present state.

35 Causality Example: s0 s1s2 s3 s4 s5s6 s7 a a b b c a a b b ab c

36 Traversal methods

37 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.

38 Token traverse Example: s0 s1s2 s3 s4 s5s6 s7 a a b b c a a b b ab c

39 Token traverse Example: s0 s1s2 s3 s4 s5s6 s7 a a b b c a a b b ab c Same number of tokens in a and b : Chose at random which to fire

40 Token traverse Example: s0 s1s2 s3 s4 s5s6 s7 a a b b c a a b b ab c Same number of tokens in b and c : Chose at random which to fire

41 Token traverse Example: s0 s1s2 s3 s4 s5s6 s7 a a b b c a a b b ab c Worst case: c is fired No new state produced, token absorbed

42 Token traverse Example: s0 s1s2 s3 s4 s5s6 s7 a a b b c a a b b ab c

43 Token traverse Example: s0 s1s2 s3 s4 s5s6 s7 a a b b c a a b b ab c

44 Problems with Token Traverse Ineffective firings. As in the case of event c in the previous example. s0 s1s2 s3 a a b b c ab c

45 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.

46 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 s1s2 s3 a a b b c ab c

47 Weighed Token Traverse In the former example, token from place a is now actually absorbed, as state s1  FF(c). s0 s1s2 s3 a a b b c ab c

48 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).

49 Weighed Token Traverse However this method does not consider the fireable states produced by concurrent events. s0 s1s2 s3 a a b b c ab c 2 states but only 1 token

50 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.

51 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

52 s0 s1s2 s3 s4 s5s6 s7 a a b b c a a b b Event a Event b Event c s0 Ø

53 Dynamic event-clustered traverse s0 s1s2 s3 s4 s5s6 s7 a a b b c a a b b Event a Event b Event c s0 Ø Ø s1

54 Dynamic event-clustered traverse s0 s1s2 s3 s4 s5s6 s7 a a b b c a a b b Event a Event b Event c Ø Ø Ø s2s3

55 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?

56 There is a limit? TRs may be combined. We can compute the transitive closure of these new TRs. a b OriginalCombinedClosure ab ab ab

57 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

58 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.

59 Results RGD-arbiter [1], 63 vars, 47 events, reachable set has 5.49046e+13 states. BFS BFS chain TOK WTOK DEC TRCC man Steps#EventsPeakTime (s) >38>1786>1755>14400 24117517551476 814302030 1012802026 N/A13345082 10556345 [1] M. R. Greenstreet et al, Proceedings of 5 th Int. Symp. on ARACS, pp. 173-185, IEEE, Apr. 1999

60 Results STARI(16) [2], 100 vars, 100 events, reachable set has 4.21776e+22 states. BFS BFS chain TOK WTOK DEC TRCC man Steps#EventsPeakTime (s) >329>33000->8800 127128004402435 >34N/A>1590>10800 67105556988890 N/A81355727997 485550852138 [2] M. R. Greenstreet, STARI: A TECHNIQUE for High-Bandwidth COMMUNICATION, PhD. Thesis, 1993

61 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.


Download ppt "Traversal techniques for concurrent systems Marc Solé & Enric Pastor Departament of Computer Architecture UPC"

Similar presentations


Ads by Google