20
1 On MDE to implement a Component Assembly Compiler for HPC Journées IDM, June the 7th 2011 Julien Bigot* , Christian Laboratoire de l’Informatique du Parallelisme (LIP) EN

1 On MDE to implement a Component Assembly Compiler for HPC Journées IDM, June the 7th 2011 Julien Bigot*, Christian Pérez* Laboratoire de l’Informatique

Embed Size (px)

Citation preview

Page 1: 1 On MDE to implement a Component Assembly Compiler for HPC Journées IDM, June the 7th 2011 Julien Bigot*, Christian Pérez* Laboratoire de l’Informatique

1

On MDE to implement a Component Assembly Compiler for HPC

Journées IDM, June the 7th 2011

Julien Bigot*, Christian Pérez*Laboratoire de l’Informatique du Parallelisme (LIP) ENS Lyon

Page 2: 1 On MDE to implement a Component Assembly Compiler for HPC Journées IDM, June the 7th 2011 Julien Bigot*, Christian Pérez* Laboratoire de l’Informatique

2

Context: High Performance Computing

•Scientific applications• Domain specialist code

• Long life cycle (~30 years)

• Computation intensive

•Hardware• Heterogeneous

– Supercomputers– Computing clusters– Computing grids– Clouds

• Parallel

• Short life cycle (~3 years)

•Programming model• Low level, fine-tuning of code

• Hand made … and remade

Thermal

Optics

Dynamics

Structural Mechanics

SAN SAN

Cluster

LAN

WAN

Supercomputer

GridSupercomputer

Cluster

Satellite modeling ? programmingmodels

Page 3: 1 On MDE to implement a Component Assembly Compiler for HPC Journées IDM, June the 7th 2011 Julien Bigot*, Christian Pérez* Laboratoire de l’Informatique

3

Outline

•Context: High Performance Computing (HPC)

•High Level Component Model (HLCM) Modeling and Implementation

•Feedback on the Model Driven Approach

•Conclusion

Page 4: 1 On MDE to implement a Component Assembly Compiler for HPC Journées IDM, June the 7th 2011 Julien Bigot*, Christian Pérez* Laboratoire de l’Informatique

4

Programming model requirements

•Ease of development• Domain specialist: Domain code / support code separation

• Long life cycle: clean code behavior and interface specification

•High Performance• Minimal overhead

• Support for parallelism

•Hardware evolution• Algorithm optimization

• Interaction optimization

– E.g. distributed memory vs. shared memory

Software Components

Page 5: 1 On MDE to implement a Component Assembly Compiler for HPC Journées IDM, June the 7th 2011 Julien Bigot*, Christian Pérez* Laboratoire de l’Informatique

5

Software components

•Components• black boxes

• Interactions through well defined interaction points

•Application• Set of interconnected instances

• High level view of architecture

•Separation of concern• Domain code: components

• Support: component model

•Eased reuse• Well defined interface & behavior

CmpA CmpB

a

b

c

d

c1 c2

Page 6: 1 On MDE to implement a Component Assembly Compiler for HPC Journées IDM, June the 7th 2011 Julien Bigot*, Christian Pérez* Laboratoire de l’Informatique

6

Software Component Models

•Industrial Component Models (CORBA Component Model, Enterprise JavaBeans, …)

• Transparent distribution support (CORBA, JavaRMI, …)

• Overhead for same host components

•Research Component Models (Fractal, …)• Interesting features (Hierarchy, Connectors, …)

• Features handled at runtime, additional costs

•High Performance Component Models (CCA, …)• Acceptable overheads

• Low level of abstraction => Hardware adaptation complex

Page 7: 1 On MDE to implement a Component Assembly Compiler for HPC Journées IDM, June the 7th 2011 Julien Bigot*, Christian Pérez* Laboratoire de l’Informatique

7

Programming model requirements

•Ease of development• Domain specialist: Domain code / support code separation

• Long life cycle: clean code behavior and interface specification

•High Performance• Minimal overhead

• Support for parallelism

•Hardware evolution• Algorithm optimization

• Interaction optimization

– E.g. distributed memory vs. shared memory

Software Components

Component implementation choice

Page 8: 1 On MDE to implement a Component Assembly Compiler for HPC Journées IDM, June the 7th 2011 Julien Bigot*, Christian Pérez* Laboratoire de l’Informatique

8

Multiple alternative implementations

•Distinction type/implementation• Type: name + ports

• Implementation: behavior

•Choice• Depending on available hardware

CmpA

I1 I2

Page 9: 1 On MDE to implement a Component Assembly Compiler for HPC Journées IDM, June the 7th 2011 Julien Bigot*, Christian Pérez* Laboratoire de l’Informatique

9

Programming model requirements

•Ease of development• Domain specialist: Domain code / support code separation

• Long life cycle: clean code behavior and interface specification

•High Performance• Minimal overhead

• Support for parallelism

•Hardware evolution• Algorithm optimization

• Interaction optimization

– E.g. distributed memory vs. shared memory

Software Components

Component implementation choice

1st class Software Connectors

with implementation choice

Page 10: 1 On MDE to implement a Component Assembly Compiler for HPC Journées IDM, June the 7th 2011 Julien Bigot*, Christian Pérez* Laboratoire de l’Informatique

10

1st class software connectors

•1st class entity• A Name

• Set of roles

• Multiple alternative implementations

•Hardware optimization possible• Interaction code well identified

• Multiple versions possible

• More application specific interactions

UP

CmpA CmpB

CmpA CmpB

ports

roles

user provider

Page 11: 1 On MDE to implement a Component Assembly Compiler for HPC Journées IDM, June the 7th 2011 Julien Bigot*, Christian Pérez* Laboratoire de l’Informatique

11

Programming model requirements

•Ease of development• Domain specialist: Domain code / support code separation

• Long life cycle: clean code behavior and interface specification

•High Performance• Minimal overhead

• Support for parallelism

•Hardware evolution• Algorithm optimization

• Interaction optimization

– E.g. distributed memory vs. shared memory

Software Components

Algorithmic skeletons,

generic programming & hierarchy

Component implementation choice

1st class Software Connectors

with implementation choice

Page 12: 1 On MDE to implement a Component Assembly Compiler for HPC Journées IDM, June the 7th 2011 Julien Bigot*, Christian Pérez* Laboratoire de l’Informatique

12

Generic programming & hierarchy:Algorithmic skeletons

Disp<I> Coll<O>

W

W

W

Farm<W, I, O, N>

.

.

.N times

I O

Farm

Page 13: 1 On MDE to implement a Component Assembly Compiler for HPC Journées IDM, June the 7th 2011 Julien Bigot*, Christian Pérez* Laboratoire de l’Informatique

13

Programming model requirements

•Ease of development• Domain specialist: Domain code / support code separation

• Long life cycle: clean code behavior and interface specification

•High Performance• Minimal overhead

• Support for parallelism

•Hardware evolution• Algorithm optimization

• Interaction optimization

– E.g. distributed memory vs. shared memory

Software Components

Compilation based approach

Algorithmic skeletons,

generic programming & hierarchy

Component implementation choice

1st class Software Connectors

with implementation choice

No need for new components, only a new assembly model

Page 14: 1 On MDE to implement a Component Assembly Compiler for HPC Journées IDM, June the 7th 2011 Julien Bigot*, Christian Pérez* Laboratoire de l’Informatique

14

HLCM Compilation

Reuse an existing component model (L²C)

HLCM: Genericity Hierarchy Connectors Multi-Implem

L²C: Low Level Primitive components

only Various interaction

C++ MPI CORBA …

Hardware description

PIM PSM

PDM

MDA

Page 15: 1 On MDE to implement a Component Assembly Compiler for HPC Journées IDM, June the 7th 2011 Julien Bigot*, Christian Pérez* Laboratoire de l’Informatique

15

HCLM (Meta)Modeling

•Using the Eclipse Modeling Framework (EMF)

•PIM• Main classes: ComponentType, PortType, Connector, …

• Primitive implementations: abstract

• Some patterns identified: genericity, implementation choice

• 130 Ecore metaclasses (490 lines of EMFatic)

• 2000 utility Java lines

•PSM• Main classes: ComponentInstance, Connexion, …

• References to the PIM in each instance

• 41 Ecore metaclasses (160 lines of EMFatic)

• 800 utility Java lines

Page 16: 1 On MDE to implement a Component Assembly Compiler for HPC Journées IDM, June the 7th 2011 Julien Bigot*, Christian Pérez* Laboratoire de l’Informatique

16

HCLM Transformation

•Four step transformation• Parsing HLCM: 400 lines Xtext annotated grammar

• Compilation: 4000 lines plain Java

• PSM to Backend

• Backend Model Dump

•Compilation• Choosing implementations (delegated to an external “oracle”)

• Concretizing generic elements

• Flattening composites

• Until convergence: only primitive elements

•Final dump• Often single hand made step

Backend specific

Page 17: 1 On MDE to implement a Component Assembly Compiler for HPC Journées IDM, June the 7th 2011 Julien Bigot*, Christian Pérez* Laboratoire de l’Informatique

17

Feedback (1/2)

•Modeling tools: huge gain of time• Modeling HLCM

– Initial attempt with plain Java: ~1 month work

– Second attempt with Ecore: ~2 days work

• Direct concrete syntax to model parsing (Xtext)

•Ease of comprehension• Most concepts intuitive with UML background

• Various level of modeling confusing (model vs. metamodel)

– E.g. connectors

– Fixed set of interactions: various connectors in the metamodel

– 1st class connectors: various connectors in the model

– Combination predefined connectors + user defined : ???

– E.g. genericity: manipulation of metamodel elements in the model

About same state

Page 18: 1 On MDE to implement a Component Assembly Compiler for HPC Journées IDM, June the 7th 2011 Julien Bigot*, Christian Pérez* Laboratoire de l’Informatique

18

Feedback (2/2)

•Model transformation• Transformation tools not ready 2 years ago (Kermeta , QVT, ATL)

• Plain java transformation

– API not human friendly

– Collection access => whole collection traversal

– Omnipresent type casts (constraint not expressible in Ecore)

– Error complex to associate with user error

• Constraint language evaluation required

•Real use• Applications: Parallel method calls, shared memory, Domain

decomposition

• Backends: L²C , Pure Java, CCM, Charm++, …

• Transformation speed: 1500+ components, ≤ 10secs

Page 19: 1 On MDE to implement a Component Assembly Compiler for HPC Journées IDM, June the 7th 2011 Julien Bigot*, Christian Pérez* Laboratoire de l’Informatique

19

Conclusion

•HLCM: a component assembly model for HPC• Hierarchy, Generic Programming, Connectors, Alternative

Implementations

– Efficiency possible on a wide range of hardware

• A model based implementation

– Lot of time gained

– Some tools not used due to immaturity

• Usable in real world

•Perspectives / future work• Re-evaluate modeling tools (ATL, OCL, …)

• Introduce the time dimension in HLCM

– Models@runtime ?

Page 20: 1 On MDE to implement a Component Assembly Compiler for HPC Journées IDM, June the 7th 2011 Julien Bigot*, Christian Pérez* Laboratoire de l’Informatique

20