The P-Calculus

26
The P-Calculus Supratik Mukhopadhyay PEMWS-2 April 6 th 2011

description

The P-Calculus. Supratik Mukhopadhyay. PEMWS-2 April 6 th 2011. Introduction & Motivation. Next generation data-intensive exascale computing architectures will have significantly different execution models: Instead of data moving to work, work should move to data - PowerPoint PPT Presentation

Transcript of The P-Calculus

Page 1: The P-Calculus

The P-Calculus

Supratik Mukhopadhyay

PEMWS-2April 6th 2011

Page 2: The P-Calculus

Introduction & Motivation• Next generation data-intensive exascale computing

architectures will have significantly different execution models: – Instead of data moving to work, work should move

to data– Execution should be message-driven– Need to expose different granularities of

parallelism: determinism, non-determinism, dataflow, globally asynchronous locally synchronous (GALS) semantics, …

– Security & Reliability– Fault-tolerance

Page 3: The P-Calculus

Motivation (Contd.)

• Communicating Sequential Processes (CSP: Hoare 1978) served as the foundation for MPI

• Limitations of CSP limit existing models with respect to expressiveness in terms of fine granularities of parallelism, fault-tolerance, security, localities, hierarchical partitioning of address spaces, …

• Next generation ubiquitous high performance computing needs new execution models

• What is the CSP for next generation exascale computing? – Abstract formal specification of parallel execution

Page 4: The P-Calculus

Existing Specification Formalisms• Petri Nets• -calculus, CSP, CCS, Pi Calculus, Ambient

Calculus, Actors, Kahn Process Networks, …– Do not support globally asynchronous locally

synchronous semantics– Not message driven– Cannot expose different granularities of

parallelism (deterministic/dataflow, nondeterministic, fine-grained, coarse-grained)

– Does not support work moving to data

Page 5: The P-Calculus

The P-calculus: A Specifcation Formalism for Exascale Computation

• Nominal process calculus as a formal execution model for future-generation exascale computation– Has formal operational semantics involving interactions

of external and internal actions• Allows answering questions about the execution

models unambigously• Allows (automatic) checking for inconsistencies and

incompleteness in the execution model• Allows checking (automatically) whether a claimed

implementation of an execution model such as ParalleX or Codelets really implements it

Page 6: The P-Calculus

The P-calculus (contd.)

• Uniform representation of synchronous and asynchronous semantics

• Has an equational theory that allows comparison of different implementations of an execution model

• Equipped with a type system (the first order P-calculus) for correctness, security, …

Page 7: The P-Calculus

The Untyped P-calculus• Chromosomes: Primitive computing elements

in the P-calculus– Internal Actions– External Actions

• Chromatins• Regulators• Boards• Nucleus

Page 8: The P-Calculus

Chromosomes

• Chromosomes are the most basic kind of computational entity defined in the P-Calculus.

• Their role is to execute fundamental computations.

||.|.|::::

MDDIDEDDC

Object

}... ...{ 11 ln EEIImain

)(),...( 11 kk xmxmprivate

)(),...,( 11 jjkk xmxmpublic

Page 9: The P-Calculus

Chromosomes (Contd.)

• Chromosomes may also declare methods:– The set of declared methods is partitioned

into private and public methods.

)}(),...,();(),...,({:: 1111 nnkkkk xmxmxmxmM

Formal Parameters

Page 10: The P-Calculus

Internal Actions

• A chromosome may perform either an internal or external action.

|.

|),()^'(:

|

| einstantiatlet ::

''

'

IIcontfm

D else DthenIif

DI xI

i

tiatetanins)x(floor:z

let einstantiat

)y(getDouble:xlet else )y(getSqr:x

let then 0rand(): if

3

2

1

tiatetanins

))y(getSqr(floorzlet

.

Page 11: The P-Calculus

Chromatins

• Chromosomes are only capable of performing sequential computations.

• A Chromatin is defined as a group of coexisting chromosomes organized together by parallel composition.

CnCnCCn |||::

Page 12: The P-Calculus

Regulators

• Aside from being executed computations need to be managed.

• Managing computations involves: – Controlling and synchronizing data access– Moving work to data

||.||).(:: RRgrdRxR

RAS1

@T(x)

(y)…@C(y)y

Page 13: The P-Calculus

Regulators – Guarded Commands

• Each regulator is denoted by a deterministic state machine that is defined by a set of guarded commands.

ngrdgrdgrd ::...:::: 1• Each guard is denoted by an event

which triggers an action. At most one of the guards can be triggered by an event

Actegrd i ::

Page 14: The P-Calculus

Regulators – Event Language

• Each event can be an atomic event (extending Parnas).

)(|)(|)(|)(:: xxxxe @Comp@C@F@T• Or an event could also be a complex

event.

eeeeee ||::• An action (for now) is the creation of a

chromosome. )(:: CCreateAct

Page 15: The P-Calculus

Board

• Regulators can coexist may be composed• A “parallel” composition of regulators is

known as a board.

BBRB |||:: AS2

@T(x)@C(y)

@F(z)

Page 16: The P-Calculus

Nucleus• We can perform computations (via

chromatins and chromosomes)• We can manage computations (via boards

and regulators).• A nucleus is a composition of coexisting

chromatins and boards.

NNCnBN ||||::

AS2

@T(x)

@C(y)

@F(z)

Nucleus

Page 17: The P-Calculus

Activity Space

• Computations need a context i.e. a place in which they take place.

• An Activity Space is the context in which a cooperating and coexisting chromatin and a board interacts (i.e., a nucleus exists).

ASASNAS .|][|]||[::

Page 18: The P-Calculus

AS1

Example – Activity Spaces and Nuclei

let z = … .<<z>>

let x = … .let y = ….

AS2

@T(x)@C(y)

@F(z)

Page 19: The P-Calculus

System

• A System is a composition of Activity Spaces

• Multilevel hierarchy

Page 20: The P-Calculus

External Actions

• Boards and chromatins were capable of performing and coordinating/managing internal computations.

• External actions coordinate computations across Activity Spaces.

KMigE |::

| | :: openoutinMig '^^^:: contK

Page 21: The P-Calculus

Example – External Actions

AS1

let z = … .<<z>>

let x = … .let y = ….

AS2

@T(x)@C(y)

@F(z)

<<foo>>

(foo)

AS3

In AS3

out AS1.in AS2

Page 22: The P-Calculus

Operational Semantics – Visual Example

@C(cont)

let x = getInput()

let y = sort(x)^f(sort,cont)

<<y>>^cont’^^’

(y^cont)

let z = shuffle(y)

<<z>>^cont^^’’

()}{;2 getInputReaderC

)}();({; 214 xshufflexsortSorterC

Page 23: The P-Calculus

Example – Operational Semantics

'^''cont^;y.einstantiat )'contf(sort,sort(x)^: Sortery letS

Seinstantiat )cont,sort(f()^getInput:Readerx letsortC

'1

'1

'1

()}{;2 getInputReaderC

'.'^^^

)()().^( '

3

3

contz einstantiat shuffle(y): Sorterz letC

CCreatecontconty

@C

)}();({; 214 xshufflexsortSorterC

Page 24: The P-Calculus

Example (Cont’d)

]||'[||]||||[ 31421 CRCCC

]||[||]||)...,(())^([ 314 CRCcontsortfgetInputsort

Page 25: The P-Calculus

Future Work

• First Order P-calculus• Confluence Properties• Tool Building• Query Languages

Page 26: The P-Calculus

Questions?