[great-users] Serial vs Parallel execution
Attila Vizhanyo
viza at isis.vanderbilt.edu
Mon Apr 4 17:40:18 CDT 2005
Dear Gurkan,
People often get confused with the packet passing semantics in GReAT.
The rule of thumb is, that all objects that a rule receives via its input ports, must be supplied by one rule.
Say you have rule R1 with input ports I1, I2, and you want R0 to suppy packets of R1. Then R0 must supply both I1 and I2, and there is no way around this.
The constraint is strict because of the problems you have been groping about: e.g. how to match up the objects from two different rules, how to form the packets.
This is not trivial, mainly because the order of packets produced by a rule is not deterministic.
Howevere there is panacea for your problems. There is a new feature in the GReAT language, which we called Global namespace.
You can create a designated UML package model, and create classes in it just like for any ordinary UML class diagram.
The root class of such a package (i.e. the class which is not contained in any other classes) automatically becomes accessible inside any rule of your transformation.
We created this feature for exactly the reason of getting rid of passing excess objects through a set of rules.
This feature is ready, but there has been no public release yet, and we are still adding many new language features to GReAT.
If you're willing to use a possibly less reliable and robust tool, we can provide you with an internal GReAT release which contains this feature.
Let me know, what would you like to do.
Thanks,
Attila
> -----Original Message-----
> From: Gürkan Özhan [mailto:gurkanozhan at gmail.com]
> Sent: Monday, April 04, 2005 16:07
> To: great-users
> Subject: [great-users] Serial vs Parallel execution
>
>
> I have provided a simplified version of my exercise in the
> attachment. The versions of GME and GReAT are the latest
> releases, namely, version 4.11.10 for GME and version 1.3.3
> for GReAT ( and UDM version is 2.21).
>
> I am having difficulting in writing parallel transformation
> definitions. The problem is, I need to start two parallel
> branches, construct them independently in their own branches,
> but then need to use some parts from both branches in a
> further rule. I use a block to function as a synchronizer for
> the parallel branches, so that inputs from both branches are
> available for the rule following the block. Unfortunately I
> could not succeed in achieving this. The scenario only works
> as expected if I carry all the references serially through a
> single branch, hence loosing space efficiency and introducing
> unnecessary and confusing complexity.
>
> I have provided three start rules in the configuration. Of
> these three, only StartSerial block works successfully, while
> StartMoreParallel and StartParallel do not. Details are below:
>
> (This is the point where the Initialize block ends in a debug
> session. I expect the execution of the next rule, but it does
> not execute.)
>
> Start Rule Name: StartMoreParallel
>
> Snapshot of Debug Step 9 (end of block Initialize):
> In Variables
> Tgt_RF
> has no value
> Src_Rf
> has no value
> Out Variables
> S_T1_Part
> NewSrcMain.PartA
> NewSrcMain.PartB
> S_T2_Part
> NewSrcMain.PartC
> NewSrcMain.PartD
> T_DataStore
> TgtMain.TgtDataStore
> TypeSystem
> TgtMain.TgtTypeSystem
>
> At Debug Step 4 (CreateTgtType1Data(dataStore:I, Part:I,
> typeSystem:I, type1:P, type1Ref:P, tgtPart1:P)
> No match and skip :-(
> At Debug Step 3 (CreateTgtType2Data(dataStore:I, Part:I,
> typeSystem:I, type2:P, type2Ref:P, tgtPart2:P)
> No match and skip :-(
>
> Eventhough the input ports are provided with matching data,
> neither CreateTgtType1Data, nor CreateTgtType2Data match and
> execute. I thought that a block stacks all of its packets at
> its output ports until the last packet is produced, and only
> after that,the next rule following the block starts.
>
> Also, isn't there a mechaism to make a port repeat its value
> n times? Let me explain this with the above example: In our
> case S_T1_Part has 2 packets, whereas, T_DataStore and
> TypeSystem have 1 packet. Therefore T_DataStore and
> TypeSystem should repeat their data as many times as
> S_T1_Part's packet count(in this case 2 times)
>
> A similar scenario is with start block StartParallel. Here we
> are stuck after the rule CreateTgtDataStoreAndData. The
> following rules CreateTgtType1Data and CreateTgtType2Data
> just don't execute.
>
> The transformation only succeeds with the start block
> StartSerial. In this scenario we carry all the necessary
> references serially through a single path till the end of
> CreateTgtDataStoreAndData block. However, this sort of
> implementation results in unnecessary carrying of packets
> through previous rules that will be required in some other
> rule that is farther away. This is really a space efficiency
> killer and complicates understanding of the rules in
> scenarios where the target model is huge and has modular
> subparts that can be constructed independently, but pieces of
> those subparts are used as inputs in some rule that is
> further away in the rule execution sequence.
>
> Thanks in advance.
>
> Gürkan Özhan
>
More information about the great-users
mailing list