Opened 5 years ago

Last modified 5 years ago

#5539 assigned defect

Stack overflow with tearingSelect

Reported by: Vitalij Ruge Owned by: Lennart Ochel
Priority: normal Milestone: Future
Component: Backend Version:
Keywords: Cc: Karim Adbdelhak, Andreas Heuermann

Description

The following model raise a Stack overflow

model tearingSelect2
   Real x1 annotation(tearingSelect = never);
   Real x2;
   Real x3;
   Real x4;
   Real x5;
   Real x6 annotation(tearingSelect = never);
equation
   0 = x1*x1 + x2;
   0 = x1*x1 + x2 +x3;
   0 = x1*x1 + x3 + x4;
   0 = x1*x1 + x4 + x5;
   0 = x1*x1 + x5 + x6;
   0 = x1 + x6*x6;
end tearingSelect2;

[/home/vruge/packages/OpenModelica/OMCompiler/Compiler/BackEnd/BackendDAEUtil.mo:7137:3-7137:155:writable] Error: Internal error Stack overflow in BackendDAEUtil.getSolvedSystem...
[bt] #1 /home/vruge/packages/OpenModelica/OMCompiler/build/bin/../lib/x86_64-linux-gnu/omc/libOpenModelicaRuntimeC.so(mmc_setStacktraceMessages_threadData)
[bt] #2 /home/vruge/packages/OpenModelica/OMCompiler/build/bin/../lib/x86_64-linux-gnu/omc/libOpenModelicaRuntimeC.so(mmc_do_stackoverflow)
[bt] #3 /home/vruge/packages/OpenModelica/OMCompiler/build/bin/../lib/x86_64-linux-gnu/omc/libOpenModelicaCompiler.so(Tearing.removeMatched)
[bt] #4 /home/vruge/packages/OpenModelica/OMCompiler/build/bin/../lib/x86_64-linux-gnu/omc/libOpenModelicaCompiler.so(Tearing.getUnsolvableVarsConsiderMatching)
[bt] #5 /home/vruge/packages/OpenModelica/OMCompiler/build/bin/../lib/x86_64-linux-gnu/omc/libOpenModelicaCompiler.so(Tearing.omcTearingSelectTearingVar)
[bt] #6...1024 /home/vruge/packages/OpenModelica/OMCompiler/build/bin/../lib/x86_64-linux-gnu/omc/libOpenModelicaCompiler.so(Tearing.omcTearing2)
[bt] #1025 [...]

Change History (5)

comment:1 by Francesco Casella, 5 years ago

Owner: changed from somebody to Lennart Ochel
Status: newassigned

@vitalij, I'm a bit unsure about the meaning of annotation(tearingSelect=never). I can't see that in the specification. Is this an OMC-specific annotation? Then, it should be annotation(__OpenModelica.tearingSelect = never). Also, it should be documented somewhere. I googled it, but could only find a handful of references in commit messages.

I see that @lochel used it in PNLib, can you comment about that?

comment:2 by Adrian Pop, 5 years ago

__OpenModelica.tearingSelect -> __OpenModelica_tearingSelect. Vendor annotations do not have dots in them, why, I don't know because it would be easier to support :)

comment:3 by Vitalij Ruge, 5 years ago

It's a nice functionality from Patrick. It's relay helpful to control the tearing variables.
(small drawback: context is missing e.g. simulation or initialization )

we can compare it with StateSelect.
In OM we have tearingSelect={always, prefer, avoid, never}.
Of course it has an effect of the count of iteration variable.

For example preferTVarsWithStartValue using the prefer option.

comment:4 by Francesco Casella, 5 years ago

Sounds good, but we should probably change the name of the annotation to __OpenModelica_tearingSelect.

comment:5 by Andreas Heuermann, 5 years ago

Cc: Karim Adbdelhak Andreas Heuermann added
Note: See TracTickets for help on using tickets.