Denis Caromel1 Troisieme partie Cours EJC 2003, AUSSOIS, Denis Caromel OASIS Team INRIA -- CNRS -...

26
Denis Caromel 1 Troisieme partie Cours EJC 2003, AUSSOIS, www.inria.fr/oasis/ProActive Denis Caromel OASIS Team INRIA -- CNRS - I3S -- Univ. of Nice Sophia-Antipolis EJCP , Lundi 2 juin 2003 ASP: Asynchronous Sequential Processes An Imperative and Parallel Object Calculus

Transcript of Denis Caromel1 Troisieme partie Cours EJC 2003, AUSSOIS, Denis Caromel OASIS Team INRIA -- CNRS -...

Page 1: Denis Caromel1 Troisieme partie Cours EJC 2003, AUSSOIS,  Denis Caromel OASIS Team INRIA -- CNRS - I3S -- Univ. of Nice Sophia-Antipolis.

Denis Caromel 1

Troisieme partie Cours EJC 2003, AUSSOIS, www.inria.fr/oasis/ProActive

Denis Caromel

OASIS TeamINRIA -- CNRS - I3S -- Univ. of Nice Sophia-Antipolis

EJCP , Lundi 2 juin 2003

ASP: Asynchronous Sequential Processes

An Imperative and Parallel Object Calculus

Page 2: Denis Caromel1 Troisieme partie Cours EJC 2003, AUSSOIS,  Denis Caromel OASIS Team INRIA -- CNRS - I3S -- Univ. of Nice Sophia-Antipolis.

Denis Caromel 2

The ASP calculus: Asynchronous Sequential Processes

Together with Ludovic Henrio, and Bernard Serpette

Objectives:

• Formally study the ProActive model

• Investigate various strategies for asynchronous calls

• Prove some equivalence between Sequential and Parallel programs

• Demonstrate the deterministic nature of sub-sets of the model

Page 3: Denis Caromel1 Troisieme partie Cours EJC 2003, AUSSOIS,  Denis Caromel OASIS Team INRIA -- CNRS - I3S -- Univ. of Nice Sophia-Antipolis.

Denis Caromel 3

ASP principles and Sequential CalculusImperative sigma-calculus a la Abadi-Cardelli

Sequential Language:

Example: a point object

A call to a point:

Page 4: Denis Caromel1 Troisieme partie Cours EJC 2003, AUSSOIS,  Denis Caromel OASIS Team INRIA -- CNRS - I3S -- Univ. of Nice Sophia-Antipolis.

Denis Caromel 4

Principles of Reduction

Page 5: Denis Caromel1 Troisieme partie Cours EJC 2003, AUSSOIS,  Denis Caromel OASIS Team INRIA -- CNRS - I3S -- Univ. of Nice Sophia-Antipolis.

Denis Caromel 5

The Heap -- StoreReduced objects: all

fields are reduced to a location

Heap Reference: Locations

Heap Sequential Configuration

Heap Well Formed properties

Page 6: Denis Caromel1 Troisieme partie Cours EJC 2003, AUSSOIS,  Denis Caromel OASIS Team INRIA -- CNRS - I3S -- Univ. of Nice Sophia-Antipolis.

Denis Caromel 6

Reduction Context

From A. D. Gordon, P. D. Hankin, and S. B. Lassen,

Compilation Equivalence of Imperative Objects, FST+TCS’97, LNCS

Reduction context = an expression with a hole :

provides a deterministic order of evaluation:

• Target object before parameters

• Fields of objects: left to right

• Assignment: left before right

Abbreviation of substitution

Page 7: Denis Caromel1 Troisieme partie Cours EJC 2003, AUSSOIS,  Denis Caromel OASIS Team INRIA -- CNRS - I3S -- Univ. of Nice Sophia-Antipolis.

Denis Caromel 7

Sequential Transition System

Page 8: Denis Caromel1 Troisieme partie Cours EJC 2003, AUSSOIS,  Denis Caromel OASIS Team INRIA -- CNRS - I3S -- Univ. of Nice Sophia-Antipolis.

Denis Caromel 8

Sequential TS Properties

From Gordon-Hankin-Lassen:

Sequential reduction preserves well-formdness:

Sequential reduction is deterministic (modulo renaming):

Page 9: Denis Caromel1 Troisieme partie Cours EJC 2003, AUSSOIS,  Denis Caromel OASIS Team INRIA -- CNRS - I3S -- Univ. of Nice Sophia-Antipolis.

Denis Caromel 9

Parallel calculus

Language:

Intuitive semantics:• Object activation: copy together with a deep copy of its reachable objects

• Asynchronous calls: a Request Queue per Activity

• M is a list of method labels (names) used to specify the request to be served

• A list of already computed futures per activity

• At any time, a full or partial reply may be send back (not eager)

Page 10: Denis Caromel1 Troisieme partie Cours EJC 2003, AUSSOIS,  Denis Caromel OASIS Team INRIA -- CNRS - I3S -- Univ. of Nice Sophia-Antipolis.

Denis Caromel 10

Parallel Binary Tree

Page 11: Denis Caromel1 Troisieme partie Cours EJC 2003, AUSSOIS,  Denis Caromel OASIS Team INRIA -- CNRS - I3S -- Univ. of Nice Sophia-Antipolis.

Denis Caromel 11

