1 Typed Groups for the Grid Laurent Baduel. 2 Outline Context and Objectives Typed groups...

Post on 26-Mar-2015

219 views 1 download

Tags:

transcript

1

Typed Groupsfor the Grid

Laurent Baduel

2

Outline

Context and Objectives Typed groups Application: Jem3D Object-Oriented SPMD Group extensions and usage Conclusion and Perspectives

3

Introduction

Traditional uses of group communicationFault tolerance, ReplicationApplicative groups, Parallelism

Our objectives: Applicative groupsEfficient communicationCollaborative applicationsEasy structuringObject-oriented programming

4

Analysis of related works 3 projects close to our concerns:

JGroups Centered on low layers of communication Socket programming style

Object Group Service CORBA focused Group communication return only one result (by default)

Group Method Invocation Group members have to implement and extend a

class and an interface

5

Analysis of related works

Lack of transparency Specific interface for functional calls Inheritance from specific classes and

interfaces Sometimes too application/domain-specific

We want to address those problems !

6

Communication model

RMI + important new featuresActive object:

A single thread serves requests with a FIFO service

Asynchronous method call Rendez-vous Transparent futures

Wait-by-necessity Automatic wait upon a strict operation on a future First class futures

7

JVMJVM

Active objectA a = PA.newActive(“A”, […], VirtualNode);V v1 = a.foo (param);V v2 = a.bar (param);…

v1.gee();

a barv1v2 foo

Javaobject

Activeobject

Requestqueue

Future Thread

// Wait-By-Necessity

8

Context and Objectives Typed groups Application: Jem3D Object-Oriented SPMD Group extensions and usage Conclusion and Perspectives

9

Typed group communications

Idea / goalManipulate groups as “plain” Java objectsMaintain the dot notationCode reusability

Creation of a typed groupGroup members have a common type ancestor

public class A { … }A ag = (A) ProActiveG.newGroup(“A”, params, node);

10

Group communications

Remote method invocation on a group Multi-unicast approach

Replication of N single communicationsBased on the standard communication

mechanismEach communication is adapted to the calleeAdapt the rendez-vous to group communicationsAdapt the Wait-by-Necessity mechanism

11

Result of a group communication

Result is dynamically built and updatedV vg = ag.foo();

Immediately operablevg.gee();

Rank property Synchronization primitiveProActiveGroup.waitOne(vg);

ProActiveGroup.waitAll(vg);

Object o = ProActiveGroup.waitAndGetOne(vg);

12

Group call

JVM

JVM

JVM

JVM

agvg

A ag = PAG.newGroup(“A”,…,vn);V vg = ag.foo(param);…

vg.gee();…

// Wait-By-Necessity

13

Two representations

Management operations: add, remove, etc.

Two representations of a same groupTyped group (type of the members)

Group of objects (extends Collection)

Ability to switch between themGroup groupA = ProActive.getGroup(ag);

groupA.add(new A());groupA.add(new B()); // B extends A

A ag2 = (A) groupA.getTypedGroup();

14

Two representations schema

Managementof the group

Functional use of the group

Group of objectsgroupA

getGroupstatic method of class ProActive

getTypedGroupmethod of class Group

Typed groupgA

Single JavaRepresentation

(Transparent) (Explicit)

15

Broadcast or scatter

Broadcast is the default behavior Scatter is also possible

Scatter uses a group as parameterDistribution relies on rank

ag.bar(cg); // broadcast cg

ProActive.setScatterGroup(cg);

ag.bar(cg); // scatter cg

One call may scatter and broadcast

16

Broadcast or scatter

JVM

JVM

JVM

JVM

agcg

ag.bar(cg); // broadcast cgProActive.setScatterGroup(cg);ag.bar(cg); // scatter cg

c1 c2c3c1 c2c3

c1 c2c3c1 c2c3

c1 c2c3

c1 c2c3

s

c1 c2c3

s

17

Static Dispatch Group

JVM

JVM

JVM

JVM

agcg

c1

c2

c3

c4

c5

c6

c7

c8c0

c9c1

c2

c3

c4

c5

c6

c7

c8c0

c9

c1

c2

c3

c4

c5

c6

c7

c8c0

c9

Slowest

Fastestemptyqueue

ag.bar(cg);

18

Dynamic Dispatch Group

JVM

JVM

JVM

JVM

agcg

c1

c2

c3

c4

c5

c6

c7

c8c0

c9c1

c2

c3

c4

c5

c6

c7

c8c0

c9

c1

c2

c3

c4

c5

c6

c7

c8c0

c9

Slowest

Fastest

ag.bar(cg);

19

Performances and Optimizations Common operation

Single reificationSingle serialization

Parallel calls (adaptive thread pool)

20

Error management Using Java exceptions

Common way to express failure in Java A group may produce several exceptions

during one communication Result group is used to store exceptions The ExceptionList is an exception that

contains raised exceptions associated with a reference to the object that produced them

