Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clarify management of gemoc-gen folder #195

Open
dvojtise opened this issue Jul 1, 2021 · 6 comments
Open

clarify management of gemoc-gen folder #195

dvojtise opened this issue Jul 1, 2021 · 6 comments

Comments

@dvojtise
Copy link
Contributor

dvojtise commented Jul 1, 2021

currently when running multiple simulations, the engine creates one folder per execution in the gemoc-gen folder.

most of the time this only contains a copy of the executed model without any additional interesting data. In the past these folders were used to also store some trace model

we should either:

  • avoid its creation when not required
  • or automatically clean it (especially when these folders don't contain any valuable data)
  • or make sure to always overite the same folder (with the question of the possible simultaneous run of the same model with possibly different arguments ?)

Note: the exact behaviour may be different between engines which may create additional files there

@ebousse
Copy link
Contributor

ebousse commented Jul 2, 2021

I would be in favour to only create this folder when some addon is recording data, eg. recording a trace.

@dvojtise
Copy link
Contributor Author

dvojtise commented Jul 2, 2021

I think we also have the generation of intermediate files in the case of the concurrent engine (mse model ?)
we should distinguish the recording (ie. something like a backup) from the generation of execution support files. (and make sure that 2 simultaneous executions can work ?)

@Faezeh-Kh
Copy link
Contributor

Hi, I also wanted to report an issue with this gemoc-gen folder.
Considering a model as an xtext resource that after its execution, it is just copied in the gemoc-gen folder.
In this case, the original model and the executed one in the gemoc-gen folder are the same resources.
Therefore, for each object of the model, we get an error saying that the same object is defined twice (or more when executing the model several times).
For instance, I am using minijava DSL from here which is a subset of java as an interpreted DSL.
In the attached screenshot, you can see a sample minijava model and the errors after model execution.
I suppose we need to be able to disable gemoc-gen creation when it is not required.

image

@dvojtise
Copy link
Contributor Author

dvojtise commented Dec 3, 2021

@Faezeh-Kh
Being the same resource is actually normal since the copy is intended to be used by the trace file
Ie. the trace model is supposed to get its references to the copy of the model and not in the original one that can be modified later. (cf. #206)

However, you're right:

  1. there should not be any copy if no trace model is saved
  2. copying an xtext can generate issue since xtext often uses a project scope (leading to duplicate/conflicting objects).
  3. The copy is probably incomplete in many situations, since it copies only the main resource and not its possible cross references. (multiple xtext file, but also probably in the case of model split into several "xmi" files)

For these second and third points, we may consider the following fixes:

  • systematically save the model as xmi instead of xtext,
  • and make sure to gather all resources (resolveAll of the resourceSet) that are in the current project into a single xmi file (maybe not optimal if some behavior relies on the resource containment information but should be ok in most cases 🤔 )

@Faezeh-Kh
Copy link
Contributor

Hi,
In our last discussion, you mentioned one of the use cases of copied models under gemoc-gen is to be used by the trace file. However, as I am checking the latest version, it seems the trace model refers to the original model not its copy.
image

@dvojtise
Copy link
Contributor Author

You're right, we probably need to fix this too, otherwise this model copy is pointless
The running model is using its own copy in memory, so for me, the only purpose of such a model on disk is to be a reproducible base for the trace model ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants