Programming in Multi-BSP: Multi-ML and its typing system Victor Allombert, Frédéric Gava and Julien Tesson LACL (Paris-Est) & LIFO (Orléans)
GDR LaMHA - LIFO
V. Allombert et al.
LaMHA - 27 Mars 2017
1 / 22
Table of Contents
1 Introduction 2 Multi-ML in a nutshell 3 Multi-ML type system 4 Conclusion
Table of Contents 1 Introduction
bsp bsml multi-bsp 2 Multi-ML in a nutshell 3 Multi-ML type system 4 Conclusion
V. Allombert et al.
LaMHA - 27 Mars 2017
2 / 22
Bulk Synchronous Parallelism A bsp computer: • p pairs CPU/memory • Communication network
p0 p1 p2 p3 local computations
• Synchronization unit
communication
.. .
V. Allombert et al.
.. .
.. .
.. .
barrier next super-step
LaMHA - 27 Mars 2017
2 / 22
Bulk Synchronous Parallelism A bsp computer: • p pairs CPU/memory • Communication network
p0 p1 p2 p3 local computations
• Synchronization unit
Properties: • Super-steps execution • Confluent
communication
.. .
.. .
.. .
.. .
barrier next super-step
• Deadlock-free • Predictable performances
V. Allombert et al.
LaMHA - 27 Mars 2017
2 / 22
Bulk Synchronous ml What is bsml?
V. Allombert et al.
LaMHA - 27 Mars 2017
3 / 22
Bulk Synchronous ml What is bsml? • Explicit bsp programming with a functional approach
V. Allombert et al.
LaMHA - 27 Mars 2017
3 / 22
Bulk Synchronous ml What is bsml? • Explicit bsp programming with a functional approach • Based upon ml an implemented over ocaml
V. Allombert et al.
LaMHA - 27 Mars 2017
3 / 22
Bulk Synchronous ml What is bsml? • Explicit bsp programming with a functional approach • Based upon ml an implemented over ocaml • Formal semantics → computer-assisted proofs (coq)
V. Allombert et al.
LaMHA - 27 Mars 2017
3 / 22
Bulk Synchronous ml What is bsml? • Explicit bsp programming with a functional approach • Based upon ml an implemented over ocaml • Formal semantics → computer-assisted proofs (coq)
Main idea Parallel data structure ⇒ Vector:
V. Allombert et al.
LaMHA - 27 Mars 2017
3 / 22
bsml primitives Asynchronous primitives
V. Allombert et al.
LaMHA - 27 Mars 2017
4 / 22
bsml primitives Asynchronous primitives • > : ⟨e, . . . , e⟩
V. Allombert et al.
LaMHA - 27 Mars 2017
4 / 22
bsml primitives Asynchronous primitives • > : ⟨e, . . . , e⟩ • $v$ : vi on processor i, assumes v ≡ ⟨v0 , . . . , vp−1 ⟩
V. Allombert et al.
LaMHA - 27 Mars 2017
4 / 22
bsml primitives Asynchronous primitives • > : ⟨e, . . . , e⟩ • $v$ : vi on processor i, assumes v ≡ ⟨v0 , . . . , vp−1 ⟩ • $pid$ : i on processor i
V. Allombert et al.
LaMHA - 27 Mars 2017
4 / 22
bsml primitives Asynchronous primitives • > : ⟨e, . . . , e⟩ • $v$ : vi on processor i, assumes v ≡ ⟨v0 , . . . , vp−1 ⟩ • $pid$ : i on processor i
Synchronous primitives • proj : ⟨x0 , . . . , xp−1 ⟩ 7→ (fun i → xi )
V. Allombert et al.
LaMHA - 27 Mars 2017
4 / 22
bsml primitives Asynchronous primitives • > : ⟨e, . . . , e⟩ • $v$ : vi on processor i, assumes v ≡ ⟨v0 , . . . , vp−1 ⟩ • $pid$ : i on processor i
Synchronous primitives • proj : ⟨x0 , . . . , xp−1 ⟩ 7→ (fun i → xi ) • put : ⟨f0 , . . . , fp−1 ⟩ 7→ ⟨(fun i → fi 0), . . . , (fun i → fi (p−1))⟩
V. Allombert et al.
LaMHA - 27 Mars 2017
4 / 22
Code example For a bsp machine with 3 processors: # let vec = >;; val vec : string par = # let vec2 = >;; val vec2 : string par = # let totex v = List.map (proj v) procs;; val totex : 'a par -> 'a list = # totex vec2;; - : string list = ["Hello0"; "Hello1"; "Hello2"] V. Allombert et al.
LaMHA - 27 Mars 2017
5 / 22
The multi-bsp model What is multi-bsp? 1
A tree structure with nested components
2
Where nodes have a storage capacity
3
And leaves are processors
V. Allombert et al.
LaMHA - 27 Mars 2017
6 / 22
The multi-bsp model What is multi-bsp? 1
A tree structure with nested components
2
Where nodes have a storage capacity
3
And leaves are processors
multi-bsp
Multi_Core core0
core1
th0 th1 th2 th3
th0 th1 th2 th3
V. Allombert et al.
LaMHA - 27 Mars 2017
6 / 22
The multi-bsp model What is multi-bsp? 1
A tree structure with nested components
2
Where nodes have a storage capacity
3
And leaves are processors
multi-bsp
bsp Network
Multi_Core core0
core1
th0 th1 th2 th3
th0 th1 th2 th3
V. Allombert et al.
th0 th1 th2 th3 th4 th5 th6 th7
LaMHA - 27 Mars 2017
6 / 22
The multi-bsp model Execution model A level i superstep is:
gi
mi n
Level i
gi−1
Li n.1
V. Allombert et al.
…
…
n.pi
Level i − 1
LaMHA - 27 Mars 2017
7 / 22
The multi-bsp model Execution model A level i superstep is: • Level i − 1 executes code independantly
gi
mi n
Level i
gi−1
Li n.1
V. Allombert et al.
…
…
n.pi
Level i − 1
LaMHA - 27 Mars 2017
7 / 22
The multi-bsp model Execution model A level i superstep is: • Level i − 1 executes code independantly • Exchanges informations with the mi memory
gi
mi n
Level i
gi−1
Li n.1
V. Allombert et al.
…
…
n.pi
Level i − 1
LaMHA - 27 Mars 2017
7 / 22
The multi-bsp model Execution model A level i superstep is: • Level i − 1 executes code independantly • Exchanges informations with the mi memory • Synchronises
gi
mi n
Level i
gi−1
Li n.1
V. Allombert et al.
…
…
n.pi
Level i − 1
LaMHA - 27 Mars 2017
7 / 22
Table of Contents
1 Introduction 2 Multi-ML in a nutshell
Overview Primitives 3 Multi-ML type system 4 Conclusion
V. Allombert et al.
LaMHA - 27 Mars 2017
8 / 22
multi-ml
Basic ideas
V. Allombert et al.
LaMHA - 27 Mars 2017
8 / 22
multi-ml
Basic ideas • bsml-like code on every stage of the multi-bsp architecture
V. Allombert et al.
LaMHA - 27 Mars 2017
8 / 22
multi-ml
Basic ideas • bsml-like code on every stage of the multi-bsp architecture • Specific syntax over ml: eases programming
V. Allombert et al.
LaMHA - 27 Mars 2017
8 / 22
multi-ml
Basic ideas • bsml-like code on every stage of the multi-bsp architecture • Specific syntax over ml: eases programming • Multi-functions that recursively go through the tree.
V. Allombert et al.
LaMHA - 27 Mars 2017
8 / 22
multi-ml
Basic ideas • bsml-like code on every stage of the multi-bsp architecture • Specific syntax over ml: eases programming • Multi-functions that recursively go through the tree.
let v= >
LaMHA - 27 Mars 2017
8 / 22
multi-ml: Tree recursion
Recursion structure let multi f [args]= where node = (* BSML code *) ... > ... in v where leaf = (* OCaml code *) ... in v
V. Allombert et al.
LaMHA - 27 Mars 2017
9 / 22
multi-ml: Tree recursion
Recursion structure let multi f [args]= where node = (* BSML code *) ... > ... in v where leaf = (* OCaml code *) ... in v
V. Allombert et al.
LaMHA - 27 Mars 2017
9 / 22
multi-ml: Tree recursion
Recursion structure let multi f [args]= where node = (* BSML code *) ... > ... in v where leaf = (* OCaml code *) ... in v
V. Allombert et al.
f
LaMHA - 27 Mars 2017
9 / 22
multi-ml: Tree recursion
Recursion structure let multi f [args]= where node = (* BSML code *) ... > ... in v where leaf = (* OCaml code *) ... in v
V. Allombert et al.
N
LaMHA - 27 Mars 2017
f
9 / 22
multi-ml: Tree recursion
Recursion structure let multi f [args]= where node = (* BSML code *) ... > ... in v where leaf = (* OCaml code *) ... in v
V. Allombert et al.
N
f
f
LaMHA - 27 Mars 2017
9 / 22
multi-ml: Tree recursion
Recursion structure let multi f [args]= where node = (* BSML code *) ... > ... in v where leaf = (* OCaml code *) ... in v
V. Allombert et al.
N
f
N
LaMHA - 27 Mars 2017
N
f
9 / 22
multi-ml: Tree recursion
Recursion structure let multi f [args]= where node = (* BSML code *) ... > ... in v where leaf = (* OCaml code *) ... in v
V. Allombert et al.
N
N
f
N
f f
LaMHA - 27 Mars 2017
f
9 / 22
multi-ml: Tree recursion
Recursion structure let multi f [args]= where node = (* BSML code *) ... > ... in v where leaf = (* OCaml code *) ... in v
V. Allombert et al.
N
N
L
N
L
LaMHA - 27 Mars 2017
L
L
9 / 22
multi-ml: Tree recursion
Recursion structure let multi f [args]= where node = (* BSML code *) ... > ... in v where leaf = (* OCaml code *) ... in v
V. Allombert et al.
N
N v0.0.0
N v0.0.1
v0.1.0
LaMHA - 27 Mars 2017
v0.1.1
9 / 22
multi-ml: Tree recursion
Recursion structure let multi f [args]= where node = (* BSML code *) ... > ... in v where leaf = (* OCaml code *) ... in v
V. Allombert et al.
N v0.0
LaMHA - 27 Mars 2017
v0.1
9 / 22
multi-ml: Tree recursion
Recursion structure let multi f [args]= where node = (* BSML code *) ... > ... in v where leaf = (* OCaml code *) ... in v
V. Allombert et al.
Result v0
LaMHA - 27 Mars 2017
9 / 22
multi-ml: Tree construction
Tree construction let multi tree f [args]= where node = (* BSML code *) ... in finally > v where leaf = (* OCaml code *) ... in v
V. Allombert et al.
LaMHA - 27 Mars 2017
10 / 22
multi-ml: Tree construction
Tree construction let multi tree f [args]= where node = (* BSML code *) ... in finally > v where leaf = (* OCaml code *) ... in v
V. Allombert et al.
LaMHA - 27 Mars 2017
10 / 22
multi-ml: Tree construction
Tree construction let multi tree f [args]= where node = (* BSML code *) ... in finally > v where leaf = (* OCaml code *) ... in v
V. Allombert et al.
f
LaMHA - 27 Mars 2017
10 / 22
multi-ml: Tree construction
Tree construction let multi tree f [args]= where node = (* BSML code *) ... in finally > v where leaf = (* OCaml code *) ... in v
V. Allombert et al.
N
LaMHA - 27 Mars 2017
f
10 / 22
multi-ml: Tree construction
Tree construction let multi tree f [args]= where node = (* BSML code *) ... in finally > v where leaf = (* OCaml code *) ... in v
V. Allombert et al.
N
f
LaMHA - 27 Mars 2017
f
10 / 22
multi-ml: Tree construction
Tree construction let multi tree f [args]= where node = (* BSML code *) ... in finally > v where leaf = (* OCaml code *) ... in v
V. Allombert et al.
N
f
N
LaMHA - 27 Mars 2017
N
f
10 / 22
multi-ml: Tree construction
Tree construction let multi tree f [args]= where node = (* BSML code *) ... in finally > v where leaf = (* OCaml code *) ... in v
V. Allombert et al.
N
N
f
N
f f
LaMHA - 27 Mars 2017
f
10 / 22
multi-ml: Tree construction
Tree construction let multi tree f [args]= where node = (* BSML code *) ... in finally > v where leaf = (* OCaml code *) ... in v
V. Allombert et al.
N
N
L
N
L
LaMHA - 27 Mars 2017
L
L
10 / 22
multi-ml: Tree construction
Tree construction let multi tree f [args]= where node = (* BSML code *) ... in finally > v where leaf = (* OCaml code *) ... in v
V. Allombert et al.
N
N v
N v
LaMHA - 27 Mars 2017
v
v
10 / 22
multi-ml: Tree construction
Tree construction let multi tree f [args]= where node = (* BSML code *) ... in finally > v where leaf = (* OCaml code *) ... in v
V. Allombert et al.
N v v
v v
LaMHA - 27 Mars 2017
v
v
10 / 22
multi-ml: Tree construction v v v
v v
v
v
Tree construction let multi tree f [args]= where node = (* BSML code *) ... in finally > v where leaf = (* OCaml code *) ... in v
V. Allombert et al.
LaMHA - 27 Mars 2017
10 / 22
Primitives
Summary
V. Allombert et al.
LaMHA - 27 Mars 2017
11 / 22
Primitives
Summary
e
• mktree e
e e
V. Allombert et al.
e e
LaMHA - 27 Mars 2017
e
e
11 / 22
Primitives
Summary
0
• mktree e • gid
0.0
0.0.0
V. Allombert et al.
0.1
0.0.1
LaMHA - 27 Mars 2017
0.1.0
0.1.1
11 / 22
Primitives
Summary • mktree e • gid
at t
• at
V. Allombert et al.
LaMHA - 27 Mars 2017
11 / 22
Primitives
Summary • mktree e
t0.1
• gid
at t
• at
V. Allombert et al.
LaMHA - 27 Mars 2017
11 / 22
Primitives
Summary
N
• mktree e • gid • at •
V. Allombert et al.
LaMHA - 27 Mars 2017
11 / 22
Primitives
Summary
N
• mktree e • gid • at
f
f
•
V. Allombert et al.
LaMHA - 27 Mars 2017
11 / 22
Primitives
Summary
x
let x = ...
• mktree e • gid • at • • #x#
V. Allombert et al.
LaMHA - 27 Mars 2017
11 / 22
Primitives
Summary
x
let x = ...
• mktree e • gid • at
• • #x#
V. Allombert et al.
LaMHA - 27 Mars 2017
11 / 22
Primitives
Summary
x
let x = ...
• mktree e • gid • at
• • #x#
V. Allombert et al.
LaMHA - 27 Mars 2017
11 / 22
Primitives
Summary • mktree e
mkpar (fun i -> vi)
• gid • at • • #x# • mkpar f
V. Allombert et al.
LaMHA - 27 Mars 2017
11 / 22
Primitives
Summary • mktree e
f 0; f 1 mkpar (fun i -> vi)
• gid • at • • #x# • mkpar f
V. Allombert et al.
LaMHA - 27 Mars 2017
11 / 22
Primitives
Summary mkpar (fun i -> vi)
• mktree e • gid • at
v0
v1
• • #x# • mkpar f
V. Allombert et al.
LaMHA - 27 Mars 2017
11 / 22
Code example Keep the intermediate results of the sum
let multi tree sum_list l = where node = let v = mkpar (fun i -> split i l) in let rc = > in let s = sumSeq (flatten >) in finally rc s where leaf = sumSeq l
V. Allombert et al.
LaMHA - 27 Mars 2017
12 / 22
Code example Keep the intermediate results of the sum
[0...7]
let multi tree sum_list l = where node = let v = mkpar (fun i -> split i l) in let rc = > in let s = sumSeq (flatten >) in finally rc s where leaf = sumSeq l
V. Allombert et al.
LaMHA - 27 Mars 2017
12 / 22
Code example Keep the intermediate results of the sum
[0...3]
[4...7]
let multi tree sum_list l = where node = let v = mkpar (fun i -> split i l) in let rc = > in let s = sumSeq (flatten >) in finally rc s where leaf = sumSeq l
V. Allombert et al.
LaMHA - 27 Mars 2017
12 / 22
Code example Keep the intermediate results of the sum
let multi tree sum_list l = where node = let v = mkpar (fun i -> split i l) in let rc = > in let s = sumSeq (flatten >) in finally rc s where leaf = sumSeq l [0; 1]
[2; 3]
V. Allombert et al.
[4; 5]
[6; 7]
LaMHA - 27 Mars 2017
12 / 22
Code example Keep the intermediate results of the sum
let multi tree sum_list l = where node = let v = mkpar (fun i -> split i l) in let rc = > in let s = sumSeq (flatten >) in finally rc s where leaf = sumSeq l [1]
[5]
V. Allombert et al.
[9]
[13]
LaMHA - 27 Mars 2017
12 / 22
Code example Keep the intermediate results of the sum
[1; 5]
[9; 13]
let multi tree sum_list l = where node = let v = mkpar (fun i -> split i l) in let rc = > in let s = sumSeq (flatten >) in finally rc s where leaf = sumSeq l
[1]
[5]
V. Allombert et al.
[9]
[13]
LaMHA - 27 Mars 2017
12 / 22
Code example Keep the intermediate results of the sum
[6]
[22]
let multi tree sum_list l = where node = let v = mkpar (fun i -> split i l) in let rc = > in let s = sumSeq (flatten >) in finally rc s where leaf = sumSeq l
[1]
[5]
V. Allombert et al.
[9]
[13]
LaMHA - 27 Mars 2017
12 / 22
Code example Keep the intermediate results of the sum
[6; 22]
[6]
[22]
let multi tree sum_list l = where node = let v = mkpar (fun i -> split i l) in let rc = > in let s = sumSeq (flatten >) in finally rc s where leaf = sumSeq l
[1]
[5]
V. Allombert et al.
[9]
[13]
LaMHA - 27 Mars 2017
12 / 22
Code example Keep the intermediate results of the sum
[28]
[6]
[22]
let multi tree sum_list l = where node = let v = mkpar (fun i -> split i l) in let rc = > in let s = sumSeq (flatten >) in finally rc s where leaf = sumSeq l
[1]
[5]
V. Allombert et al.
[9]
[13]
LaMHA - 27 Mars 2017
12 / 22
Code example Keep the intermediate results of the sum
[28]
[6]
[22]
let multi tree sum_list l = where node = let v = mkpar (fun i -> split i l) in let rc = > in let s = sumSeq (flatten >) in finally rc s where leaf = sumSeq l
[1]
[5]
[9]
[13]
Implementation Run on multi-core clusters using mpi. V. Allombert et al.
LaMHA - 27 Mars 2017
12 / 22
Table of Contents
1 Introduction 2 Multi-ML in a nutshell 3 Multi-ML type system 4 Conclusion
V. Allombert et al.
LaMHA - 27 Mars 2017
13 / 22
Typing system Parallel program safety • Replicated coherency
Replicated coherency if random_bool () then proj v else ...
V. Allombert et al.
LaMHA - 27 Mars 2017
13 / 22
Typing system Parallel program safety • Replicated coherency • Level (memory) compatibility
Level(memory) compatibility >
V. Allombert et al.
LaMHA - 27 Mars 2017
13 / 22
Typing system Parallel program safety • Replicated coherency • Level (memory) compatibility • Control parallel structure imbrication • vector • tree
Parallel structure imbrication let v = > in >
V. Allombert et al.
LaMHA - 27 Mars 2017
13 / 22
Type localities
V. Allombert et al.
LaMHA - 27 Mars 2017
14 / 22
Type localities multi
V. Allombert et al.
LaMHA - 27 Mars 2017
14 / 22
Type localities multi
bsp
V. Allombert et al.
LaMHA - 27 Mars 2017
14 / 22
Type localities multi
bsp sequential V. Allombert et al.
LaMHA - 27 Mars 2017
14 / 22
Type localities multi
>
bsp sequential V. Allombert et al.
LaMHA - 27 Mars 2017
14 / 22
Type localities multi comm
>
bsp sequential V. Allombert et al.
LaMHA - 27 Mars 2017
14 / 22
Type localities multi comm
ℓocal
>
bsp sequential V. Allombert et al.
LaMHA - 27 Mars 2017
14 / 22
Type annotations m
Type annotation c
τ
ℓ
>
b s
π
V. Allombert et al.
::= απ Baseπ (τ, τ )π τ Parb τ Treeπ π (τ − → τ )π
type variable base type pairs vector tree arrow type
::= m | b | c | l | s
LaMHA - 27 Mars 2017
15 / 22
Type annotation Latent effect π
(τ − → τ )π′ Where π is the effect emmited by the evaluation and π ′ the locality of definition.
A bsp function #let f = fun x -> let v = > in 1 -: val f : ('a_`z -(b)-> int_b)_m b
f : (′ a‘z − → intb )m
V. Allombert et al.
LaMHA - 27 Mars 2017
16 / 22
Accessibility Accessibility: ◁ m, c m, b m, l, c m, l, c m, s
◁ ◁ ◁ ◁ ◁
m b l c s
m b
c
ℓ
s
λ2 ◁ λ1 : « λ1 can read in λ2 memory. »
V. Allombert et al.
LaMHA - 27 Mars 2017
17 / 22
Accessibility Accessibility: ◁ m, c m, b m, l, c m, l, c m, s
◁ ◁ ◁ ◁ ◁
m b l c s
m b
c
ℓ
s
λ2 ◁ λ1 : « λ1 can read in λ2 memory. »
Example: b
f : (′ a‘z − → intb )m f 1 ⇝ b ◁ m V. Allombert et al.
LaMHA - 27 Mars 2017
17 / 22
Accessibility Accessibility: ◁ m, c m, b m, l, c m, l, c m, s
◁ ◁ ◁ ◁ ◁
m b l c s
m b
c
ℓ
s
λ2 ◁ λ1 : « λ1 can read in λ2 memory. »
Example: b
f : (′ a‘z − → intb )m f 1 ⇝ b ◁ m Error V. Allombert et al.
LaMHA - 27 Mars 2017
17 / 22
Definability Definability: ◀ s, b, m b l, c l, c s
◀ ◀ ◀ ◀ ◀
m b c l s
m b
c
ℓ
s
λ1 ◀ λ2 : « λ1 can be defined in λ2 memory. »
V. Allombert et al.
LaMHA - 27 Mars 2017
18 / 22
Definability Definability: ◀ s, b, m b l, c l, c s
◀ ◀ ◀ ◀ ◀
m b c l s
m b
c
ℓ
s
λ1 ◀ λ2 : « λ1 can be defined in λ2 memory. »
Example: >⇝ m ◀ b
V. Allombert et al.
LaMHA - 27 Mars 2017
18 / 22
Definability Definability: ◀ s, b, m b l, c l, c s
◀ ◀ ◀ ◀ ◀
m b c l s
m b
c
ℓ
s
λ1 ◀ λ2 : « λ1 can be defined in λ2 memory. »
Example: >⇝ m ◀ b Error V. Allombert et al.
LaMHA - 27 Mars 2017
18 / 22
Propagation Propagation: Propgt(ε, ε′ ) This relation returns the prevailing effect amongst ε and ε′ .
Propgt m b l c s
V. Allombert et al.
m m m m m m
b m b b b b
l m b l l ⊥
c m b l c ⊥
s m b ⊥ ⊥ s
LaMHA - 27 Mars 2017
19 / 22
Propagation Propagation: Propgt(ε, ε′ ) This relation returns the prevailing effect amongst ε and ε′ .
Propgt m b l c s
m m m m m m
b m b b b b
l m b l l ⊥
c m b l c ⊥
s m b ⊥ ⊥ s
Constraint generation J e1 e2 : τΛ /Ψ KΛ = V. Allombert et al.
LaMHA - 27 Mars 2017
19 / 22
Propagation Propagation: Propgt(ε, ε′ ) This relation returns the prevailing effect amongst ε and ε′ .
Propgt m b l c s
m m m m m m
b m b b b b
l m b l l ⊥
c m b l c ⊥
s m b ⊥ ⊥ s
Constraint generation ε
J e1 e2 : τΛ /Ψ KΛ = J e1 : (απ − → τπ′ )δ /ε′ KΛ V. Allombert et al.
LaMHA - 27 Mars 2017
19 / 22
Propagation Propagation: Propgt(ε, ε′ ) This relation returns the prevailing effect amongst ε and ε′ .
Propgt m b l c s
m m m m m m
b m b b b b
l m b l l ⊥
c m b l c ⊥
s m b ⊥ ⊥ s
Constraint generation ε
J e1 e2 : τΛ /Ψ KΛ = J e1 : (απ − → τπ′ )δ /ε′ KΛ ∧J e2 : απ′′ /ε′′ KΛ V. Allombert et al.
LaMHA - 27 Mars 2017
19 / 22
Propagation Propagation: Propgt(ε, ε′ ) This relation returns the prevailing effect amongst ε and ε′ .
Propgt m b l c s
m m m m m m
b m b b b b
l m b l l ⊥
c m b l c ⊥
s m b ⊥ ⊥ s
Constraint generation ε
J e1 e2 : τΛ /Ψ KΛ = J e1 : (απ − → τπ′ )δ /ε′ KΛ ∧J e2 : απ′′ /ε′′ KΛ ′′ ∧π ◁ π V. Allombert et al.
LaMHA - 27 Mars 2017
19 / 22
Propagation Propagation: Propgt(ε, ε′ ) This relation returns the prevailing effect amongst ε and ε′ .
Propgt m b l c s
m m m m m m
b m b b b b
l m b l l ⊥
c m b l c ⊥
s m b ⊥ ⊥ s
Constraint generation ε
J e1 e2 : τΛ /Ψ KΛ = J e1 : (απ − → τπ′ )δ /ε′ KΛ ∧J e2 : απ′′ /ε′′ KΛ ′′ ∧π ◁ π ∧ε ◁ Λ V. Allombert et al.
LaMHA - 27 Mars 2017
19 / 22
Propagation Propagation: Propgt(ε, ε′ ) This relation returns the prevailing effect amongst ε and ε′ .
Propgt m b l c s
m m m m m m
b m b b b b
l m b l l ⊥
c m b l c ⊥
s m b ⊥ ⊥ s
Constraint generation ε
J e1 e2 : τΛ /Ψ KΛ = J e1 : (απ − → τπ′ )δ /ε′ KΛ ∧J e2 : απ′′ /ε′′ KΛ ′′ ∧π ◁ π ∧ε ◁ Λ ∧ε ◀ Λ V. Allombert et al.
LaMHA - 27 Mars 2017
19 / 22
Propagation Propagation: Propgt(ε, ε′ ) This relation returns the prevailing effect amongst ε and ε′ .
Propgt m b l c s
m m m m m m
b m b b b b
l m b l l ⊥
c m b l c ⊥
s m b ⊥ ⊥ s
Constraint generation ε
J e1 e2 : τΛ /Ψ KΛ = J e1 : (απ − → τπ′ )δ /ε′ KΛ ∧J e2 : απ′′ /ε′′ KΛ ′′ ∧π ◁ π ∧ε ◁ Λ ∧ε ◀ Λ ∧Ψ = Propgt(ε, ε′ , ε′′ ) V. Allombert et al.
LaMHA - 27 Mars 2017
19 / 22
Serialisation Serialisation: SeriaΛ (τπ ) Is it safe to communicate τπ to locality Λ ? Seriaα (τπ )
=
Seriaα (Baseπ ) Seriaα (Baseπ ) Seriaα (τπ parb ) Seriaα (treeπ )
= = = =
{ τπ , if π ◁ α Baseπ if Base = int, Bool, … Fail if Base = i/o, … Fail Fail
=
Fail
=
′ ε ′ 1 → τ 2 ) , if ε#m, b, s, l (τπ − π′ δ ′ and τπ1 = Seriaα (τπ1 ) ′ and τπ2′ = Seriaα (τπ2′ )
l
Seriaα (_ − → _) ... ε
Seriaα ((τπ1 − → τπ2′ )δ )
V. Allombert et al.
LaMHA - 27 Mars 2017
20 / 22
Table of Contents
1 Introduction 2 Multi-ML in a nutshell 3 Multi-ML type system 4 Conclusion
V. Allombert et al.
LaMHA - 27 Mars 2017
21 / 22
Conclusion multi-ml
V. Allombert et al.
LaMHA - 27 Mars 2017
21 / 22
Conclusion multi-ml • Recursive multi-functions
V. Allombert et al.
LaMHA - 27 Mars 2017
21 / 22
Conclusion multi-ml • Recursive multi-functions • Structured nesting of bsml codes
V. Allombert et al.
LaMHA - 27 Mars 2017
21 / 22
Conclusion multi-ml • Recursive multi-functions • Structured nesting of bsml codes • Small number of primitives and little syntax extension
V. Allombert et al.
LaMHA - 27 Mars 2017
21 / 22
Conclusion multi-ml • Recursive multi-functions • Structured nesting of bsml codes • Small number of primitives and little syntax extension • Big-steps formal semantics (confuent)
V. Allombert et al.
LaMHA - 27 Mars 2017
21 / 22
Conclusion multi-ml • Recursive multi-functions • Structured nesting of bsml codes • Small number of primitives and little syntax extension • Big-steps formal semantics (confuent) • Type system (safety and inference using hm(x) like)
V. Allombert et al.
LaMHA - 27 Mars 2017
21 / 22
Conclusion multi-ml • Recursive multi-functions • Structured nesting of bsml codes • Small number of primitives and little syntax extension • Big-steps formal semantics (confuent) • Type system (safety and inference using hm(x) like)
Current/Future work • Full implementation (record, tuples, …) • Variants • Modules and other ocaml features • Error tracking V. Allombert et al.
LaMHA - 27 Mars 2017
21 / 22
Merci !
Any questions ?
V. Allombert et al.
LaMHA - 27 Mars 2017
22 / 22