21

Error interception

JVM

JVM

JVM

JVM

agvg

V vg = ag.foo (param);Group groupV = PAG.getGroup(vg);groupV.getExceptionList();vg.gee();

failure

Except.

Except.List

22

Active and hierarchical groups

Active group: a group serviceA group becomes remotely accessibleModifiable service policy

Hierarchical groupA group of groupsDynamically builtAchieves scalability

23

grid frontal

cluster

clusterclustercluster

Grid deployment

Asynchronous callSynchronous call

24

Grid method calls Grid’5000

25

Context and Objectives Typed groups Application: Jem3D Object-Oriented SPMD Group extensions and usage Conclusion and Perspectives

26

Jem3D Translation of a FORTRAN application:

EM3D Solves 3D Maxwell equations Relies on finite volume approximation

method Works on unstructured tetrahedral

discretization of the computation domain

27

Communication based on groups

Groups allow sub-domains communication

28

Algorithm of Jem3D

Initialization

Compute mag. field, and update elec. field

Compute elec. field, and update mag. field

Calculation of the discreteelectromagnetic energy

Solution Saving

t < tmax

t = tmax

Intensive group communications

29

Jem3D

Computation of the propagation of an electromagnetic wave in a cubic metallic cavity (standard test case)

INRIA Sophia’s clusterDAS-2

30

Context and Objectives Typed groups Application: Jem3D Object-Oriented SPMD Group extensions and usage Conclusion and Perspectives

31

Main MPI problems for the Grid

Too static in design Too complex interface (API)

More than 200 primitives and 80 constants Too many specific primitives to be adaptive

Send, Bsend, Rsend, Ssend, Ibsend, etc. Typeless (message passing)

Manual management of complex data structures

32

Object-Oriented SPMD

MotivationCluster / Grid programmingSPMD programming widely used

Already able to express most of the MPI’s collective communicationsBroadcastScatter

Different barriers Topologies

Gather Reduce

(Single Program Multiple Data)

All scatterAll gather

33

JVM

JVM

JVM

JVM

JVM

JVM

JVM

JVM

JVM

JVM

SPMD group CreationA ag = ProActive.newSPMDGroup(“A”, … );

34

SPMD Group

SPMD Group is a typed group where members get:Local reference to the SPMD group they

belongs toMembershipAccess to their rank

35

Topologies

Topologies are groups of objectsPlan plan = new Plan(groupSPMD, dimensions); Open API

Neighborhood Creation by extractionLine line = plan.getLine(0);

36

The Jacobi iterations example

Solve a linear system of equations Typical SPMD program Algorithm loops on:

Exchange dataWait for dataComputeLoop (until exit condition is satisfied)

37

Jacobi algorithm

JVM

JVM

JVM

JVM

JVM

JVM

JVM

JVM

JVM

2 5 7 9 1 0 1 0 5 6 7 8 ……

38

Global barrier Involves all group membersProActive.barrier(“barrierID”);

JVM

JVMJVM

JVM

JVM

JVM

JVM

JVM

JVM

JVM

39

Neighbor-based barrier Involves only the caller and its neighborsProActive.barrier(“barrierID”, neighbors);

JVM

JVM

JVM

JVM

JVM

JVM

JVM

JVM

JVM

JVM

40

Method-based barrier Involves only the caller (no additional messages)

ProActive.barrier({“foo”, “bar”, “gee”});

JVM

JVMJVM

JVM

JVM

JVM

JVM

JVM

JVM

JVM

41

OO SPMD model

A simple communication modelSmall APINo explicit receive: data flow synchronizationNo message passing: asynchronous RPCComplex data structures (Objects)

SPMD groups are dynamicDedicated barriersTopologies

42

Context and Objectives Typed groups Application: Jem3D Object-Oriented SPMD Group extensions and usage Conclusion and Perspectives

43

Group behavior manager

Definition of a group behaviorRequest mappingParameters distributionResults gatheringSynchronization semantic

Dynamic configuration and binding IP Multicast library

Bindings to multicast transport protocolTRAM, included in JRMS 1.1

In collaboration with University of Sannio – Benevento (Italy)

44

Groups in the component framework Implementation of the Fractal component model Collective ports Composite components

Typed group

At binding,on client interface

At composition,on composite inner server interface

Typed groupParallel Component

45

Context and Objectives Typed groups Application: Jem3D Object-Oriented SPMD Group extensions and usage Conclusion and Perspectives

46

Conclusion High level, Efficient, Transparent, Typed

Group CommunicationNo dedicated inheritance requirementDynamic handling of resultsHigh level synchronization

Tested with a real size application Object-Oriented model for SPMD

ProgrammingMore flexibleEasier to use

47

Perspectives

Exception handling Improvement of the adaptive thread pool Integrate other group semantics MxN redistribution for components Further development of the OO SPMD

model

48

Thank you for your attention

? ? ? Questions ? ? ?