a mathematical model for concurrent parallel computing

41
Introduction Models Concln A mathematical model for concurrent parallel computing Peter Bubenik Cleveland State University http://academic.csuohio.edu/bubenik p/ November 11, 2008. University of Oregon Peter Bubenik A mathematical model for concurrent parallel computing

Upload: others

Post on 12-Sep-2021

8 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: A mathematical model for concurrent parallel computing

IntroductionModelsConcln

A mathematical model for concurrent parallel

computing

Peter Bubenik

Cleveland State Universityhttp://academic.csuohio.edu/bubenik p/

November 11, 2008. University of Oregon

Peter Bubenik A mathematical model for concurrent parallel computing

Page 2: A mathematical model for concurrent parallel computing

IntroductionModelsConcln

The end of Moore’s Law?

Peter Bubenik A mathematical model for concurrent parallel computing

Page 3: A mathematical model for concurrent parallel computing

IntroductionModelsConcln

Example: Multi-core processors

Intel AMD

Peter Bubenik A mathematical model for concurrent parallel computing

Page 4: A mathematical model for concurrent parallel computing

IntroductionModelsConcln

Example: Internet database

Peter Bubenik A mathematical model for concurrent parallel computing

Page 5: A mathematical model for concurrent parallel computing

IntroductionModelsConcln

Classical non-parallel computing

processorprivate

resources

Process

A process with its own private resources

Peter Bubenik A mathematical model for concurrent parallel computing

Page 6: A mathematical model for concurrent parallel computing

IntroductionModelsConcln

Concurrent parallel computing

Process 1 Process 2

. . .

Process N

Several processes with shared resources

Peter Bubenik A mathematical model for concurrent parallel computing

Page 7: A mathematical model for concurrent parallel computing

IntroductionModelsConcln

A mathematical model

Concurrent systems can be modeled by spaces in which only somecertain paths are allowed.

Definition

A directed space is a topological space X with a distinguished setof paths, γ : [0, 1] → X , called directed paths.

Example

Peter Bubenik A mathematical model for concurrent parallel computing

Page 8: A mathematical model for concurrent parallel computing

IntroductionModelsConcln

A concurrent system

Example

2 processes using 2 shared resources a and b which can only beused by one process at a time

Notation

Px - a process locks resource x

Vx - a process releases resource x

Program

The first process: Pa Pb Vb Va

The second process: Pb Pa Va Vb

Peter Bubenik A mathematical model for concurrent parallel computing

Page 9: A mathematical model for concurrent parallel computing

IntroductionModelsConcln

The Swiss flag

Example

Pb

Pa

Va

Vb

Pa Pb Vb Va

b

b

Peter Bubenik A mathematical model for concurrent parallel computing

Page 10: A mathematical model for concurrent parallel computing

IntroductionModelsConcln

The Swiss flag

Example

Pb

Pa

Va

Vb

Pa Pb Vb Va

b

b

Peter Bubenik A mathematical model for concurrent parallel computing

Page 11: A mathematical model for concurrent parallel computing

IntroductionModelsConcln

The Swiss flag

Example

Pb

Pa

Va

Vb

Pa Pb Vb Va

b

b

Problem: The state space is infinite.

Peter Bubenik A mathematical model for concurrent parallel computing

Page 12: A mathematical model for concurrent parallel computing

IntroductionModelsConcln

The essential schedules of the Swiss flag

Example

Pb

Pa

Va

Vb

Pa Pb Vb Va

This is a subspace of the Swiss flag.

Peter Bubenik A mathematical model for concurrent parallel computing

Page 13: A mathematical model for concurrent parallel computing

IntroductionModelsConcln

Goal

Develop a framework for concurrency where equivalences areaccounted for.

We would like equivalences that allow a piece-by-piece analysis.This will make the analysis of large programs tractable.

Peter Bubenik A mathematical model for concurrent parallel computing

Page 14: A mathematical model for concurrent parallel computing

IntroductionModelsConcln

Goal

Develop a framework for concurrency where equivalences areaccounted for.

We would like equivalences that allow a piece-by-piece analysis.This will make the analysis of large programs tractable.

Idea

Use algebraic topology.

Peter Bubenik A mathematical model for concurrent parallel computing

Page 15: A mathematical model for concurrent parallel computing

IntroductionModelsConcln

Undirected equivalences

Definition

Given continuous maps f , g : B → C ,

f

g

C

B

B

Peter Bubenik A mathematical model for concurrent parallel computing

Page 16: A mathematical model for concurrent parallel computing

IntroductionModelsConcln

Undirected equivalences

Definition

Given continuous maps f , g : B → C ,

f

g

C

B

B

IH

Peter Bubenik A mathematical model for concurrent parallel computing

Page 17: A mathematical model for concurrent parallel computing

IntroductionModelsConcln

Undirected equivalences

Definition

Given continuous maps f , g : B → C ,

f

g

C

B

B

IH

a homotopy between f and g is a continuous map H : B × I → C

restricting to f and g . This is an equivalence relation. WriteH : f

