35
European and Chinese Cooperation on Grid Skeleton programming Programming model Institute - CoreGRID Dept. Computer Science - Univ. Pisa - Italy Marco Danelutto [email protected]

European and Chinese Cooperation on Gridechogrid.ercim.eu/images/stories/Presentation2WS/WS1029/... · 2009-10-14 · M. Cole PhD Thesis (1988) Template based implementation Imperial

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: European and Chinese Cooperation on Gridechogrid.ercim.eu/images/stories/Presentation2WS/WS1029/... · 2009-10-14 · M. Cole PhD Thesis (1988) Template based implementation Imperial

European and Chinese Cooperation on Grid

Skeleton programmingProgramming model Institute - CoreGRID

Dept. Computer Science - Univ. Pisa - Italy

Marco Danelutto

[email protected]

Page 2: European and Chinese Cooperation on Gridechogrid.ercim.eu/images/stories/Presentation2WS/WS1029/... · 2009-10-14 · M. Cole PhD Thesis (1988) Template based implementation Imperial

Second EchoGrid Workshop Beijing – 29 & 30 October 2007 2

Contents

State of the art grid programming

Structured programming

Skeletons

Skeleton implementation (on grids)

Behavioral skeletons (autonomic management)

Conclusions

Page 3: European and Chinese Cooperation on Gridechogrid.ercim.eu/images/stories/Presentation2WS/WS1029/... · 2009-10-14 · M. Cole PhD Thesis (1988) Template based implementation Imperial

Second EchoGrid Workshop Beijing – 29 & 30 October 2007

Sample application (UC1)

Use Case 1: embarrassingly parallel application file with set of input data sets (tasks)

to be computed by means of program pgm (f)

results stored back to a file

variants:

tasks from the samedata set

tasks from commchannels

3

PGM(f)

xn, ... x2, x1 f(xn), ... f(x2), f(x1)

Page 4: European and Chinese Cooperation on Gridechogrid.ercim.eu/images/stories/Presentation2WS/WS1029/... · 2009-10-14 · M. Cole PhD Thesis (1988) Template based implementation Imperial

Second EchoGrid Workshop Beijing – 29 & 30 October 2007

UC1: qualifying features (grid!)

input data available at one site experiment location, satellite receiver, DBMS, ...

results needed at one side

coarse grain f time spent computing >> time spent communicating

lots of computing resources “f enabled” available

4

Page 5: European and Chinese Cooperation on Gridechogrid.ercim.eu/images/stories/Presentation2WS/WS1029/... · 2009-10-14 · M. Cole PhD Thesis (1988) Template based implementation Imperial

Second EchoGrid Workshop Beijing – 29 & 30 October 2007

UC1 the “grid aware” way

functional concern code for f, code retrieving input tasks and storing final

results

non functional concerns resource recruitment

code staging and scheduling

data staging (to and from remote PEs)

explicit communication/synchronization handling

5

Page 6: European and Chinese Cooperation on Gridechogrid.ercim.eu/images/stories/Presentation2WS/WS1029/... · 2009-10-14 · M. Cole PhD Thesis (1988) Template based implementation Imperial

Second EchoGrid Workshop Beijing – 29 & 30 October 2007

UC1 the “grid aware” way (2)

non functional concerns (2) security

data and code staging, code execution

load balancing

static and dynamic concern (PE power and PE load)

fault tolerance

model, implementation

efficiency

6

Page 7: European and Chinese Cooperation on Gridechogrid.ercim.eu/images/stories/Presentation2WS/WS1029/... · 2009-10-14 · M. Cole PhD Thesis (1988) Template based implementation Imperial

Second EchoGrid Workshop Beijing – 29 & 30 October 2007

Sample case (UC2)

Use Case 2: stencil data parallel application input data set: regular or irregular collection

iterative processing:

new item(i) = f(item(i), neighborhood(i))

check convergence (local + global)

store result: regular or irregular new collection

7

Page 8: European and Chinese Cooperation on Gridechogrid.ercim.eu/images/stories/Presentation2WS/WS1029/... · 2009-10-14 · M. Cole PhD Thesis (1988) Template based implementation Imperial

Second EchoGrid Workshop Beijing – 29 & 30 October 2007

UC2 the “grid aware” way

additional non functional concerns co-{mapping, scheduling}

at each loop iteration

synchronization data exchange

tradeoff

grain partitioning

8

Page 9: European and Chinese Cooperation on Gridechogrid.ercim.eu/images/stories/Presentation2WS/WS1029/... · 2009-10-14 · M. Cole PhD Thesis (1988) Template based implementation Imperial

Second EchoGrid Workshop Beijing – 29 & 30 October 2007

UC3: autonomic adaptation to irregularity

Irregularity sources irregular applications, non dedicated target hw,

faults, ...

Properly handling: recognize misbehaviors

adopt corrective policies

plan policy implementation

eventually implement planned actions

9

Monitor

Analize

Plan

Execute

Page 10: European and Chinese Cooperation on Gridechogrid.ercim.eu/images/stories/Presentation2WS/WS1029/... · 2009-10-14 · M. Cole PhD Thesis (1988) Template based implementation Imperial

Second EchoGrid Workshop Beijing – 29 & 30 October 2007

Alternative approach

Structured parallel programming provide programmers with pre-defined, customizable,

optimized, possibly composable parallelism exploitation patterns

programmers: build applications using the pattern building blocks & provide seq hooks and code parameters to the patterns

system (compiler + run time): take completely care of all non functional aspects

10

Page 11: European and Chinese Cooperation on Gridechogrid.ercim.eu/images/stories/Presentation2WS/WS1029/... · 2009-10-14 · M. Cole PhD Thesis (1988) Template based implementation Imperial

Second EchoGrid Workshop Beijing – 29 & 30 October 2007

Key idea (1)

Separation of concerns (functional-non functional) at the very beginning (late ‘80)

qualitative parallelism expressed by programmers strictly exploited “as is”

later one (early ‘00)

programmer qualitative parallelism partially drives/suggests the actual implementation

tool optimizations can radically change the parallelism exploitation pattern used

11

Page 12: European and Chinese Cooperation on Gridechogrid.ercim.eu/images/stories/Presentation2WS/WS1029/... · 2009-10-14 · M. Cole PhD Thesis (1988) Template based implementation Imperial

Second EchoGrid Workshop Beijing – 29 & 30 October 2007

Key idea (2)

Restricted parallelism exploitation pattern set restrict building blocks to effective ones

in insulation when composed

effective

efficient implementation known efficient composition known efficient optimization/adaptation policies known

12

Page 13: European and Chinese Cooperation on Gridechogrid.ercim.eu/images/stories/Presentation2WS/WS1029/... · 2009-10-14 · M. Cole PhD Thesis (1988) Template based implementation Imperial

Second EchoGrid Workshop Beijing – 29 & 30 October 2007

Key idea (3)

skeleton language or

skeleton library

exploit state of the art skeleton/pattern implementation

13

Page 14: European and Chinese Cooperation on Gridechogrid.ercim.eu/images/stories/Presentation2WS/WS1029/... · 2009-10-14 · M. Cole PhD Thesis (1988) Template based implementation Imperial

Second EchoGrid Workshop Beijing – 29 & 30 October 2007

Typical skeletons/parallel patterns

Stream/control parallel pipeline, farm, loops

Data parallel map, reduce, prefix, stencil, ...

Other divide&conquer, parmod

14

Page 15: European and Chinese Cooperation on Gridechogrid.ercim.eu/images/stories/Presentation2WS/WS1029/... · 2009-10-14 · M. Cole PhD Thesis (1988) Template based implementation Imperial

Second EchoGrid Workshop Beijing – 29 & 30 October 2007

Typical Grid applications

UC1: embarrassingly parallel pipe(taskGenerator,

farm(f), resultSink)

UC2: data parallel (stencil) loop(

pipe(map(gather), map(f), map(reduce) ) )

15

Page 16: European and Chinese Cooperation on Gridechogrid.ercim.eu/images/stories/Presentation2WS/WS1029/... · 2009-10-14 · M. Cole PhD Thesis (1988) Template based implementation Imperial

Second EchoGrid Workshop Beijing – 29 & 30 October 2007

Tradeoffs

large vs. small skeleton set

general purpose vs. domain specific skeletons

single vs. multiple host language supported

library vs. language

skeletons vs. patterns

fixed set vs. expandable (user defined skeletons)

...

16

Page 17: European and Chinese Cooperation on Gridechogrid.ercim.eu/images/stories/Presentation2WS/WS1029/... · 2009-10-14 · M. Cole PhD Thesis (1988) Template based implementation Imperial

Second EchoGrid Workshop Beijing – 29 & 30 October 2007

Skeleton systems: implementation templates

Template know, parametric, efficient

process network implementing skeleton

performance model use to predict/monitor perf

Compiler generative process

heuristics

17

Skeleton

source code

Skeleton

template

library

Compiler

Process network

+ seq process

code

Comm

library

Process mapperscheduler

Target HW

Static

Dynamic

Page 18: European and Chinese Cooperation on Gridechogrid.ercim.eu/images/stories/Presentation2WS/WS1029/... · 2009-10-14 · M. Cole PhD Thesis (1988) Template based implementation Imperial

Second EchoGrid Workshop Beijing – 29 & 30 October 2007

Sample template (1)

Skeleton: Task Farm

