-
Notifications
You must be signed in to change notification settings - Fork 62
Add support for inline of some if-statements #2076
Conversation
The test suite is unstable according to OpenModelica_TEST_PULL_REQUEST 2017-12-13_15-54-40. |
The test suite is unstable according to OpenModelica_TEST_PULL_REQUEST 2017-12-15_08-58-39. |
It seems that
Which seems really wrong since |
@sjoelund Maybe, in |
@vruge - as far as I can see no call is inlined (at least inlineCall doesn't do anything here). #2083 I tried to only do ExpressionSolve if solved=true was given; it seems to make one model succeed (same kind of error as the one I found before), and changes the results of other models. I think perhaps I should try to fix whatever code returns bad expressions instead. |
Maybe, I would check because inlining has impact of this function |
It seems to be: outLhs := expAddX(e, outLhs, inExp3); Which is |
It seems |
The job failed to compile; for details, see OpenModelica_TEST_PULL_REQUEST 2017-12-19_06-33-28. |
The test suite is unstable according to OpenModelica_TEST_PULL_REQUEST 2017-12-19_08-24-55. |
The test suite is unstable according to OpenModelica_TEST_PULL_REQUEST 2017-12-19_08-59-19. |
@casella
And a buildings model giving a diff I'm a little bit scared of. -vol.dynBal.medium.MM = 1.0;
+vol.dynBal.medium.MM = 1.0 / (vol.dynBal.medium.Xi[1] / <EMPTY(scope: Buildings.Fluid.Interfaces.ConservationEquation$vol$dynBal.Medium.BaseProperties$vol$dynBal$medium, name: steam.MM, ty: Real(String quantity PARAM DAE.EQBOUND("MolarMass", SOME("MolarMass"), C_PARAM, [DEFAULT VALUE]), String unit PARAM DAE.EQBOUND("kg/mol", SOME("kg/mol"), C_PARAM, [DEFAULT VALUE]), Real min PARAM DAE.EQBOUND(0.0, SOME(0.0), C_PARAM, [DEFAULT VALUE])))> + (1.0 - vol.dynBal.medium.Xi[1]) / <EMPTY(scope: Buildings.Fluid.Interfaces.ConservationEquation$vol$dynBal.Medium.BaseProperties$vol$dynBal$medium, name: dryair.MM, ty: Real(String quantity PARAM DAE.EQBOUND("MolarMass", SOME("MolarMass"), C_PARAM, [DEFAULT VALUE]), String unit PARAM DAE.EQBOUND("kg/mol", SOME("kg/mol"), C_PARAM, [DEFAULT VALUE]), Real min PARAM DAE.EQBOUND(0.0, SOME(0.0), C_PARAM, [DEFAULT VALUE])))>); |
Which might be due to:
Which is supposed to be an alias of:
And not a reference to:
|
p = 0 is quite bad, but I'm not sure if this used to work before |
It seems to just be bad code generation for some alias of record components which get messed up due to some difference between simulation and initialization. |
If-statements that look like if-expressions can now be inlined. This fixes an issue reported in ticket:4423.
Use DAE.RSUB() to handle general expressions. When doing inline of a function call, we can use DAE.RSUB instead of failing; previously we only handled component references passed to the call. Also added code generation and simplifications for DAE.RSUB since it was only used for MetaModelica previously. This fixes some of the issues raised in ticket:4423.
The test suite is unstable according to OpenModelica_TEST_PULL_REQUEST 2018-01-02_13-07-48. |
The code generator gave the wrong variable indexes for aliases that were not replaced in the backend. This prints some warnings or errors for these cases so we can either fix the code (or replace the code generator to handle aliases better).
The test suite is unstable according to OpenModelica_TEST_PULL_REQUEST 2018-01-02_14-16-07. |
ThermoPower.Test.DistributedParameterComponents.TestFlow1D2phChen.mos is now the only failing test. It fails in a torn NLS with 193 unknowns and 9 iteration variables (previously it was 195/9, but it seems something in there is now slightly different and |
I guess this is due to the heuristics and not really an issue with your changes. |
Yes, I realize now that the master fails during initialization for me as well (my previous comment was regarding that system that failed). Hudson fails during integration at time=116. So the model is probably hard to solve and doesn't quite work at the moment anyway. I guess I can try it on asap and see if tweaking the numerical tolerance makes Hudson happy. |
The IDA solver said it was a (torn) linear system that was problematic. Disabling tearing on it didn't help. I'll just disable the simulation success part of the test :( |
The test suite is unstable according to OpenModelica_TEST_PULL_REQUEST 2018-01-03_08-37-08. |
The tests run correctly according to OpenModelica_TEST_PULL_REQUEST 2018-01-03_09-01-41. |
If-statements that look like if-expressions can now be inlined. This fixes an issue reported in ticket:4423. Belonging to [master]: - #2076 - OpenModelica/OpenModelica-testsuite#810
Use DAE.RSUB() to handle general expressions. When doing inline of a function call, we can use DAE.RSUB instead of failing; previously we only handled component references passed to the call. Also added code generation and simplifications for DAE.RSUB since it was only used for MetaModelica previously. This fixes some of the issues raised in ticket:4423. Belonging to [master]: - #2076 - OpenModelica/OpenModelica-testsuite#810
Belonging to [master]: - #2076 - OpenModelica/OpenModelica-testsuite#810
Belonging to [master]: - #2076 - OpenModelica/OpenModelica-testsuite#810
The code generator gave the wrong variable indexes for aliases that were not replaced in the backend. This prints some warnings or errors for these cases so we can either fix the code (or replace the code generator to handle aliases better). Belonging to [master]: - #2076 - OpenModelica/OpenModelica-testsuite#810
Belonging to [master]: - OpenModelica/OMCompiler#2076 - #810
There seems to have been something missing: https://libraries.openmodelica.org/branches/history/master/2018-01-03%2000:33:31..2018-01-03%2010:55:08.html |
If-statements that look like if-expressions can now be inlined.
This fixes an issue reported in ticket:4423.