→ g . Peter Bubenik A mathematical model for concurrent parallel computing

Page 18: A mathematical model for concurrent parallel computing

IntroductionModelsConcln

Undirected equivalences

Definition

Spaces B ,C are homotopy equivalent if there are mapsf : B ⇆ C : g such that

g ◦ f ≃ IdB and f ◦ g ≃ IdC .

f

g

B C

Peter Bubenik A mathematical model for concurrent parallel computing

Page 19: A mathematical model for concurrent parallel computing

IntroductionModelsConcln

Directed spaces

Definition

A directed space is a topological space X with a distinguisedset of directed paths.

A directed map is a continuous map f : X → Y betweendirected spaces such that if γ : [0, 1]→ X is a directed pathsin X , then f (γ) is a directed path in Y .

Remark

Subspaces, products, and quotients of directed spaces inherit a

directed space structure.

Peter Bubenik A mathematical model for concurrent parallel computing

Page 20: A mathematical model for concurrent parallel computing

IntroductionModelsConcln

Directed equivalences

Definition

A homotopy between directed maps f , g : B → C is a directedmap H : B ×~I → C restricting to f and g . Write H : f → g .

f

g

C

B

B

IH

Peter Bubenik A mathematical model for concurrent parallel computing

Page 21: A mathematical model for concurrent parallel computing

IntroductionModelsConcln

Directed equivalences

Definition

Write f ≃ g if there is a chain of dihomotopies

f → f1 ← f2 → . . .← fn → g .

Po-Spaces B ,C are dihomotopy equivalent if there are dimapsf : B ⇆ C : g such that

g ◦ f ≃ IdB and f ◦ g ≃ IdC .

Peter Bubenik A mathematical model for concurrent parallel computing

Page 22: A mathematical model for concurrent parallel computing

IntroductionModelsConcln

The fundamental category

Definition

The fundamental category ~π1(X ) has

objects: the points in X

morphisms: homotopy classes of directed paths

Peter Bubenik A mathematical model for concurrent parallel computing

Page 23: A mathematical model for concurrent parallel computing

IntroductionModelsConcln

The fundamental category

Definition

The fundamental category ~π1(X ) has

objects: the points in X

morphisms: homotopy classes of directed paths

Problem

The fundamental category is enormous.

Peter Bubenik A mathematical model for concurrent parallel computing

Page 24: A mathematical model for concurrent parallel computing

IntroductionModelsConcln

Full subcatsfund.bip.graphRetractsExtremal models

Full subcategories of the fundamental category

Plan

We would like to derive a “small” category from the fundamental

category that still contains useful information.

Definition

Given A ⊆ X , let ~π1(X ,A) have

objects: points in A

morphisms: homotopy classes of paths in X

Peter Bubenik A mathematical model for concurrent parallel computing

Page 25: A mathematical model for concurrent parallel computing

IntroductionModelsConcln

Full subcatsfund.bip.graphRetractsExtremal models

The fundamental bipartite graph

Definition

For (X , dX ) write x ≤ y if there exists a dipath γ with γ(0) = 1and γ(1) = y . This gives X a preorder.

Peter Bubenik A mathematical model for concurrent parallel computing

Page 26: A mathematical model for concurrent parallel computing

IntroductionModelsConcln

Full subcatsfund.bip.graphRetractsExtremal models

The fundamental bipartite graph

Definition

For (X , dX ) write x ≤ y if there exists a dipath γ with γ(0) = 1and γ(1) = y . This gives X a preorder.

Definition

Let Min(X ) = {a ∈ X | a′ ≤ a =⇒ a′ = a}.Let Max(X ) = {b ∈ X | b ≤ b′ =⇒ b = b′}.

Definition (B)

The fundamental bipartite graph of X is ~π1(X ,Min(X ) ∪MaxX ).

Peter Bubenik A mathematical model for concurrent parallel computing

Page 27: A mathematical model for concurrent parallel computing

IntroductionModelsConcln

Full subcatsfund.bip.graphRetractsExtremal models

Example of the fundamental bipartite graph

b

b

a

b

b ba b

Peter Bubenik A mathematical model for concurrent parallel computing

Page 28: A mathematical model for concurrent parallel computing

IntroductionModelsConcln

Full subcatsfund.bip.graphRetractsExtremal models

Future retracts

Definition

A future retract of ~π1(X ) moves each x ∈ X along a directed pathin X to a point x+ which “has the same future”.

b

b

b

b

b

c

x y

a ∈ A

x x+

[γx ]

∃!

P+ : ~π1(X )→ ~π1(X ,A)

Peter Bubenik A mathematical model for concurrent parallel computing

Page 29: A mathematical model for concurrent parallel computing

IntroductionModelsConcln

Full subcatsfund.bip.graphRetractsExtremal models

Past retracts

Definition

A past retract of ~π1(X ) moves each x ∈ X backwards along adirected path in X to a point x− which “has the same past”.

b

b

a

b

x− x

a ∈ A

[γx ]

∀∃!

P− : ~π1(X )→ ~π1(X ,A)

