You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add test job to test the coupling of Base Modelica export and ModellingToolkit.jl #117
@jClugstor has successfully implemented a first version of Base Modelica import into ModellingTookit.jl. This has been tried on a few test cases, but we could actually try it on the entire library testsuite.
@jClugstor, can you please share the Julia code you wrote to run those tests, so we can generalize it and put it into our CI?
It's pretty rudimentary at this point, I would only expect it to work on the most basic models at this point. But it would be nice to have a testsuite to use as a target!
I guess I need to pre-compile my script with PackageCompiler.jl or keep a Julia session open for all tests.
TTFP (Time To First Plot) is hitting hard when running a single test in a freshly started Julia environment 😆
julia>@timerun_test(joinpath("examples", "ExampleFirstOrder.mo"); settings = test_settings)
32.797305 seconds (75.30 M allocations:3.903 GiB, 6.01% gc time, 99.70% compilation time:29% of which was recompilation)
"ExampleFirstOrder/ExampleFirstOrder_res.csv"
julia>@timerun_test(joinpath("examples", "ExampleFirstOrder.mo"); settings = test_settings)
0.034173 seconds (93.38 k allocations:13.376 MiB)
"ExampleFirstOrder/ExampleFirstOrder_res.csv"
I can now run the testsuite localy with Base Modelica export and BaseModelica.jl import. I need to polish it a bit, install Julia on our test servers and we can start a first run to see how it goes. It's terribly slow, but for a first run on just the MSL we can endure it.
PackageCompiler.jl crashes on my machine or never finishes. Leaving open a Julia process doesn't integrate well with our Python-based workflow. Maybe precompiling on one of our servers actually work. @adrpo maybe we can try this when the Modelica conference is done.
I don't think that the current BaseModelica.jl handles Modelica functions
Why should it be so slow to compile?
Maybe you can start testing Modelica.Electrical.Analog.Examples. The ones without swiching, e.g. ChuaCircuit, should be straightforward once flattened.
Okay, precompiling with PackageCompiler.jl is the way to go. It works fine on our server. Takes around 7 minutes, let's say 10 minuters to pre-compile. And then each call with the system image takes around 6 instead of 36 seconds 😲
I espesially like how the CI times out after an hour precompiling, so disabeling that as well.
I guess that's mostly because the Julia system image wasn't build with the specific functions used in those examples. I'll update TestBaseModelica/precompile_skript.jl as soon as BaseModleica.jl can handle a few more models.
It's a pity that exception doesn't print the line/location it could not parse (as I would normally expect from Julia). Having to pull a file out of CI to check line 4 is probably quite annoying.
It's a pity that exception doesn't print the line/location it could not parse (as I would normally expect from Julia). Having to pull a file out of CI to check line 4 is probably quite annoying.
Is this a Julia issue, or an implementation issue on our side?
It's an issue from the parer (so Julia side). I opened an issue for it: SciML/BaseModelica.jl#45
I'm assuming the problem is in https://github.com/andrewcooke/ParserCombinator.jl, because that is where the thrown exception comes from AFAICT. In any case, that package seems unmaintained, so BaseModelica.jl is probably the better place to raise it, in any case. :-P
Activity
jClugstor commentedon Sep 13, 2024
The package is here : https://github.com/SciML/BaseModelica.jl
It's pretty rudimentary at this point, I would only expect it to work on the most basic models at this point. But it would be nice to have a testsuite to use as a target!
casella commentedon Sep 13, 2024
Thanks @jClugstor!
@adrpo, the ball is in your field 😃
adrpo commentedon Sep 22, 2024
I'll have a look at it asap.
casella commentedon Sep 22, 2024
Thanks @adrpo. I think this could be a good starting point for a nice paper at the next EOOLT workshop 😃
AnHeuermann commentedon Sep 4, 2025
I'll start working on it. First I need to catch up on how to use MTK again.
AnHeuermann commentedon Sep 5, 2025
I guess I need to pre-compile my script with PackageCompiler.jl or keep a Julia session open for all tests.
TTFP (Time To First Plot) is hitting hard when running a single test in a freshly started Julia environment 😆
AnHeuermann commentedon Sep 8, 2025
I can now run the testsuite localy with Base Modelica export and BaseModelica.jl import. I need to polish it a bit, install Julia on our test servers and we can start a first run to see how it goes. It's terribly slow, but for a first run on just the MSL we can endure it.
PackageCompiler.jl crashes on my machine or never finishes. Leaving open a Julia process doesn't integrate well with our Python-based workflow. Maybe precompiling on one of our servers actually work. @adrpo maybe we can try this when the Modelica conference is done.
AnHeuermann commentedon Sep 8, 2025
Looks like all tests are failing.
casella commentedon Sep 8, 2025
A few comments
9 remaining items
casella commentedon Sep 11, 2025
grep looks like a good idea to filter out the bulk of doomed models without too much effort. No need to be highly selective.
AnHeuermann commentedon Sep 12, 2025
Okay, precompiling with PackageCompiler.jl is the way to go. It works fine on our server. Takes around 7 minutes, let's say 10 minuters to pre-compile. And then each call with the system image takes around 6 instead of 36 seconds 😲
I espesially like how the CI times out after an hour precompiling, so disabeling that as well.
AnHeuermann commentedon Sep 16, 2025
The nightly test is broken, see #222.
I need to fixe that one the see if this is realy done.
AnHeuermann commentedon Sep 19, 2025
Let's see if the first run will finish: https://test.openmodelica.org/jenkins/blue/organizations/jenkins/LibraryTesting%2FLibraryTest/detail/LibraryTest/9962/pipeline
AnHeuermann commentedon Sep 22, 2025
Okay, we now have our first test results for the MSL: https://libraries.openmodelica.org/branches/basemodelica_jl_master/
The test is started manually. You can write me and I can start a test job. If needed I can also run the test on a scedule.
https://libraries.openmodelica.org/branches/basemodelica_jl_master/Modelica_4.1.0/Modelica_4.1.0.html
All models are exported to Base Modelica and than usually the import fails with:
AnHeuermann commentedon Sep 22, 2025
Looks like some tests timed out: Modelica.Electrical.Analog.Examples.ChuaCircuit (sim)
I guess that's mostly because the Julia system image wasn't build with the specific functions used in those examples. I'll update TestBaseModelica/precompile_skript.jl as soon as BaseModleica.jl can handle a few more models.
cbu-hw commentedon Sep 23, 2025
It's a pity that exception doesn't print the line/location it could not parse (as I would normally expect from Julia). Having to pull a file out of CI to check line 4 is probably quite annoying.
casella commentedon Sep 23, 2025
Is this a Julia issue, or an implementation issue on our side?
AnHeuermann commentedon Sep 23, 2025
It's an issue from the parer (so Julia side). I opened an issue for it: SciML/BaseModelica.jl#45
casella commentedon Sep 23, 2025
@AnHeuermann could you also open an issue on the support of experiment annotation (or follow up the AI thing, I can't find it now)? Thanks!
cbu-hw commentedon Sep 24, 2025
I'm assuming the problem is in https://github.com/andrewcooke/ParserCombinator.jl, because that is where the thrown exception comes from AFAICT. In any case, that package seems unmaintained, so BaseModelica.jl is probably the better place to raise it, in any case. :-P
AnHeuermann commentedon Sep 24, 2025
I already did in SciML/BaseModelica.jl#38.