ObjectOriented SPMD Laurent Baduel Denis Caromel Franoise Baude
Object-Oriented SPMD Laurent Baduel, Denis Caromel, Françoise Baude
Context & Objectives n Traditional use of group communication • Fault tolerance, replication, database • Applicative groups, parallelism n Our objectives • • Collaborative applications More efficient communication Simplicity and easy structuring Object-oriented programming
Communication model n Java RMI + new important features • Sequential Object: • a single thread with FIFO service • Asynchronous method call • rendez-vous • Futures • Wait-by-Necessity • Automatic wait upon a strict operation on a future • First class futures: – Futures can be passed to other activities – Sending a future to another machines is not blocking
Active Object A ag = PA. new. Active (“A”, […], Virtual. Node) V v 1 = ag. foo (param); Wait-By-Necessity V v 2 = ag. bar (param); is a. . . JVM v 1. gee(); //Wait-By-Necessity JVM v 2 v 1 ag Java Object Future Object A Dataflow Synchronization foo bar Req. Queue Active Object Thread
Typed group communication n Idea / Goals • Manipulate groups as ‘plain’ Java objects • Maintain the ‘dot’ notation • Code reusability n Creation of typed group • Group members have a common type ancestor public class A { … } A g. A = Pro. Active. new. Group(“A”, params, nodes);
Group communication n Remote method invocation on a group n Multi-unicast approach • Based on the Pro. Active communication mechanism • Replication of N ‘single’ communication • Each communication is adapted • Preserve the rendez-vous
Group : the result of a Group Communication n Result are dynamically B group. B = group. A. foo(); n built and updated Ranking order property n Synchronization primitive Pro. Active. wait. One(gb); Pro. Active. wait. All(gb);
Construction of a result group B group. B = group. A. foo(); A B Typed group Java object
Two representations n Management operations: add, remove, … n 2 representations (views) of a same group • Typed group • Group of object n Ability to switch between those 2 views Group group. A = Pro. Active. get. Group(g. A); group. A. add(new A()); group. A. add(new B()); // B herits from A A g. A 2 = (A) group. A. get. Group. By. Type();
Broadcast or scatter n Broadcast is the default behavior n Scatter is also possible • use a group as parameter • Scattered depends on rankings g. A. bar(g. C); // broadcast g. C Pro. Active. set. Scatter. Group(g. C); ga. bar(g. C); // scatter g. C n One call may scatter and broadcast
Features of groups n Optimization • Parallel calls within a group (adaptive threadpool) • Treatment in the result return order • Single serialization n Flexibility: Active group • A group becomes remotely accessible • Modifiable service policy
Main MPI problems for the GRID n Too static in design n Too complex in Interface (API) n Too many specific primitives to be adaptive n Type Less
Object-Oriented SPMD n Motivation • Cluster / GRID computing • SPMD programming notoriety n Able to express most of MPI’s collective communications • broadcast • scatter • gather n Different barriers • reduce • allscatter • allgather
SPMD group n Creation A ag = Pro. Active. new. SPMDGroup(“A”, . . . ); A
Topologies n n Topologies are typed groups Open API Neighborhood Creation by extraction Plan plan = new Plan(group. A, Dimensions); Line line = plan. get. Line(0);
The Jacobi Iteration example n n n Solve a linear system of equations Typical SPMD program Algorithm loop on: • • exchange data wait for the data compute loop (until exit condition is satisfied)
Global barrier n Involves all group member Pro. Active. barrier(“barrier. ID”); A
Neighbor-based barrier n Involves only the caller and it neighbors Pro. Active. barrier(“barrier. ID”, neighbors); A
Method-based Barrier n Involves only the caller • no additional messages Pro. Active. barrier(“foo”, “bar”, “gee”); A
Pro. Active OO SPMD n A simple communication model • • • Small API No “Receive” but data flow synchronization No message passing but RPC Complex data structure (Object) SPMD groups are dynamic Efficient and dedicated barrier
? ? ? Questions ? ? ?
Two representations Management of the group get. Group method of class Group of objects group. A Typed group g. A get. Group. By. Type static method of class Pro. Active Functional use of the group
Group communication is now a key feature of Pro. Active n Used in many applications and other features Chat Jem 3 D Peer to peer Multiport component
Common operation factorization
Thread pool
Hierarchical groups n Group contains groups • Add a typed group into a group n Benefit of the network structure A A
- Slides: 28