Peter Bubenik A mathematical model for concurrent parallel computing

Page 30: A mathematical model for concurrent parallel computing

IntroductionModelsConcln

Full subcatsfund.bip.graphRetractsExtremal models

Extremal models

Definition (B)

An extremal model is a chain of future retracts and past retracts

~π1(X )P

+1−−→ ~π1(X ,X1)

P−

2−−→ ~π1(X ,X2)P

+3−−→ . . .

P±n−−→ ~π1(X ,A),

such that Min(X ) ∪Max(X ) ⊆ A.

Peter Bubenik A mathematical model for concurrent parallel computing

Page 31: A mathematical model for concurrent parallel computing

IntroductionModelsConcln

Full subcatsfund.bip.graphRetractsExtremal models

Extremal models

Definition (B)

An extremal model is a chain of future retracts and past retracts

~π1(X )P

+1−−→ ~π1(X ,X1)

P−

2−−→ ~π1(X ,X2)P

+3−−→ . . .

P±n−−→ ~π1(X ,A),

such that Min(X ) ∪Max(X ) ⊆ A.

Proposition (B)

An extremal model induces an injection of fundamental bipartite

graphs.

Theorem (B)

If X is a compact and ≤ is a partial order, then extremal models

induce an isomorphism of fundamental bipartite graphs.

Peter Bubenik A mathematical model for concurrent parallel computing

Page 32: A mathematical model for concurrent parallel computing

IntroductionModelsConcln

Full subcatsfund.bip.graphRetractsExtremal models

Examples of extremal models

b

b

a

b

b

b

a

b

b

b

a

b

Peter Bubenik A mathematical model for concurrent parallel computing

Page 33: A mathematical model for concurrent parallel computing

IntroductionModelsConcln

Full subcatsfund.bip.graphRetractsExtremal models

An extremal model for the Swiss flag

b

b

b

b

a

b

c

d

b

b

b

b

a

b

c

d

b

b

b

b

a

b

c

d

Peter Bubenik A mathematical model for concurrent parallel computing

Page 34: A mathematical model for concurrent parallel computing

IntroductionModelsConcln

Full subcatsfund.bip.graphRetractsExtremal models

Examples of extremal models

b

b

b

a

b

c

b

b

b

a

b

c

b

b

b

a

b

c

Peter Bubenik A mathematical model for concurrent parallel computing

Page 35: A mathematical model for concurrent parallel computing

IntroductionModelsConcln

Full subcatsfund.bip.graphRetractsExtremal models

An extremal model of ~S1

Let x ∈ ~S1.

There is a future retract

P+ : ~π1(~S1)→ ~π1(~S

1, x) ∼= (N,+).

It is a minimal extremal model.

Peter Bubenik A mathematical model for concurrent parallel computing

Page 36: A mathematical model for concurrent parallel computing

IntroductionModelsConcln

Full subcatsfund.bip.graphRetractsExtremal models

Piecewise analysis

Theorem (B)

Extremal models can be constructed in a piecewise manner.

Peter Bubenik A mathematical model for concurrent parallel computing

Page 37: A mathematical model for concurrent parallel computing

IntroductionModelsConcln

Full subcatsfund.bip.graphRetractsExtremal models

Van Kampen for extremal models example

bb

b

Peter Bubenik A mathematical model for concurrent parallel computing

Page 38: A mathematical model for concurrent parallel computing

IntroductionModelsConcln

Full subcatsfund.bip.graphRetractsExtremal models

Van Kampen for extremal models example

b b b

b b b

b b b

b b b

bb

b

Peter Bubenik A mathematical model for concurrent parallel computing

Page 39: A mathematical model for concurrent parallel computing

IntroductionModelsConcln

Full subcatsfund.bip.graphRetractsExtremal models

Van Kampen for extremal models example

b b b

b b b

b b b

b b b

bb

b

b b b

b b b

b b

b b

b b b

b b b

Peter Bubenik A mathematical model for concurrent parallel computing

Page 40: A mathematical model for concurrent parallel computing

IntroductionModelsConcln

Summary

Summary

Directed spaces provide a good mathematical model forconcurrent parallel computing.

Using directed homotopies one can hope to cope with the“state space explosion”.

The homotopy classes of directed paths assemble into thefundamental category.

Minimal extremal models provide a way to generalize thefundamental group to directed spaces.

Extremal models can be constructed in a piecewise manner.

Peter Bubenik A mathematical model for concurrent parallel computing

Page 41: A mathematical model for concurrent parallel computing

IntroductionModelsConcln

Summary

Applications

L. Fajstrup, E. Goubault, and M. Raussen (1998) usedgeometry and directed topology to give an algorithm fordetecting deadlocks, unsafe regions and inaccessible regionsfor po-spaces such as the Swiss flag, in any dimension.

E. Goubault and E. Haucourt (2005) reduced the fundamentalcategory to “components” to develop a static analyzer(ALCOOL) of concurrent parallel programs.

Peter Bubenik A mathematical model for concurrent parallel computing