Fence-Insertion for Structured Programs Arash Pourdamghani - - PowerPoint PPT Presentation

fence insertion
SMART_READER_LITE
LIVE PREVIEW

Fence-Insertion for Structured Programs Arash Pourdamghani - - PowerPoint PPT Presentation

Fence-Insertion for Structured Programs Arash Pourdamghani Mohammad Taheri Mohsen Lesani Spring 2020 University of Vienna Developing a Distributed System! 2 Looking Deeper 357 F(x) .. 385 F(x) 3 Out of Order Execution


slide-1
SLIDE 1

Fence-Insertion

for Structured Programs Mohammad Taheri

Spring 2020 University of Vienna

Arash Pourdamghani Mohsen Lesani

slide-2
SLIDE 2

Developing a Distributed System!

2

slide-3
SLIDE 3

Looking Deeper

3

357 F(x) ……….. 385 F’(x)

slide-4
SLIDE 4

Out of Order Execution

4

357 F(x) ……….. 385 F’(x) F’(x)

F(x) Programmer's Expectation Runtime Execution

slide-5
SLIDE 5

Fence Insertion

5

357 F(x) 385 F’(x) 500 H(x) 525 H’(x) 146 G(x) 912 G’(x)

slide-6
SLIDE 6

Our Solution

6

slide-7
SLIDE 7

Outline

7

Problem Statement NP-Hardness Poly-time Algorithm

slide-8
SLIDE 8

CFG

8

slide-9
SLIDE 9

A Closer Look

9

h F(x) i Some Code k G(x)

slide-10
SLIDE 10

Maintaining Correctness

10

h F(x) i Some Code k F’(x)

slide-11
SLIDE 11

Fence Insertion

11

h F(x) i Some Code k F’(x)

slide-12
SLIDE 12

All Constraints

12

slide-13
SLIDE 13

Naive Solution

13

slide-14
SLIDE 14

Optimization

14

slide-15
SLIDE 15

Outline

15

Problem Statement NP-Hardness Poly-time Algorithm

slide-16
SLIDE 16

Reduction from Minimum Set Cover

16

𝑉 = 𝑣1, 𝑣2, 𝑣3, 𝑣4, … , un 𝑇 = 𝑇1, 𝑇2, … , 𝑇𝑛 𝐹𝑦𝑏𝑛𝑞𝑚𝑓: 𝑇1 = 𝑣1, 𝑣2, 𝑣3 , 𝑇2 = {𝑣2, 𝑣4}

slide-17
SLIDE 17

Reduction from Minimum Set Cover

17

𝑉 = 𝑣1, 𝑣2, 𝑣3, 𝑣4, … , un : Constraint Types, Straight line program with 2n instructions, Constraints with type 𝑣𝑗 𝑝𝑜 𝑤𝑗, 𝑤2𝑜−𝑗+1 , (𝑤𝑜

2, 𝑤𝑜 2 + 1):The middle edge

slide-18
SLIDE 18

Reduction from Minimum Set Cover

18

𝑇 = 𝑇1, 𝑇2, … : Fence Types We could many fences of 𝑇𝑗 𝐹𝑦𝑏𝑛𝑞𝑚𝑓: 𝑇1 = 𝑣1, 𝑣2, 𝑣3 , 𝑇2 = {𝑣2, 𝑣4}

slide-19
SLIDE 19

19

𝑉 = 𝑣1, 𝑣2, 𝑣3, 𝑣4, … 𝑇 = {𝑇1, 𝑇2, … } Given Solution of Fence Insertion

slide-20
SLIDE 20

20

𝑉 = 𝑉1, 𝑉2, 𝑉3, 𝑉4, … 𝑇 = {𝑇1, 𝑇2, … } Given Solution of Minimum Set Cover

slide-21
SLIDE 21

Outline

21

Problem Statement NP-Hardness Poly-time Algorithm

slide-22
SLIDE 22

22

P

slide-23
SLIDE 23

1- Constraint Elimination 2- Finding Diamond 3- Decomposing into Paths 4- Solving for Paths

Algorithm Overview

23

slide-24
SLIDE 24

Out of Order Execution!

24

1- Constraint Elimination 2- Finding Diamond 3- Decomposing into Paths 4- Solving for Paths 4- Solving for Paths 2- Finding Diamond 1- Constraint Elimination 3- Decomposing into Paths

slide-25
SLIDE 25

A Simple Path

25

slide-26
SLIDE 26

A Simple Path

26

slide-27
SLIDE 27

A Simple Path

27

slide-28
SLIDE 28

A Simple Path

28

slide-29
SLIDE 29

A Simple Path

29

slide-30
SLIDE 30

Structured

30

slide-31
SLIDE 31

A(C)FG

31

slide-32
SLIDE 32

Finding Diamonds

32

slide-33
SLIDE 33

Level 0

33

slide-34
SLIDE 34

Level 1

34

slide-35
SLIDE 35

Level 2

35

slide-36
SLIDE 36

Branch/Merge

36

slide-37
SLIDE 37

Algorithm

37

slide-38
SLIDE 38

Algorithm

38

slide-39
SLIDE 39

Fence Elimination

39

slide-40
SLIDE 40

Passing Constraints

40

slide-41
SLIDE 41

Spanning Constraints

41

slide-42
SLIDE 42

Control Dependency Preservation

42

slide-43
SLIDE 43

Decomposing into simple paths

43

slide-44
SLIDE 44

Absorption in a Path

44

slide-45
SLIDE 45

Emission in a Path

45

slide-46
SLIDE 46

Before

46

slide-47
SLIDE 47

After Level 0

47

slide-48
SLIDE 48

After Level 1

48

slide-49
SLIDE 49

The End!

49

slide-50
SLIDE 50

Complexity

1- 𝐹 ∈ 𝑃 𝑊 2-Elimination: 𝑃 𝐷 + 𝑊 3-Finding Diamonds: 𝑃 𝑊𝑚𝑝𝑕𝑊 4-Decompsiton and Insertion: σ|𝑞| |𝐷𝑞𝑗|𝑚𝑝𝑕𝐷𝑞𝑗 + |𝑊

𝑞𝑗|

⇒Polynomial Time!

50

slide-51
SLIDE 51

What about loops?

51

slide-52
SLIDE 52

Elimination

52

slide-53
SLIDE 53

Transformation

53

slide-54
SLIDE 54

54

Thank you

slide-55
SLIDE 55

Probabilistic Smart Contracts: Secure Randomness on the Blockchain [ICBC 2019]

Propose a novel game-theoretic approach for generating provably unmanipulatable pseudorandom numbers on the blockchain.

Hybrid Mining: Exploiting Blockchain's Computational Power for Distributed Problem Solving [SAC 2019]

A new mining protocol that combines solving real-world useful problems with Hashcash.

55