1 / 17

Automatic Distribution of Sequential Code Using JavaSymphony Middleware

Automatic Distribution of Sequential Code Using JavaSymphony Middleware. Saeed Parsa, Vahid Khalilpoor Faculty of Computer Engineering Iran University of Science and Technology. Aim :. To develop an environment for automatic translation of sequential into distributed code. Motivation:.

joesanders
Télécharger la présentation

Automatic Distribution of Sequential Code Using JavaSymphony Middleware

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Automatic Distribution of Sequential Code Using JavaSymphony Middleware Saeed Parsa, Vahid Khalilpoor Faculty of Computer Engineering Iran University of Science and Technology

  2. Aim: To develop an environment for automatic translation of sequential into distributed code Motivation: • To replace supercomputers with network of PC’s. • Today PCs have commoditized power and stability to such an extent as to make them, collectively, suitable alternatives to supercomputers. • To remove the burden of learning middleware details and • writing distributed code. Automatic Distribution of Sequential Code Using JavaSymphony Middleware

  3. Class Dependency Graph (C.D.G) Weighted C.D.G Partitioned C.D.G. Java Source code 7 6 2 3 3 9 Call graph Extraction Distribution Gains Clustering Engine Component Generator Modify Source Distributed Code Data Dependency Analysis Main Steps: Automatic Distribution of Sequential Code Using JavaSymphony Middleware

  4. aCode Abstraction Language Cluster C1 Class GraphTool Type Graph Type GraphMaker MethodDeclar GraphTool Private EndMethod GraphTool MethodDeclar main Public Par: String args CreateObject String CreateObject String public class GraphTool { static private Graph graph; static private GraphMaker gk; GraphTool() {} public static void main(String args[]) throws Exception { String filename = new String(); String out = new String(); Automatic Distribution of Sequential Code Using JavaSymphony Middleware

  5. S A B Call Graph Construction • Difficulty: to find the target method of a call statement. • Static calls and constructor calls are easy. They always have a well-defined target method. • Virtual calls are much harder: if ( x > y) s= new A(); else s = new B(); s.m(); • To resolve polymorphic calls : • CHA : All possible types target(s.m)={A,B,S} • RTA : Rapid-types(o) = Hierarchy-types(o) ∩ Instantiated-types(P) target(s.m)={A,B} or target(s.m) = {A,B,S} provided that there is an Instance of s somewhere in the program • In our approach Called FRTA (Flow sensitive RTA) FRTA : target(s.m) = {A,B} Automatic Distribution of Sequential Code Using JavaSymphony Middleware

  6. CHA verses FRTA Automatic Distribution of Sequential Code Using JavaSymphony Middleware

  7. Class B Class A -------- -------- i=a.m() ---------- ---------- --------- Use(i) --------- m(){ ---------- ---------- ---------- return i; } Classَ A SpeedUp A..B Tc Class B Td SpeedUp A..E Class C SpeedUp B..E TS SpeedUp D..E Tc Class E SpeedUp D..E Class D PartitioningCriteria: TC = Communication elapsed time Td = Called method execution time TS = Minimum time required to reach the first use of the call results. Tserial = TS + Td Tasync = Max (2*TC +Td, Ts) Automatic Distribution of Sequential Code Using JavaSymphony Middleware

  8. Cluster C1 Cluster C1 Cluster C2 Cluster C2 Cluster C3 Cluster C3 Class A{ Void f(){ … b.f1() … use result of b.f1 ... c.f2() … use result of c.f2() Class A{ Void f(){ … b.f1() ... c.f2() … use result of c.f2() Class B{ Void f1(){ . . . } } Class B{ Void f1(){ . . . } } Class C{ Void f2(){ . . . } } Class C{ Void f2(){ . . . } } Optimal and interactive Partitioning: Best Case Worst case Automatic Distribution of Sequential Code Using JavaSymphony Middleware

  9. Cluster j Cluster i Proxy Object manager Proxy Synchronizer Object manager Synchronizer Connector(JSObject) Connector(JSObject) JAVASYMPHONY MiddleWare The Architecture: Automatic Distribution of Sequential Code Using JavaSymphony Middleware

  10. Source Code Transformation: For each remote object, convert the type of the object to a type Called Handle Replace each remote object instantiation, ‘O = new classname’ with Proxy.CreateObject(“className”, ”objectName”, parList) For each cluster A, create a class called Proxy_A Foreach inter-cluster invocation o.m(prarlist) between clusters A and B do • Suppose ‘o’ is an instance of a class “className”  Replace the statement o.m(parlist) with Proxy_A.callRemotMethod(o , parlist ) • Insert a Proxy.wait(ClassName,ObjectName, MethodName,varName) • statement into the very first position within the caller, where the values • affected by the call statement are required. Automatic Distribution of Sequential Code Using JavaSymphony Middleware

  11. Class A B b=new B(); b.m(p); Z=p; Class B m(P p ){ … } Example: Cluster 1 Cluster 2 proxy.createRemoteObject("B","b",null); proxy.callRemoteMethod("B","b",“m",new Object[]{p} ,new String[]{“p"}); Proxy2 Proxy1 p=(P)proxy.Wait("B","b",“m“,”p”); ObjectManager Structure Synchronizer Structure Proxy Structure Automatic Distribution of Sequential Code Using JavaSymphony Middleware

  12. Remote Method Invocation: Public void callRemoteMethod(String ClassName, String objectName, StringmethodName,String returnName,Object[] params,String []signature){ Jsobject remoteObject; ResultHandle result; remoteObject=objectManager.getObjectHandeler(String ClassName, String objectName);result=remoteObject.ainvoke(methodName,params);synchronizer.addMethodCall(esult,objectname,methodName,returnName,params, ignature);} Automatic Distribution of Sequential Code Using JavaSymphony Middleware

  13. :NameServer Remote Object Creation: public void createRemoteObject(String className,String objectName,Object[] params) { int componentIndex=NameServer.getRemoteClassLocation(className); if(componentIndex>0) { JSObject obj = new JSObject(className,params,v1.getVA(componentIndex); RemoteObjectTable. addRemoteObjectInfo(obj,className,objectName); } } Automatic Distribution of Sequential Code Using JavaSymphony Middleware

  14. Synchronization : public Object Wait(String ClassName, String ObjectName, String MethodName, String []signature,String par) {resultHandle resHandle= synchronizer.getResultHanlde(ClassName, ObjectName,MethodName,signature); return(resHandle.getResult()); } Automatic Distribution of Sequential Code Using JavaSymphony Middleware

  15. A Case Study: TSP In order to evaluate and demonstrate the application ths java code for the traveling salesman problem was automatically converted into a corresponding distributed code and executed over a network of 3 personalcomputers. Execution Time Graph No. • Distributed Serial Edges Nodes • 0:7:357 0:0:573 40 20 • 0:7:810 0:1:383 81 40 • 0:8:163 0:3:246 122 60 • 0:11:109 0:11:214 163 80 • 0:14:741 0:19:773 204 100 • 0:30:722 0:43:517 245 120 • 1:0:871 0:25:362 286 140 • 1:45:227 2:25:721 327 160 • 2:48:280 3:54:871 368 180 • 4:21:412 6:0:143 409 200 • 7:20:343 9:36:655 450 220 • 12:54:142 16:37:653 491 240 Automatic Distribution of Sequential Code Using JavaSymphony Middleware

  16. Conclusions: • In certain situations computational intensive applications can be executed over a network of low price PC’s instead of supercomputers • In order to easily translate a sequential JAVA source code into a corresponding distributed code, a set of three components described in this presentation, can be used. • In Order to automatically distribute program code, class dependency graph can be used as a basis for distribution instead of object dependency graph • The amount of speed up achieved by replacing an ordinary method call with a non-blocking remote call can be used as a basis for suitable partitioning of the program code. • The performance of the final distributed code can be estimated before the distribution of code, thereby it Is possible to decide whether the code is distributable. Automatic Distribution of Sequential Code Using JavaSymphony Middleware

  17. Thank you very much For your attention Automatic Distribution of Sequential Code Using JavaSymphony Middleware

More Related