|
Re: [ATL] Problems with EMF-Specific VM and Regular VM [message #503412 is a reply to message #503385] |
Sun, 13 December 2009 13:14 |
Jean-Pierre Bourey Messages: 2 Registered: December 2009 Location: Ecole Centrale de Lille |
Junior Member |
|
|
Hi everybody,
I looked at the "opened bugs" page and I found an entry on EMFVMs stacksize
limitation ( https://bugs.eclipse.org/bugs/show_bug.cgi?id=245891 ) . In the
comments it is pointed out (if I have well understood) that 'println' (as
opposed to 'debug') can be called safely (from stack point of view).
Nevertheless I have performed more tests with my simple transformation :
when I put the content all my 'do' sections into comments, my transformation
works very well with both VM in interactive mode by using the configutation
dialog box.
My questions are therefore: why? Does "println" have actually no effect on
the stack size ? How can I keep a trace of applied rules and of some
information about the source/target element manipulated by the rules whitout
overflowing the EMF VM stack? Should I use the Regular VM at development
time (using println of logging) and then use the EMF VM (without println
when I need better performances) ?
but when I use my 'buil.xml' with my transformation without 'do' section,
the error is still the same when I try to use
<property name="atl.launcher" value="Regular VM (with debugger)"/>
When I don't use this property (= I use the EMF-VM) it works
My 2nd question of my previous post remains the same: what is wrong in my
'build.xml' file and/or my transformation or in my way to do when I try to
use the Regular VM?
Many thanks in advance for any help.
jean-pierre
<jean-pierre.bourey@ec-lille.fr> a écrit dans le message de
news:hg0hh5$cbk$1@build.eclipse.org...
> Hi everybody
>
> I'm working on transformations of "large" models (i.e more than 100 models
> elements) with Eclipse Modeling Tools package ( Version: 3.5.1, Build id:
> M20090917-0800) including ATL 3.0.1.
>
> I have started by a simple transformation consisting in transforming a 110
> classes UML model into another UML Model (just by copying th class name).
> My ATL code is the following:
>
>
> -------------------------------------------------------
> -- @path UML2=platform:/plugin/org.eclipse.uml2.uml/model/UML.ecore
>
> module Class2ClassSimple;
> create OUT : UML2 from IN : UML2;
>
> rule Model2Model {
> from source : UML2!Model
> to target : UML2!Model (
> name <-source.name,
> packagedElement <-source.packagedElement)
> do {
> --just to display some traces on the console
> let s : String = 'RULE:Model2Model => BEGIN' in s.println();
>
> -- display the current Model name created
> let s : String = ' => target.name=<' in (s + target.name +
> '>').println();
>
> let s : String = 'RULE:Model2Model => END' in s.println();
> } -- end of 'do' section
> }-- end of rule 'Model2Model'
>
> rule Class2Class {
> from source : UML2!Class to target : UML2!Class (
> name <-source.name)
> do {
> --just to display some traces on the console
> let s : String = 'RULE:Class2Class => BEGIN' in s.println();
>
> -- display the current class name created
> let s : String = ' => target.name=<' in (s + target.name +
> '>').println();
>
> let s : String = 'RULE:Class2Class => END' in s.println();
> } -- end of 'do' section
> }
> -------------------------------------------------------
>
>
> I have perfomed some tests and I have encountered 2 problems :
> 1) when I try to launch this transformation by the menu "Run
> configurations" using on the "Advanced tab" the "EMF Specific VM" with a
> small model it works. But with more than 100 classes (98 to be exact) I
> get the following error :
>
> -------------------------------------------------------
> org.eclipse.m2m.atl.engine.emfvm.VMException: 100
> at __exec__(Class2ClassSimple.atl)
> local variables: self=thisModule,
> e=org.eclipse.m2m.atl.engine.emfvm.lib.TransientLink@1fbf7cd
> at main(Class2ClassSimple.atl)
> local variables: self=thisModule
> Java Stack:
> org.eclipse.m2m.atl.engine.emfvm.VMException: 100
> at
> org.eclipse.m2m.atl.engine.emfvm.ASMOperation.exec(ASMOperat ion.java:615)
> at
> org.eclipse.m2m.atl.engine.emfvm.ASMOperation.exec(ASMOperat ion.java:387)
> at org.eclipse.m2m.atl.engine.emfvm.ASM.run(ASM.java:197)....
> -------------------------------------------------------
>
> It seems that the size of EMF VM is limited to 100, that means only 100
> target element can be created. Is true (in that case, how to do to avoid
> this limit) or a misunderstanding of myself
>
> But when I run it with the "Regular VM with debugger" it works.
>
> Due to my weak knowlegde about EMF and how ATL really works inside, all
> explanations, documentation or links will be appreciated to light my way
>
> 2) The second problem deals with ATL ANT tasks. I have written the
> following build.xml :
>
> -------------------------------------------------------
> <project name="Class2ClassSimpleWithMoreThan100Classes" default="transfo"
> basedir=".">
>
> <property name="inputModel" value="My110Classes"/>
> <target name="loadMetaModels">
> <atl.loadModel modelHandler="UML2" name="UML2MM" metamodel="MOF"
> nsURI="http://www.eclipse.org/uml2/3.0.0/UML"/>
> </target>
>
> <target name="transfo"
> depends="loadMetaModels">
> <atl.loadModel name="sourceModel" metamodel="UML2MM"
> path="InputModels/${inputModel}.uml"/> <atl.launch
> path="Transformations/Class2ClassSimple.asm">
> <inModel name="IN" model="sourceModel"/>
> <inModel name="UML2" model="UML2MM"/>
> <outModel name="OUT" model="targetUmlModel" metamodel="UML2MM"
> modelHandler="UML2" path="OutputModels/${inputModel}_WithANT.uml"/>
> </atl.launch>
>
> <atl.saveModel model="targetUmlModel"
> path="OutputModels/${inputModel}_WithANT.uml"/> </target>
> </project>
> -------------------------------------------------------
>
> When I run this file, I get the following error after the transformation
> of the 98th class :
> -------------------------------------------------------
> BUILD FAILED
> C:\__EC-Lille\workspaceEclipse351ATL301\Class2ClassWithProfi le\build.xml:22:
> 100
>
> -------------------------------------------------------
>
> I guess that this error is related to the EMF specific VM which is use by
> default.(same problem as mentionned in my first problem
>
> but when I add the following property at the beginning of the build.xml :
>
> <property name="atl.launcher" value="Regular VM (with debugger)"/>
>
> I get the following messages on the console:
>
> -------------------------------------------------------
> Buildfile:
> C:\__EC-Lille\workspaceEclipse351ATL301\Class2ClassWithProfi le\build.xml
>
> loadMetaModels:
> [atl.loadModel] Loading model UML2MM from
> http://www.eclipse.org/uml2/3.0.0/UML
>
> transfo:
> [atl.loadModel] Loading model sourceModel from
> file:/C:\__EC-Lille\workspaceEclipse351ATL301\Class2ClassWit hProfile\InputModels\My110Classes.uml
> [atl.launch] Launching transformation
> C:\__EC-Lille\workspaceEclipse351ATL301\Class2ClassWithProfi le\Transformations\Class2ClassSimple.asm
> using Regular VM (with debugger)
>
> BUILD FAILED
> C:\__EC-Lille\workspaceEclipse351ATL301\Class2ClassWithProfi le\build.xml:23:
> null
>
> Total time: 209 milliseconds
> -------------------------------------------------------
>
>
> Therefore my question is: which step(s) did I miss or what is wrong in
> what I have written ?
>
> Many thanks in advance for any help and/or explanations
> best regards
> jean-pierre
>
|
|
|
Re: [ATL] Problems with EMF-Specific VM and Regular VM [message #503966 is a reply to message #503412] |
Wed, 16 December 2009 11:04 |
Alfons Laarman Messages: 35 Registered: July 2009 |
Member |
|
|
Hi Jean-Pierre,
Some ideas below.
On 12/13/09 6:54 PM, in article hg39p6$2m7$1@build.eclipse.org, "Jean-Pierre
Bourey" <jean-pierre.bourey@ec-lille.fr> wrote:
> Hi everybody,
>
> I looked at the "opened bugs" page and I found an entry on EMFVMs stacksize
> limitation ( https://bugs.eclipse.org/bugs/show_bug.cgi?id=245891 ) . In the
> comments it is pointed out (if I have well understood) that 'println' (as
> opposed to 'debug') can be called safely (from stack point of view).
> Nevertheless I have performed more tests with my simple transformation :
> when I put the content all my 'do' sections into comments, my transformation
> works very well with both VM in interactive mode by using the configutation
> dialog box.
This is related to your next question.
> My questions are therefore: why? Does "println" have actually no effect on
> the stack size ? How can I keep a trace of applied rules and of some
> information about the source/target element manipulated by the rules whitout
> overflowing the EMF VM stack?
Println uses and is an expression. After an expression exactly one value is
on the stack, so the interpreter can keep track of this and pop it off if
not needed. The operations in the do block are an entirely different thing,
they may or may not leave a value on the stack (remember you can use
expressions as operations, in this case a value is left on the stack while a
for loop doesnt leave a value). The interpreter cannot thus not know what
unused values are on the stack and can only pop complete stack frames.
If you keep this in mind, you might be able to reduce your stacksize a bit.
If not I advise you to enlarge the maximum stack value in the EMFVM code and
export a new plugin. This worked pretty well for me, no resource problems or
anything.
> Should I use the Regular VM at development
> time (using println of logging) and then use the EMF VM (without println
> when I need better performances) ?
I would advice against that, since there still exist differences between the
two. Switching between them cost me allot of pain some time ago.
> but when I use my 'buil.xml' with my transformation without 'do' section,
> the error is still the same when I try to use
> <property name="atl.launcher" value="Regular VM (with debugger)"/>
> When I don't use this property (= I use the EMF-VM) it works
>
> My 2nd question of my previous post remains the same: what is wrong in my
> 'build.xml' file and/or my transformation or in my way to do when I try to
> use the Regular VM?
Can't help you there.
> Many thanks in advance for any help.
> jean-pierre
Good luck.
Regards,
Alfons
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04707 seconds