Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

OMPython ModelicaSystem Recompilation

OMPython ModelicaSystem Recompilation

Hello,

I am using OMPython to compile and simulation a model:

Code:


from OMPython import ModelicaSystem

fileName = "../../package.mo"
modelPath = "myModel"

mod = ModelicaSystem(fileName,modelPath, ["Modelica"])

My intention is to make some data analysis based on Monte-Carlo studies with scripted parameter variations within the model.

Now, each time I execute the script it annoyingly needs ~70s of compile time and a bunch of .c/.h/.o/... files are generated.

Is it possible to avoid recompilation of the same models over and over again? A compiler option/flag maybe?

Re: OMPython ModelicaSystem Recompilation

Anyone?

Re: OMPython ModelicaSystem Recompilation

Can you just do all the analysis after the call to ModelicaSystem? That way it will only be compiled once.
I will open a ticket for OMPython to have a flag for ModelicaSystem to just build if needed.

Re: OMPython ModelicaSystem Recompilation

Thank you for your answer.

Yes, this is exactly what I am doing now. I compile the model, run the simulation and use the stored .mat file for analysis. It is just annoying to wait for the model to recompile after simple parameter changes. Especially since OMEdit apparently can do that without recompiling...

Any update on the issue would be appreciated.

There are 0 guests and 0 other users also viewing this topic
You are here: