Presentation is loading. Please wait.

Presentation is loading. Please wait.

LinTraP: Primitive Operators for the Execution of Model Transformations with LinTra Loli Burgueño 1, Eugene Syriani 2, Manuel Wimmer 3, Jeff Gray 2 and.

Similar presentations


Presentation on theme: "LinTraP: Primitive Operators for the Execution of Model Transformations with LinTra Loli Burgueño 1, Eugene Syriani 2, Manuel Wimmer 3, Jeff Gray 2 and."— Presentation transcript:

1 LinTraP: Primitive Operators for the Execution of Model Transformations with LinTra Loli Burgueño 1, Eugene Syriani 2, Manuel Wimmer 3, Jeff Gray 2 and Antonio Vallecillo 1 1 Atenea Research Group, University of Malaga 2 Software Engineering Research Group, University of Alabama 3 Business Informatics Group, Vienna University of Technology

2 Model-Driven Engineering MDE allows dealing with more complex problems using much simpler solutions As MDE is growing in popularity, Models and Model Transformations (MT) are extensively being used BigMDE 2014LinTraP: Primitive Operators for the Execution of MTs with LinTra 2

3 Model-Driven Engineering Hence the problems being addressed using MDE approaches are increasingly complex: From “FamiliesToPersons” to DNA Models From small databases in a PC to Big Data in the Cloud BigMDE 2014LinTraP: Primitive Operators for the Execution of MTs with LinTra 3 Both because of the model size and the transformation logic

4 Model-Driven Engineering The current tools we are using do not even deal with medium-size models that do not fit into the RAM memory of a single machine BigMDE 2014LinTraP: Primitive Operators for the Execution of MTs with LinTra 4 MDE tools and mechanisms are lagging behind Do not scale well Do not support concurrency Do not support distribution Etc. They are not up to the current requirements from real industrial practices

5 Motivation In practice, we need to Storehandle Store and handle models with millions of instances Transform Transform these models in reasonable amount of time IT infrastructure Make better use of our current IT infrastructure Networks of distributed computers Multi-core machines BigMDE 2014LinTraP: Primitive Operators for the Execution of MTs with LinTra 5

6 Outline Introduction Background: LinTra Primitive operators Case study: Activity Diagram to Petri Net Conclusions and Future Work BigMDE 2014LinTraP: Primitive Operators for the Execution of MTs with LinTra 6

7 LinTra LinTra [Burgueno 2013, Burgueno et al. 2013] concurrencydistribution Brings concurrency and distribution into the Model Transformations area storinghandling Addresses the problem of storing and handling large and very large models (memory allocation, execution times) 7 BigMDE 2014LinTraP: Primitive Operators for the Execution of MTs with LinTra Proposal: Make use of Linda, a mature and widely used Coordination language for concurrent and distributed programming It uses the “blackboard” approach, based on “shared” tuple spaces Every tuple space can be distributed over sets of machines, in a user-transparent way

8 Linda Linda: coordination language for parallel processes 8 BigMDE 2014LinTraP: Primitive Operators for the Execution of MTs with LinTra Blackboard (tuple space) Tuple(“Bye”, “World”) read(?, “World”) write(“Bye”, “World”) write(25, “dollars”) Tuple(25, “dollars”)

9 LinTra: Architecture Mature Linda implementations available For different general purpose languages (GPL) GPL are too low level languages to write MTs We will place another language (MTL) on top that compiles to GPLs BigMDE 2014LinTraP: Primitive Operators for the Execution of MTs with LinTra 9 HMTL (high-level MTL) LMTL (low-level MTL: Java) Linda Blackboard Architecture (coarse-grained)

10 LinTra: Architecture BigMDE 2014LinTraP: Primitive Operators for the Execution of MTs with LinTra 10 HMTL (high-level MT) LMTL (low-level MT: Java) Linda Blackboard … Linda Blackboard Interface Adapter implements GigaSpacesCoherenceHazelCast Adapter No common interface shared by all Linda implementations but we want the technology to be independent of our language we build an interface to abstract the blackboard access it deals with the synchronization mechanisms

11 LinTra: Architecture LMTL: jLinTra Out-place MTs LMTL for MT execution/engine MTs written in Java Representation of metamodels and models in Java Traceability Master-Slave Master BigMDE 2014LinTraP: Primitive Operators for the Execution of MTs with LinTra 11 HMTL (high-level MT) LMTL (low-level MT: Java) Linda Blackboard partitions the input model organizes the tasks to be executed by the slaves Slaves read (a subset of) the input model from the Blackboard transform the submodel assigned write the output model

12 LinTra: Performance Ubuntu bits 11.7 Gb of RAM 16 cores of 2.67GHz BigMDE 2014LinTraP: Primitive Operators for the Execution of MTs with LinTra 12

13 LinTra: Architecture HMTL Existing MTL compile to LinTraP Existing MTs or MTs written in existing languages can be executed with LinTra BigMDE 2014LinTraP: Primitive Operators for the Execution of MTs with LinTra 13 HMTL (high-level MT) LMTL (low-level MT: Java) Linda Blackboard HMTL … LinTraP compiles to ATLQVT-OETL ATL-2-LinTraPQVTO-2-LinTraPETL-2-LinTraP LinTraP

14 LinTraP: collection of minimal, yet sufficient, primitive operators that can be composed to (re-)construct any out- place and unidirectional MTL BigMDE 2014LinTraP: Primitive Operators for the Execution of MTs with LinTra 14 These primitive operators encapsulate the LinTra implementation code that makes the parallel and distributed execution possible Refactor the code to make it reusable for the compilations from HMTL to LMTL An abstraction of the implementation details of the general-purpose language in which LinTra is implemented

15 LinTraP Primitives (continuation of [Syriani et al. 2013]) For MT setup PartitionCreator For MT execution Composer Creator Finder Tracer CondChecker Declarer Assigner BigMDE 2014LinTraP: Primitive Operators for the Execution of MTs with LinTra 15

16 LinTraP Primitives for the Concurrent Platform PartitionCreator Model entities are independent from each other Size of every partition is required Possibility of specifying which elements belong to each partition BigMDE 2014LinTraP: Primitive Operators for the Execution of MTs with LinTra 16 myModel e.g.: PartitionCreator(myModel, ‘’, 3) p1 p2 p3 p4 Syntax: PartitionCreator(input : Model, OE : OclExpression, maxSize : Integer)

17 LinTraP Primitives for the Concurrent Platform PartitionCreator Model entities are independent from each other Size of every partition is required Possibility of specifying which elements belong to each partition Syntax: PartitionCreator(input : Model, OE : OclExpression, maxSize : Integer) e.g.: PartitionCreator(myModel, ‘Figure.allInstances->select(f | f.isSquare )’, 2) BigMDE 2014LinTraP: Primitive Operators for the Execution of MTs with LinTra 17 myModel The purpose of OE is to give the user the possibility to optimize the MT execution. p3 p1 p2

18 LinTraP Primitives for the MTL Tracer The Tracer provides access to the trace model needed by out-place MT engines for linking the entities in the output model Given an input entity or set of entities that match the pre- condition of a rule, the traces give access to the entities that were created in the post-condition, and vice versa. BigMDE 2014LinTraP: Primitive Operators for the Execution of MTs with LinTra 18 1 tr = circ=8 20 Tracer(Triangle2Circle, 2, circleCreator) Syntax: Tracer (composer : Composer, e : [ Entity | Collection(Entity)], creatorName : String ) : Collection(Entity)

19 LinTraP Primitives for the MTL CondChecker allows the querying of the input model in the Blackboard with an OCL expression that evaluates to a boolean value Syntax: CondChecker(expr : OclExpression) : Boolean BigMDE 2014LinTraP: Primitive Operators for the Execution of MTs with LinTra 19 Finder allows the retrieval of elements from the Blackboard that satisfy a constraint Syntax: Finder(expr : OclExpression) : Collection(Entity)

20 LinTra Transformation Process BigMDE 2014LinTraP: Primitive Operators for the Execution of MTs with LinTra 20

21 Case Study: Activity Diagrams to Petri Nets [Syriani & Ergin 2012] BigMDE 2014LinTraP: Primitive Operators for the Execution of MTs with LinTra 21

22 BigMDE 2014LinTraP: Primitive Operators for the Execution of MTs with LinTra 22 Case Study: Activity Diagrams to Petri Nets [Syriani & Ergin 2012]

23 Composer ActNode { if (CondChecker(e.oclIsTypeOf(ActivityNode))) { Creator(Transition, {[name, e.name], [net, pNet]}, 't1') Creator(Arc, {[transition, Tracer(ActNode, e, 't1')], [place, Tracer(ActNode, e, 'p')], [toPlace, true], [net, pNet]}) Creator(Place, {[name, e.name], [net, pNet], [token, 0]}, 'p') Creator(Arc, {[transition, Tracer(ActNode, e, 't2')], [place,Tracer (ActNode, e, 'p')], [toPlace, false], [net, pNet]}) Creator(Transition, {[name, e.name], [net, pNet]}, 't2') } BigMDE 2014LinTraP: Primitive Operators for the Execution of MTs with LinTra 23 Case Study: Activity Diagrams to Petri Nets [Syriani & Ergin 2012]

24 Conclusions and Future Work Next steps BigMDE 2014LinTraP: Primitive Operators for the Execution of MTs with LinTra 24 HMTL (high-level MT) LMTL (low-level MT: Java) Linda Blackboard LinTraP Complete implementation of the primitives Create compilers Annotations New MTL Further benchmarking

25 References [Burgueno 2013] L. Burgueño. Concurrent Model Transformations based on Linda. Doctoral MODELS, pages 9-16, [Burgueno et al. 2013] L. Burgueño, J. Troya, M. Wimmer, and A. Vallecillo. On the Concurrent Execution of Model Transformations with Linda. In BigMDE [Syriani & Ergin 2012] E. Syriani and H. Ergin. Operational semantics of UML activity diagram: An application in project management. In Proceedings of MoDRE RE, pages 1-8, [Syriani et al. 2013] E. Syriani, H. Vangheluwe, and B. LaShomb. T-core: a framework for custom-built model transformation engines. Software & Systems Modeling, pages 1-29, BigMDE 2014LinTraP: Primitive Operators for the Execution of MTs with LinTra 25

26 LinTraP: Primitive Operators for the Execution of Model Transformations with LinTra Loli Burgueño 1, Eugene Syriani 2, Manuel Wimmer 3, Jeff Gray 2 and Antonio Vallecillo 1 1 Atenea Research Group, University of Málaga 2 Software Engineering Research Group, University of Alabama 3 Business Informatics Group, Vienna University of Technology Thanks !

27 Metamodels and Models representation MMs are represented by means of Java classes Models are composed of class instances (objects) 27 BigMDE 2014LinTraP: Primitive Operators for the Execution of MTs with LinTra package classMM; public class Attribute extends NamedElt { String id; Boolean multivalued; String typeID; Boolean typeIsComposed = false; String ownerID; Boolean ownerIsComposed = false; public Attribute (String id, String name, Boolean multiValued, String ownerId, String typeId){ super(name); this.id = id; this.multivalued = multiValued; this.ownerID = ownerId; this.typeID = typeId; } public String getId() { return id; } public void setId(String id) { this.id = id; } public Boolean getMultivalued() { return multivalued; } public void setMultivalued(Boolean multivalued) { this.multivalued = multivalued; }

28 Relationships Traces F : String n String n Metamodels and Models representation Why does every model element need an ID? 28 BigMDE 2014LinTraP: Primitive Operators for the Execution of MTs with LinTra DataType id = “1” DataType id = “2” Attribute id = “3” Type id = “1_Dt2T” Type id = “2_Dt2T” Column id = “3_A2C” F F F

29 Metamodels and Models representation Why to use IDs? Efficiency 29 BigMDE 2014LinTraP: Primitive Operators for the Execution of MTs with LinTra Attribute id = “2” Column id = “2_A2C” F Class id =“3” att ={“1”, “2”} Column id = “3_C2C.1” Table id = “3_C2C.2” F F Attribute id = “1” Column id = “1_A2C” F Table id = “3_C2C.2” key= {“3_C2C.1”} col= {“1_A2C”,“2_A2C”} F F F ATL

30 Model Transformation Out-place transformation Blackboard split in different areas One area per each input model One area per each output model One area reserved to internal transformation purposes 30 BigMDE 2014LinTraP: Primitive Operators for the Execution of MTs with LinTra MT Execution config.: Master/Slave+Shared Memory Master organizes the work specifying the model portions to be transform at once by a thread and puts them in one specific zone of the tuple space Every slave access to that specific zone takes one piece of work, and transforms the elements the piece of work specifies Needed synchonization mechanisms: a semaphore

31 Model Transformation Transformation execution: Master/Slave+Shared Memory 31 BigMDE 2014LinTraP: Primitive Operators for the Execution of MTs with LinTra Master ? Notify Slaves Serialization

32 Model transformation 32 BigMDE 2014LinTraP: Primitive Operators for the Execution of MTs with LinTra type.name := datatype.name

33 Model transformation 33 BigMDE 2014LinTraP: Primitive Operators for the Execution of MTs with LinTra WorkExcerpt we = lookForWork(); while (we!=null){ Collection in = retrieveElements(we, srcTS); Collection out = (new Class2Relational()).transforms(in); trgTS.putAll(out); we = lookForWork(); } Collection out = new... for(Object o : in) { if(o instanceof Class){ ruleClass2Table((Class)o, out); } else if (o instanceof DataType){ ruleDataType2Type((DataType)o, out); } else if... } return out; Type t = new Type(f(dt.getId()), dt.getName()); out.add(t); type.name := datatype.name

34 Overview BigMDE 2014LinTraP: Primitive Operators for the Execution of MTs with LinTra 34 Input Models Input Model Output Models XMI, data flow… In a single machine, distributed Output Model Blackboard format In the cloud Transfo ATL, QVT, own language, … Transfo (java) Thread N Thread 1 Thread 2 … XMI, data flow, … In a single machine, distributed Blackboard format In the cloud Input Metamodels Ecore, KM3,... Output Metamodels Ecore, KM3,... conforms to Input Metamodels (Java) Output Metamodels (Java) conforms to Linda Blackboard Implementation HMTL LMTL Linda

35 LinTraP Primitives for the MTL Composer allows the grouping of a combination of primitives Syntax: Composer { } BigMDE 2014LinTraP: Primitive Operators for the Execution of MTs with LinTra 35

36 LinTraP Primitives for the MTL Creator creates an entity given its data type and its features (attributes and bindings) and writes it in the Blackboard Syntax Creator(type : Factory, features : Dictionary) Creator(type : Factory, features : Dictionary, name: String) e.g.: Creator(Family, {[name, ‘Smith’]}, ‘f1’) BigMDE 2014LinTraP: Primitive Operators for the Execution of MTs with LinTra 36

37 LinTraP Primitives for the MTL Declarer allows to create a global variable that can be accessed by its name from any other primitive that is accessed by all the Slaves involved in the transformation process Syntax: Declarer(type : [OclDataType | Entity], name : String) BigMDE 2014LinTraP: Primitive Operators for the Execution of MTs with LinTra 37

38 LinTraP Primitives for the MTL Assigner sets the value of a variable defined by a Declarer Syntax: Assigner(varName : String, value : [OclDataType | Entity | Creator]) if value : Creator the element is stored in the Blackboard the variable points to it every time the variable is updated, the corresponding value in the Blackboard is overwritten if value : [ OclDataType | Entity ] the variable is stored in memory and accessed while the MT is executed it is not a persistent value in the Blackboard BigMDE 2014LinTraP: Primitive Operators for the Execution of MTs with LinTra 38

39 Integration with LinTra LinTra class diagram metamodel BigMDE 2014LinTraP: Primitive Operators for the Execution of MTs with LinTra 39

40 Integration with LinTra MT setup Extract rule scheduling All rules belonging to the same rule layer can be executed in parallel All rules in one layer must have terminated before rules in a subsequent layer can begin Compile MT to LinTraP BigMDE 2014LinTraP: Primitive Operators for the Execution of MTs with LinTra 40

41 Case Study: Activity Diagrams to Petri Nets Composer Signal { if (CondChecker(e.oclIsTypeOf(SignalNode))) Creator(Transition, {[name, e.name], [net, pNet]}, 't') Creator(Arc, {[transition, Tracer(Signal, e, 't')], [place, Tracer(Signal, e, 'p')], [toPlace, true], [net, pNet]}) Creator(Place, {[name, e.name], [net, pNet]}, 'p') } BigMDE 2014LinTraP: Primitive Operators for the Execution of MTs with LinTra 41

42 Case Study: Activity Diagrams to Petri Nets Composer MatchSignals { if (CondChecker(e.oclIsTypeOf(SignalNode))) for(a in Finder(‘AcceptSignalNode.allInstances->select(as| e.activityDiag = as.activityDiag and e.signalId = a.signalId’) Creator (Arc, {[place, Tracer (Signal, e, 'p')], [transition, Tracer (MatchSignals, {e, a}, 't')], [toPlace, false ], [net, pNet]}) Creator (Transition, {[name, e.name+'-'+a.name], [net, pNet]}, 't') Creator (Arc, {[place, Tracer (AcceptSignal, e, 'p')], [transition, Tracer (MatchSignals, {e, a}, 't')], [toPlace, true ], [net, pNet]}) } BigMDE 2014LinTraP: Primitive Operators for the Execution of MTs with LinTra 42


Download ppt "LinTraP: Primitive Operators for the Execution of Model Transformations with LinTra Loli Burgueño 1, Eugene Syriani 2, Manuel Wimmer 3, Jeff Gray 2 and."

Similar presentations


Ads by Google