Target: COW/NOW

Semantics: given x1 ... xn compute f(x1) ... f(xn) in parallel

Implementation: Master worker (N workers)

Performance model: Service time = max { Tcomm, Tseq/N }

Process network: Emitter,string of Workers, Collector

18

E

W

W

C

W

Page 19: European and Chinese Cooperation on Gridechogrid.ercim.eu/images/stories/Presentation2WS/WS1029/... · 2009-10-14 · M. Cole PhD Thesis (1988) Template based implementation Imperial

Second EchoGrid Workshop Beijing – 29 & 30 October 2007

Sample template (2)

Skeleton: Task Farm

Target: Multicore/SMP

Semantics: given x1 ... xn compute f(x1) ... f(xn) in parallel

Implementation: Master worker (N threads)

Performance model: Service time = max { Tcomm_shm, Tseq/N }

Process network: One process, multithreaded

19

E/C(sharedmem)

W W W

Page 20: European and Chinese Cooperation on Gridechogrid.ercim.eu/images/stories/Presentation2WS/WS1029/... · 2009-10-14 · M. Cole PhD Thesis (1988) Template based implementation Imperial

Second EchoGrid Workshop Beijing – 29 & 30 October 2007

Skeleton systems: macro data flow

Macro Data Flow MDF instructions compute

large sequential functions

Distributed interpreter fetch & execute fireable

instructions from a logically centralized pool

optimization, heuristics, ...

20

Skeleton

source code

Compiler

Marco Data Flow

Graph

MDF Interpreter Target HW

Static

Dynamic

Page 21: European and Chinese Cooperation on Gridechogrid.ercim.eu/images/stories/Presentation2WS/WS1029/... · 2009-10-14 · M. Cole PhD Thesis (1988) Template based implementation Imperial

Second EchoGrid Workshop Beijing – 29 & 30 October 2007

Sample application

UC1 pipeline(seq,farm,seq)

plain template composition

number of workers estimated (perf. model) or dynamically optimized

21

E

W

W

C

W

inP OutP

Page 22: European and Chinese Cooperation on Gridechogrid.ercim.eu/images/stories/Presentation2WS/WS1029/... · 2009-10-14 · M. Cole PhD Thesis (1988) Template based implementation Imperial

Second EchoGrid Workshop Beijing – 29 & 30 October 2007

Sample application (2)

Optimizations grouping seq processes

on different PEs

more complex opts:secure comms on nodesreached through public network segments

22

E

W

W

C .

W

inP OutP

E

W

W

C .

W

inP OutP

Page 23: European and Chinese Cooperation on Gridechogrid.ercim.eu/images/stories/Presentation2WS/WS1029/... · 2009-10-14 · M. Cole PhD Thesis (1988) Template based implementation Imperial

Second EchoGrid Workshop Beijing – 29 & 30 October 2007

Results (expected)

Raise level of abstraction (programmers)

Hide target hw

Implement state of the art solutions without reinventing the wheel for each application

Improve possibilities to implement autonomic management knowledge from tools vs. from programmer code

analysis

23

Page 24: European and Chinese Cooperation on Gridechogrid.ercim.eu/images/stories/Presentation2WS/WS1029/... · 2009-10-14 · M. Cole PhD Thesis (1988) Template based implementation Imperial

Second EchoGrid Workshop Beijing – 29 & 30 October 2007

Structured parallel programming: the background (part of)

24

M. Cole PhD Thesis (1988)Template based implementation

Imperial College (1990)functional -> FORTRAN-S

Univ. of Pisa P3L (1991)

SkIE (industrial remake of P3L, 1996)

ASSIST (with ASI/PQE, 2000)

OcamlP3L (1998)

Lithium(2000)

Muskel (2003)

MacroDataFlowimplementation (1999)

BirdMerteens Formalism