Example of a parallel configuration

Page 12: Denis Caromel1 Troisieme partie Cours EJC 2003, AUSSOIS,  Denis Caromel OASIS Team INRIA -- CNRS - I3S -- Univ. of Nice Sophia-Antipolis.

Denis Caromel 12

Structure of Activities (3)

Parallel configurations:

• name of activity [• a current expression being evaluated

• its own heap

• a reference towards the Active Object in the heap (root)

• a list of request to execute in FIFO order:

• a list of futures already computed (future Id --> obj in heap)• A current future: Id associated to the current service

Page 13: Denis Caromel1 Troisieme partie Cours EJC 2003, AUSSOIS,  Denis Caromel OASIS Team INRIA -- CNRS - I3S -- Univ. of Nice Sophia-Antipolis.

Denis Caromel 13

3 additions to the Sequential Calculus

In the store: Remote Objects (proxy) and Futures (proxy for futures)

Reduction contexts: to reduce within an Active expression

Page 14: Denis Caromel1 Troisieme partie Cours EJC 2003, AUSSOIS,  Denis Caromel OASIS Team INRIA -- CNRS - I3S -- Univ. of Nice Sophia-Antipolis.

Denis Caromel 14

Deep (Parallel) Copy

Basic ideas:• upon an active object OA(alpha) , or a future Fut(f beta->alpha)

• the parallel copy stops copying, but pass the OA or Fut as is

It means we pass futures as parameters of communications

Transition System: Deep Copy (more operational def. exists)

Page 15: Denis Caromel1 Troisieme partie Cours EJC 2003, AUSSOIS,  Denis Caromel OASIS Team INRIA -- CNRS - I3S -- Univ. of Nice Sophia-Antipolis.

Denis Caromel 15

Parallel

Transition System

Page 16: Denis Caromel1 Troisieme partie Cours EJC 2003, AUSSOIS,  Denis Caromel OASIS Team INRIA -- CNRS - I3S -- Univ. of Nice Sophia-Antipolis.

Denis Caromel 16

Properties

The PTS is correct with respect to the well formed properties:

Page 17: Denis Caromel1 Troisieme partie Cours EJC 2003, AUSSOIS,  Denis Caromel OASIS Team INRIA -- CNRS - I3S -- Univ. of Nice Sophia-Antipolis.

Denis Caromel 17

Store partitioning

Page 18: Denis Caromel1 Troisieme partie Cours EJC 2003, AUSSOIS,  Denis Caromel OASIS Team INRIA -- CNRS - I3S -- Univ. of Nice Sophia-Antipolis.

Denis Caromel 18

A confluence property (1)

Page 19: Denis Caromel1 Troisieme partie Cours EJC 2003, AUSSOIS,  Denis Caromel OASIS Team INRIA -- CNRS - I3S -- Univ. of Nice Sophia-Antipolis.

Denis Caromel 19

A confluence property (2)

Page 20: Denis Caromel1 Troisieme partie Cours EJC 2003, AUSSOIS,  Denis Caromel OASIS Team INRIA -- CNRS - I3S -- Univ. of Nice Sophia-Antipolis.

Denis Caromel 20

A confluence property (3)

Page 21: Denis Caromel1 Troisieme partie Cours EJC 2003, AUSSOIS,  Denis Caromel OASIS Team INRIA -- CNRS - I3S -- Univ. of Nice Sophia-Antipolis.

Denis Caromel 21

A confluence property (4)

Page 22: Denis Caromel1 Troisieme partie Cours EJC 2003, AUSSOIS,  Denis Caromel OASIS Team INRIA -- CNRS - I3S -- Univ. of Nice Sophia-Antipolis.

Denis Caromel 22

A confluence property (5)

Page 23: Denis Caromel1 Troisieme partie Cours EJC 2003, AUSSOIS,  Denis Caromel OASIS Team INRIA -- CNRS - I3S -- Univ. of Nice Sophia-Antipolis.

Denis Caromel 23

Deterministic Object Networks (1)

Page 24: Denis Caromel1 Troisieme partie Cours EJC 2003, AUSSOIS,  Denis Caromel OASIS Team INRIA -- CNRS - I3S -- Univ. of Nice Sophia-Antipolis.

Denis Caromel 24

Deterministic Object Networks (2)

Page 25: Denis Caromel1 Troisieme partie Cours EJC 2003, AUSSOIS,  Denis Caromel OASIS Team INRIA -- CNRS - I3S -- Univ. of Nice Sophia-Antipolis.

Denis Caromel 25

Tree Topology Determinism

Page 26: Denis Caromel1 Troisieme partie Cours EJC 2003, AUSSOIS,  Denis Caromel OASIS Team INRIA -- CNRS - I3S -- Univ. of Nice Sophia-Antipolis.

Denis Caromel 26

Conclusion• A library: ProActive 100% Java

• Parallelism, distribution, synchronization (CSCW), and mobility

• Reuse -- seamless• Polymorphism with existing class types

• Asynchrony -- Wait-by-necessity

• An interactive tool towards Metacomputing: IC2D

• A calculus:ASP: Asynchronous Sequential Processes• Capture the semantics, and demonstrates the independence of activities

• Results of confluence and determinism

• Mobility to be added

ProActive vs. RMI alone : - 30% of code www.inria.fr/oasis/ProActive