Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] Problems with EMF-Specific VM and Regular VM
[ATL] Problems with EMF-Specific VM and Regular VM [message #503385] Sat, 12 December 2009 11:47 Go to next message
Jean-Pierre Bourey is currently offline Jean-Pierre BoureyFriend
Messages: 2
Registered: December 2009
Location: Ecole Centrale de Lille
Junior Member
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(ASMOperation.java:615)
	at org.eclipse.m2m.atl.engine.emfvm.ASMOperation.exec(ASMOperation.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\Class2ClassWithProfile\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\Class2ClassWithProfile\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\Class2ClassWithProfile\InputModels\My110Classes.uml
  [atl.launch] Launching transformation C:\__EC-Lille\workspaceEclipse351ATL301\Class2ClassWithProfile\Transformations\Class2ClassSimple.asm using Regular VM (with debugger)

BUILD FAILED
C:\__EC-Lille\workspaceEclipse351ATL301\Class2ClassWithProfile\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 #503412 is a reply to message #503385] Sun, 13 December 2009 13:14 Go to previous messageGo to next message
Jean-Pierre Bourey is currently offline Jean-Pierre BoureyFriend
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 Go to previous messageGo to next message
Alfons Laarman is currently offline Alfons LaarmanFriend
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
Re: [ATL] Problems with EMF-Specific VM and Regular VM [message #545589 is a reply to message #503385] Thu, 08 July 2010 10:43 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 2
Registered: July 2010
Junior Member
I have the same problem. I am working with a transformation that creates more than 100 elements and I have the same error.

Unfortunately, I don't know how to enlarge the maximum stack value. Have you enlarged it?

How have you solved your problem?

Thanks!
Re: [ATL] Problems with EMF-Specific VM and Regular VM [message #545602 is a reply to message #503385] Thu, 08 July 2010 11:48 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARDFriend
Messages: 556
Registered: July 2009
Senior Member
This isn't related to the number of elements created.

The solution is to "consume" the stack by using for example a fake variable :

fake <- let s : String = 'RULE:Model2Model => END' in s.println();

That way the result is deleted from the stack.
Re: [ATL] Problems with EMF-Specific VM and Regular VM [message #757664 is a reply to message #545602] Mon, 21 November 2011 08:25 Go to previous message
Ronan B is currently offline Ronan BFriend
Messages: 273
Registered: July 2009
Senior Member
Hi,
I had assumed this bug had been fixed in the ATL VM. However, it still shows up in ATL version 3.2.1. The work around works just fine but it is quite a difficult bug to diagnose in the first place. Is the fix for this in ATL 3.3? I cannot upgrade just yet due to dependencies.
Regards,
Ronan
Previous Topic:[ATL] Launch UML2OWL on Helios
Next Topic:Incorrect output HOT
Goto Forum:
  


Current Time: Tue Apr 16 18:40:01 GMT 2024

Powered by FUDForum. Page generated in 1.20732 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top