1 Typed Groups for 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 communication Fault tolerance, Replication Applicative groups, Parallelism Our objectives: Applicative groups Efficient communication Collaborative applications Easy structuring Object-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 features Active 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 JVM Active object A a = PA.newActive(A, […], VirtualNode); V v1 = a.foo (param); V v2 = a.bar (param); … v1.gee(); a bar v1 v2 foo Java object Active object Request queue FutureThread // 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 / goal Manipulate groups as plain Java objects Maintain the dot notation Code reusability Creation of a typed group Group 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 communications Based on the standard communication mechanism Each communication is adapted to the callee Adapt the rendez-vous to group communications Adapt the Wait-by-Necessity mechanism
11 Result of a group communication Result is dynamically built and updated V vg = ag.foo(); Immediately operable vg.gee(); Rank property Synchronization primitive ProActiveGroup.waitOne(vg); ProActiveGroup.waitAll(vg); Object o = ProActiveGroup.waitAndGetOne(vg);
12 Group call JVM ag vg 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 group Typed group (type of the members) Group of objects (extends Collection ) Ability to switch between them Group groupA = ProActive.getGroup(ag); groupA.add(new A()); groupA.add(new B()); // B extends A A ag2 = (A) groupA.getTypedGroup();
14 Two representations schema Management of the group Functional use of the group Group of objects groupA getGroup static method of class ProActive getTypedGroup method of class Group Typed group gA Single Java Representation (Transparent) (Explicit)
15 Broadcast or scatter Broadcast is the default behavior Scatter is also possible Scatter uses a group as parameter Distribution 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 ag cg ag.bar(cg); // broadcast cg ProActive.setScatterGroup(cg) ; ag.bar(cg); // scatter cg c1 c2 c3 c1 c2 c3 c1 c2 c3 c1 c2 c3 c1 c2 c3 c1 c2 c3 s c1 c2 c3 s
17 Static Dispatch Group JVM ag cg 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 empty queue ag.bar(cg);
18 Dynamic Dispatch Group JVM ag cg 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 reification Single 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 ag vg V vg = ag.foo (param) ; Group groupV = PAG.getGroup(vg); groupV.getExceptionList(); vg.gee(); failure Except. List
22 Active and hierarchical groups Active group: a group service A group becomes remotely accessible Modifiable service policy Hierarchical group A group of groups Dynamically built Achieves scalability
23 grid frontal cluster Grid deployment Asynchronous call Synchronous call
24 Grid method calls Grid5000
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 discrete electromagnetic energy Solution Saving t < t max t = t max Intensive group communications
29 Jem3D Computation of the propagation of an electromagnetic wave in a cubic metallic cavity (standard test case) INRIA Sophias 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 Motivation Cluster / Grid programming SPMD programming widely used Already able to express most of the MPIs collective communications Broadcast Scatter Different barriers Topologies Gather Reduce (Single Program Multiple Data) All scatter All gather
33 JVM SPMD group Creation A ag = ProActive.newSPMDGroup(A, … );
34 SPMD Group SPMD Group is a typed group where members get: Local reference to the SPMD group they belongs to Membership Access to their rank
35 Topologies Topologies are groups of objects P lan plan = new Plan(groupSPMD, dimensions) ; Open API Neighborhood Creation by extraction Line line = plan.getLine(0);
36 The Jacobi iterations example Solve a linear system of equations Typical SPMD program Algorithm loops on: Exchange data Wait for data Compute Loop (until exit condition is satisfied)
37 Jacobi algorithm JVM … …
38 Global barrier Involves all group members ProActive.barrier(barrierID); JVM
39 Neighbor-based barrier Involves only the caller and its neighbors ProActive.barrier(barrierID, neighbors); JVM
40 Method-based barrier Involves only the caller (no additional messages) ProActive.barrier({foo, bar, gee}); JVM
41 OO SPMD model A simple communication model Small API No explicit receive: data flow synchronization No message passing: asynchronous RPC Complex data structures (Objects) SPMD groups are dynamic Dedicated barriers Topologies
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 behavior Request mapping Parameters distribution Results gathering Synchronization semantic Dynamic configuration and binding IP Multicast library Bindings to multicast transport protocol TRAM, 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 group Parallel 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 Communication No dedicated inheritance requirement Dynamic handling of results High level synchronization Tested with a real size application Object-Oriented model for SPMD Programming More flexible Easier 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 ? ? ?