Presentation is loading. Please wait.

Presentation is loading. Please wait.

Active Objects & Co. First Year PhD Assessment Justine Rochas PhD subject Programming Model and Middleware Support for Distributed and Concurrent Application.

Similar presentations


Presentation on theme: "Active Objects & Co. First Year PhD Assessment Justine Rochas PhD subject Programming Model and Middleware Support for Distributed and Concurrent Application."— Presentation transcript:

1 Active Objects & Co. First Year PhD Assessment Justine Rochas PhD subject Programming Model and Middleware Support for Distributed and Concurrent Application Advisor Ludovic Henrio Team Scale (I3S-INRIA) 1 / 34

2 AGENDA  PART I – A Step into MultiActive Objects  PART II – What do others do ? The ABS case  PART III – Towards fault tolerance of Active Objects PAST PRESENT FUTURE 2 / 34

3 Active Object a Active Objects [1] Request queue Execution thread Request bar() a.bar()  Asynchronous method calls / requests with futures  No concurrency between requests 3 / 34

4 Active Object Creation in ProActive T a = newActive(T.class, params…, node2) // a: local reference to the proxy of ra T a = newActive(T.class, params…, node2) // a: local reference to the proxy of ra node1node2 active object o object a (proxy to ra ) active object ra local reference remote reference object active object on node1, active object a does: 4 / 34

5 Method calls in ProActive P param1, param2 = … ; T a = newActive(T.class, params…, node2) V res = a.bar(param1, param2); // Same syntax as a local call res.foobar(); // Wait-by-necessity if res is not resolved P param1, param2 = … ; T a = newActive(T.class, params…, node2) V res = a.bar(param1, param2); // Same syntax as a local call res.foobar(); // Wait-by-necessity if res is not resolved node1node2 a param2 param1 copy of param2 copy of param1 res ra on node1, active object a does: bar o 5 / 34

6 PART I A Step into MultiActive Objects Priorities and threading mechanisms for MultiActive Objects 6 / 34

7 MultiActive Objects [2] – Principle Multiactive Object o Thread pool  Execute multiple requests at the same time locally  In a controlled way 7 / 34

8 M.A.O. – Language & Scheduling Multiactive }) class O Value lookup(Key k) { … void log(String m) { … } } 8 / 34

9 M.A.O. – Extended features Receive requests Apply Compatibilities  Filter Apply Priorities  Reorder Execute requests Apply Threading policies  Filter again Busy threads! 9 / 34

10 Priority Specification Mechanism ({ = {" G1 = {" G2 = {" G5 "," G4 = {" G3 = {" G2 "}) ({ = {" G1 = {" G2 = {" G5 "," G4 = {" G3 = {" G2 "}) }) G2 G3 G4G5 Declarative Scheduling for Active Objects, L. Henrio, J. Rochas, 29th Symposium on Applied Computing (SAC 2014) incoming request R2 R4 R3 R1 High priority Low priority dependency 10 / 34

12 Thread Management Mechanisms routing ", minThreads=2, maxThreads=5) max Thread pool min Threads never used by other groups Threads never used by the routing group routing 12 / 34

13 PART II What do others do? The ABS case A Translator to Distribute ABS Programs using ProActive 13 / 34

14 Motivation ProActive – Multiactive Objects ABS – Abstract Behavioral Spec. Language Deployment of distributed applications ✔ Modeling of distributed applications ✔ OBJECTIVE Provide distributed deployment to ABS using ProActive 14 / 34

15 Background – ABS [3]  Characteristics of ABS  COGs (set of objects)  Cooperative scheduling  Java translator  No support for distribution yet COG obj call() View of an ABS program with 6 objects and 2 COGs await fut?; obj 15 / 34

16 Active Object Models  Active objects only  Creol [4]  A lot of threads  Active & passive objects  ASP/ProActive  Complex semantic but scales Object Group Model  JCoBox [5], ABS  A lot of global references to manage if not in shared-memory All objects are accessible One thread for many objects Uniform Model Non Uniform Model Example of ABS program Server server = new cog Server(); ID serverId = server!getId(); // serverId is a direct reference // to an object in another COG Server server = new cog Server(); ID serverId = server!getId(); // serverId is a direct reference // to an object in another COG 16 / 34

17 Toward translation of ABS in ProActive  Select active objects  COG = ProActive active object  Entry point to the local memory space  Hierarchical indexing of objects ① COG registry (RMI) Global index via the network Object 2 …… Objectcog1cog2…… Object IDID1ID2…… Object refo1o2…… ② Object registry (in a COG) Local index via shared memory 17 / 34

18 Translation of a new cog statement Server server = new Server() (1) COG cog = newActive(COG.class, {}, node2) (2) cog.registerObject(server) (3) Server server = new Server() (1) COG cog = newActive(COG.class, {}, node2) (2) cog.registerObject(server) (3) node1 node2 main cog server remote server cog Server server = new cog Server() ABS code: Translated during compilation into: (1) (2) (3) cog (proxy) 18 / 34

19 Explicit vs Transparent ABS  Explicit asynchronous calls  Explicit futures ProActive  Transparent asynchonous calls  Transparent first class futures object.method() // synchronous object!method() // asynchronous object.method() // synchronous object!method() // asynchronous Fut future = object!method(); T t = future.get; // blocks Fut future = object!method(); T t = future.get; // blocks object.method() // synchronous or asynchronous T future = object.method(); 19 / 34

20 node1 node2 Translation of an async. method call server.getCog().execute("start", {}, server.getID()) main cog server remote server cog server!start() ABS code: Translated during compilation into: cog (proxy) COG Object ID Object ref Objects registry execute = 1-retrieve object with id 2-run by reflection getCog start execute 20 / 34

21 node1node2 Async. Method Call with Parameters server.getCog().execute("start", {param1, param2}, server1.getID()) main cog server remote server server!start(param1, param2) ABS code: Translated during compilation into: cog (proxy) param1 param2 copy of param1 copy of param2 main cog proxies start execute getCog cog 21 / 34

22 Threading Models in Active Objects  ProActive Single-threaded Cooperative Multi-threaded  MultiActive Objects (extended ProActive) Fut resFut = object!method(); await resFut?; Fut resFut = object!method(); await resFut?; Let another request execute if resFut is not resolved Local Concurrency  Creol  JCoBox  ABS 22 / 34

23 Translation of an selfCompatible=true) hardLimit=false) public class COG public ABSType execute(…) selfCompatible=true) hardLimit=false) public class COG public ABSType execute(…) { } } PAFuture.getFutureValue(readyFut) ABS code: Translated during compilation into: (1) (2) Blocks! Fut readyFut = server!start() await readyFut? Fut readyFut = server!start() await readyFut? (1) (2) 23 / 34 current thread other thread (1) (2) # of active threads = 0

24 Translation of a get statement this.getCOG().switchHardLimit(true); Boolean ready = PAFuture.getFutureValue(readyFut); this.getCOG().switchHardLimit(false); this.getCOG().switchHardLimit(true); Boolean ready = PAFuture.getFutureValue(readyFut); this.getCOG().switchHardLimit(false); Fut readyFut = server!run() Bool ready = readyFut.get Fut readyFut = server!run() Bool ready = readyFut.get ABS code: Translated during compilation into: (1) (2) Limit = 1 thread in total Limit = 1 active thread Blocks all executions! 24 / 34

25 Direct Modifications for Distribution  Serialization  Most classes implements now " Serializable "  Some fields in COG have been made " transient "  Deployment  Node specification added in the ABS language Server server = new cog "slaves" Server(); XML files required to configure the application deployment 25 / 34

26 Conclusion – A Fully Working Tool  Translation of await on conditions  Customized group with thread limits  Automated compilation & deployment of ABS programs  Using ant tasks & python scripts  Tested on a cluster of 25 machines on the Grid5000 platform await a == True && b == selfCompatible=true, minThreads=50, maxThreads=50) 26 / 34

27 PART III Towards Fault Tolerance of AO A Checkpointing Protocol for MultiActive Objects 27 / 34

28 Motivation  Goal  Fault tolerance for Multiactive Objects  Adapted checkpointing protocol  Challenge  Difficult in mono-threaded active objects  Even more in multiactive objects!  Understanding of the threading model 28 / 34

29 Example in Mono-threaded Mode I 3 Q2 3 J 32 K R1 Q1 Serv(Q1)Serv(Q2) 29 / 34

30 Example Correct Solution I 3 Q2 3 J 3 K R1 BIS Q1 Serv(Q1) Serv(Q2) 30 / 34

31 Multi-threaded Mode – Problem checkpoint here? or here? 31 / 34

32 Guidelines  Use possibilities of Multiactive Objects  Priorities  checkpointing requests  Thread limits  flush on going executions MultiActive Object aObject a.checkpoint() switchHardLimit(true) decreaseThreadPoolSize() 32 / 34

33 Conclusion Step#1 Learn about our active objects Step#2 Experiment with other kind of active objects Step#3 Build new protocols around active objects COMPLETE ON GOING IN MIND 33 / 34

34 [1] Active object: an object behavioral pattern for concurrent programming, R.G. Lavender and D. C. Schmidt [2] Multi-threaded Active Objects Ludovic Henrio, Fabrice Huet, Zsolt István – Coordination Models and Languages 2013 [3] ABS: A Core Language for Abstract Behavioral Specification Einar Broch Johnsen, Reiner Hähnle, Jan Schäfer, Rudolf Schlatte, Martin Steffen – FMCO 2012 [4] Creol: A type-safe object-oriented model for distributed concurrent systems Einar Broch Johnsen, Olaf Owe, Ingrid Chieh Yu – FMCO 2006 [5] JCoBox: Generalizing Active Objects to Concurrent Components Jan Schäfer, Arnd Poetzsch-Heffter – ECOOP 2010 Publications 34 / 34 References An Optimal Broadcast Algorithm for Content Addressable Networks Ludovic Henrio, Fabice Huet, Justine Rochas – OPODIS 2013 Declarative Scheduling for Active Objects Ludovic Henrio, Justine Rochas – SAC 2014

35 Advanced Slides Implementation details 35

36 await statement on selfCompatible=true, minThreads=50, maxThreads=50) threadPoolSize=51) public class COG public ABSType execute(…) { public ABSType awaitCondition(String conditionName, UUID targetObject selfCompatible=true, minThreads=50, maxThreads=50) threadPoolSize=51) public class COG public ABSType execute(…) { public ABSType awaitCondition(String conditionName, UUID targetObject …){ } // Invoke conditionName method that actively waits for the condition // This method is generated when compiling 36


Download ppt "Active Objects & Co. First Year PhD Assessment Justine Rochas PhD subject Programming Model and Middleware Support for Distributed and Concurrent Application."

Similar presentations


Ads by Google