Skip to content

Commit

Permalink
Guard only the requested parts with rollback of error-messages (certa…
Browse files Browse the repository at this point in the history
…in sequences would make omc exit because the top of the error stack was wrong)

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@19027 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Feb 10, 2014
1 parent b0f07aa commit 84fc523
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Compiler/BackEnd/IndexReduction.mo
Expand Up @@ -124,26 +124,30 @@ algorithm
// syst = BackendDAEUtil.setEqSystemMatching(isyst,BackendDAE.MATCHING(inAssignments1,inAssignments2,{}));
// dumpSystemGraphML(syst,ishared,NONE(),"ConstrainRevoluteJoint" +& intString(listLength(List.flatten(eqns))) +& ".graphml");
// check by count vars of equations, if len(eqns) > len(vars) stop because of structural singular system
ErrorExt.setCheckpoint("Pantelides");
(eqns_1,unassignedStates,unassignedEqns,discEqns) = minimalStructurallySingularSystem(eqns,isyst,ishared,inAssignments1,inAssignments2,inArg);
size = BackendDAEUtil.systemSize(isyst);
ErrorExt.delCheckpoint("Pantelides");
ErrorExt.setCheckpoint("Pantelides");
Debug.fcall(Flags.BLT_DUMP, print, "Reduce Index\n");
markarr = arrayCreate(size,-1);
(syst,shared,ass1,ass2,arg,_) =
pantelidesIndexReduction1(unassignedStates,unassignedEqns,eqns,eqns_1,actualEqn,isyst,ishared,inAssignments1,inAssignments2,1,markarr,inArg,{});
ErrorExt.rollBack("Pantelides");
ErrorExt.setCheckpoint("Pantelides");
// get from eqns indexes the scalar indexes
newsize = BackendDAEUtil.systemSize(syst);
changedeqns = Debug.bcallret2(intGt(newsize,size),List.intRange2,size+1,newsize,{});
(changedeqns,contiEqn) = getChangedEqnsAndLowest(newsize,ass2,changedeqns,size);
ErrorExt.delCheckpoint("Pantelides");
then
(changedeqns,contiEqn,syst,shared,ass1,ass2,arg);
case ({},_,_,_,_,_,_)
equation
Error.addMessage(Error.INTERNAL_ERROR, {"- IndexReduction.pantelidesIndexReduction called with empty list of equations!"});
then
fail();
case (_,_,_,_,_,_,_)
case (_::_,_,_,_,_,_,_)
equation
ErrorExt.delCheckpoint("Pantelides");
Error.addMessage(Error.INTERNAL_ERROR, {"- IndexReduction.pantelidesIndexReduction failed!"});
Expand Down

0 comments on commit 84fc523

Please sign in to comment.