#2572 closed defect (fixed)
Generates an internal error
Reported by: | Michael Tiller | Owned by: | Lennart Ochel |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | Backend | Version: | trunk |
Keywords: | Cc: | Willi Braun, Lennart Ochel, Mahder Alemseged Gebremedhin |
Description
This model generates in internal error. I'm using OM r18788 on MacOSX.
The error message is:
Error: Internal error Transformation Module PFPlusExt index Reduction Method Pantelides failed!
This repo is currently private, but Martin S. has access to it. I'll be happy to give access to any other developer who requires it in order to address the issue.
Attachments (1)
Change History (15)
comment:1 by , 11 years ago
Cc: | added |
---|
comment:2 by , 11 years ago
Nothing is using integer indices that I know of. If you know otherwise, please point it out. I used the enumeration in all array declarations to specify the dimension and I use only values of the enumeration to index the arrays. As such, it should be completely legal Modelica.
I don't know where those .C[3] references are coming from in the error messages. I think those are being inserted by OM, not me.
comment:3 by , 11 years ago
Yes, the flattened code is:
/*Real[ModelicaByExample.Components.ChemicalReactions.ABX.Species]*/ solution.C = /* scalar */ {/*Real*/ solution.mixture.C[/* 1 */ModelicaByExample.Components.ChemicalReactions.ABX.Species.A], /*Real*/ solution.mixture.C[/* 2 */ModelicaByExample.Components.ChemicalReactions.ABX.Species.B], /*Real*/ solution.mixture.C[/* 3 */ModelicaByExample.Components.ChemicalReactions.ABX.Species.X]} /* array equation [ModelicaByExample.Components.ChemicalReactions.ABX.Species] */;
Which obviously the backend does expand to something wrong (using the integer indexes when expanding the left side I would guess).
by , 11 years ago
Attachment: | ABX_System.mo added |
---|
comment:4 by , 11 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
Go Lennart. No sleep for you until you fix it. With the full model attached it should be very simple, right?
comment:5 by , 11 years ago
Well, the error messages generated with +t
are probably misleading.
The equations get expended, but the variables not. Hence there are 65 equations and only 57 variables.
Without the flag +t
there are 57 variables and 57 equations and the proper error messages occure.
I still do not know what that means ...
comment:6 by , 10 years ago
Cc: | added |
---|
Now, there are issues with the generated c code - probably due to Q-Idents:
foo.TestMe.c: In function ‘foo_TestMe_eqFunction_17’: foo.TestMe.c:111: error: ‘$P_omcQuot_412B423C2D58$Pmixture$PR$lB1$rB’ undeclared (first use in this function) foo.TestMe.c:111: error: (Each undeclared identifier is reported only once foo.TestMe.c:111: error: for each function it appears in.) foo.TestMe.c:111: error: ‘$P_omcQuot_582B422D3E522B53$Pmixture$PR$lB1$rB’ undeclared (first use in this function) foo.TestMe.c:111: error: ‘$P_omcQuot_412B422D3E58$Pmixture$PR$lB1$rB’ undeclared (first use in this function)
102: /* 103: equation index: 17 104: type: SIMPLE_ASSIGN 105: solution._mixture._R[foo.ModelicaByExample.Components.ChemicalReactions.ABX.Species.X] = (-'A+B<-X'.mixture.R[foo.ModelicaByExample.Components.ChemicalReactions.ABX.Species.X]) - 'X+B->R+S'.mixture.R[foo.ModelicaByExample.Components.ChemicalReactions.ABX.Species.X] - 'A+B->X'.mixture.R[foo.ModelicaByExample.Components.ChemicalReactions.ABX.Species.X] 106: */ 107: void foo_TestMe_eqFunction_17(DATA *data) 108: { 109: const int equationIndexes[2] = {1,17}; 110: TRACE_PUSH 111: $Psolution$Pmixture$PR$lB3$rB = (((-$P_omcQuot_412B423C2D58$Pmixture$PR$lB1$rB) - $P_omcQuot_582B422D3E522B53$Pmixture$PR$lB1$rB) - $P_omcQuot_412B422D3E58$Pmixture$PR$lB1$rB); 112: TRACE_POP 113: }
comment:7 by , 10 years ago
Milestone: | 1.9.1 → 1.9.2 |
---|
This ticket was not closed for 1.9.1, which has now been released. It was batch modified for milestone 1.9.2 (but maybe an empty milestone was more appropriate; feel free to change it).
comment:8 by , 10 years ago
Milestone: | 1.9.2 → 1.9.3 |
---|
Milestone changed to 1.9.3 since 1.9.2 was released.
comment:12 by , 8 years ago
Any updates on this. It would be nice to finally be able to include the plots in the Modelica by Example book. :-)
comment:13 by , 8 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Fixed in: 93bd45e/OMCompiler. The only thing left for this was that apostrophes (single quotes) were not escaped in the _init.xml file.
This is indeed giving bad error-messages. With default settings I got:
With +t (type information when printing expressions), I got:
From what I understand, solution.C is an alias of solution.mixture.C. Except one is using enumeration indexes, and the other uses integers. So alias elimination fails and sorting fails due to this.
The error-message says index reduction fails, but I believe if sorting fails it always prints this error even if index reduction is not performed or needed.