Gorlatch ('90)transformations

HoC (2005)Skel+WS

Parallel DesignPatterns

CO2P3S (2000)

Extensible CO2P3S (2002)

Skipper(2000)

SKIL (1998)

Muesli (2005)

Page 25: European and Chinese Cooperation on Gridechogrid.ercim.eu/images/stories/Presentation2WS/WS1029/... · 2009-10-14 · M. Cole PhD Thesis (1988) Template based implementation Imperial

Second EchoGrid Workshop Beijing – 29 & 30 October 2007

Structured programming: grid

25

HOC (2005)

muskel (2004)

ASSIST (2000)

ASSIST 2.0 (2004)

Calcium (2007)

Skeletons

(template based) (macro data flow)

Web services

Components

SCAPOSIX/TCPGlobus

Page 26: European and Chinese Cooperation on Gridechogrid.ercim.eu/images/stories/Presentation2WS/WS1029/... · 2009-10-14 · M. Cole PhD Thesis (1988) Template based implementation Imperial

Second EchoGrid Workshop Beijing – 29 & 30 October 2007

Structured programming: grid

Phase 1: plain skeletons (ASSIST ‘00, muskel ‘04) POSIX/TCP or Globus

Phase 2: components (ASSIST 2.0 ’04, HOC ‘05) ... + WS

Phase 3: autonomic components (ASSIST 2.0, GCM/ProActive) ... + gLite, Unicore, ... , SCA

26

Page 27: European and Chinese Cooperation on Gridechogrid.ercim.eu/images/stories/Presentation2WS/WS1029/... · 2009-10-14 · M. Cole PhD Thesis (1988) Template based implementation Imperial

Second EchoGrid Workshop Beijing – 29 & 30 October 2007

Skeletons to components

mature component technology

asymptote of the skeleton methodology composite components model skeletons

skeleton parameter as components

management made easier (black box components) further separation of concerns

component framework: deployment, lifecycle, ...

composite components: other nonfunctional concerns

27

Page 28: European and Chinese Cooperation on Gridechogrid.ercim.eu/images/stories/Presentation2WS/WS1029/... · 2009-10-14 · M. Cole PhD Thesis (1988) Template based implementation Imperial

Second EchoGrid Workshop Beijing – 29 & 30 October 2007

Components to autonomic

Self-* features added healing, configuration, protection, optimization

Composite components autonomic managers added (active)

“Inner” components autonomic controllers added (passive)

28

Page 29: European and Chinese Cooperation on Gridechogrid.ercim.eu/images/stories/Presentation2WS/WS1029/... · 2009-10-14 · M. Cole PhD Thesis (1988) Template based implementation Imperial

Second EchoGrid Workshop Beijing – 29 & 30 October 2007

Behavioural skeletons (CoreGRID/GridCOMP)

Exploit skeleton idea for management Common parallel programming paradigms,

management can be pre-determined (in a parametric way)

Capturing several aspects of management

Optimization, healing, configuration, protection

Active and passive management

hierarchical application composition

29

Page 30: European and Chinese Cooperation on Gridechogrid.ercim.eu/images/stories/Presentation2WS/WS1029/... · 2009-10-14 · M. Cole PhD Thesis (1988) Template based implementation Imperial

Second EchoGrid Workshop Beijing – 29 & 30 October 2007

Sample behavioural skeleton

Passive (AC is a controller) component can be asked to behave in a specific way

Active (AM is a component) AM takes autonomic

decisionsconcerningcomponentbehaviour

30

Server port(collective)

Client port(collective)

S

W

...

W

WG

ACAC

AM

NF interfaces(server)

NF interfaces (client & server)

Page 31: European and Chinese Cooperation on Gridechogrid.ercim.eu/images/stories/Presentation2WS/WS1029/... · 2009-10-14 · M. Cole PhD Thesis (1988) Template based implementation Imperial

Second EchoGrid Workshop Beijing – 29 & 30 October 2007

UC1

S is a unicast

G is a collect from any

W compute F these are components

AM fault tolerance

NW adaptation

31

Server port(collective)

Client port(collective)

S

W

...

W

WG

ACAC

AM

NF interfaces(server)

NF interfaces (client & server)

Page 32: European and Chinese Cooperation on Gridechogrid.ercim.eu/images/stories/Presentation2WS/WS1029/... · 2009-10-14 · M. Cole PhD Thesis (1988) Template based implementation Imperial

Second EchoGrid Workshop Beijing – 29 & 30 October 2007

Which kind of results ?

ASSIST 2.0

32

Page 33: European and Chinese Cooperation on Gridechogrid.ercim.eu/images/stories/Presentation2WS/WS1029/... · 2009-10-14 · M. Cole PhD Thesis (1988) Template based implementation Imperial

Second EchoGrid Workshop Beijing – 29 & 30 October 2007

Which kind of results ? (2)

GCM

33

Page 34: European and Chinese Cooperation on Gridechogrid.ercim.eu/images/stories/Presentation2WS/WS1029/... · 2009-10-14 · M. Cole PhD Thesis (1988) Template based implementation Imperial

Second EchoGrid Workshop Beijing – 29 & 30 October 2007

Conclusions

Structured parallel programming demonstrated effective in HPC

successful proof of evidence on grids

supports autonomic control/management

What’s needed (still) engineered environments

support for generic legacy components

34

Page 35: European and Chinese Cooperation on Gridechogrid.ercim.eu/images/stories/Presentation2WS/WS1029/... · 2009-10-14 · M. Cole PhD Thesis (1988) Template based implementation Imperial

Second EchoGrid Workshop Beijing – 29 & 30 October 2007

Thank you for your attention

any questions?

[email protected]

35