Skip to content

Commit

Permalink
-extended dump of compInfo
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@24019 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Volker Waurich committed Jan 12, 2015
1 parent bf32ebd commit 4ff428c
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 20 deletions.
2 changes: 1 addition & 1 deletion Compiler/BackEnd/BackendDAEOptimize.mo
Expand Up @@ -2151,7 +2151,7 @@ algorithm
compInfo = BackendDAE.TORN_ANALYSE(comp,torn,other,listLength(tornEqs));
then
countOperationstraverseComps(rest,isyst,ishared,compInfo::compInfosIn);
case (BackendDAE.TORNSYSTEM(tearingvars=vlst, residualequations=tornEqs, otherEqnVarTpl= eqnvartpllst)::rest,_,BackendDAE.SHARED(functionTree=funcs),_)
case (BackendDAE.TORNSYSTEM(tearingvars=vlst, residualequations=tornEqs, otherEqnVarTpl= eqnvartpllst, linear = false)::rest,_,BackendDAE.SHARED(functionTree=funcs),_)
equation
comp = List.first(inComps);
eqns = BackendEquation.getEqnsFromEqSystem(isyst);
Expand Down
43 changes: 24 additions & 19 deletions Compiler/BackEnd/BackendDump.mo
Expand Up @@ -3796,10 +3796,18 @@ algorithm
print(preStr + " NrOfEquations: " + intString(n) + "\n");
end dumpNrOfEquations;

public function dumpCompInfo"dumps the information about the operations in the component"
public function dumpCompInfo"dumps the information about the operations in the component.
author Waurich TUD 2014-04"
input BackendDAE.compInfo compInfo;
algorithm
_ := matchcontinue(compInfo)
print(printCompInfo(compInfo));
end dumpCompInfo;

protected function printCompInfo""
input BackendDAE.compInfo compInfo;
output String sOut;
algorithm
sOut := matchcontinue(compInfo)
local
Integer numAdds,numMul,numDiv,numOth,numTrig,numRel,numLog,numFuncs, size;
Real dens;
Expand All @@ -3808,30 +3816,27 @@ algorithm
BackendDAE.StrongComponent comp;
case(BackendDAE.COUNTER(comp=comp,numAdds=numAdds,numMul=numMul,numDiv=numDiv,numTrig=numTrig,numRelations=numRel,numLog=numLog,numOth=numOth,funcCalls=numFuncs))
equation
if BackendDAEUtil.isSingleEquationComp(comp) then s= "SE"; end if;
if BackendDAEUtil.isWhenComp(comp) then s= "WE"; end if;
print(s+printComponent(comp)+"\tadd|"+intString(numAdds)+"\tmul|"+intString(numMul)+"\tdiv|"+intString(numDiv)+"\ttrig|"+intString(numTrig)+"\trel|"+intString(numRel)+"\tlog|"+intString(numLog)+"\toth|"+intString(numOth)+"\tfuncs|"+intString(numFuncs)+"\n");
then ();
s = "";
if BackendDAEUtil.isSingleEquationComp(comp) then s= "SE "+printComponent(comp);
elseif BackendDAEUtil.isWhenComp(comp) then s= "WE "+printComponent(comp);
end if;
s = s+"\tadd|"+intString(numAdds)+"\tmul|"+intString(numMul)+"\tdiv|"+intString(numDiv)+"\ttrig|"+intString(numTrig)+"\trel|"+intString(numRel)+"\tlog|"+intString(numLog)+"\toth|"+intString(numOth)+"\tfuncs|"+intString(numFuncs)+"\n";
then s;
case(BackendDAE.LES_ANALYSE(allOperations=allOps,comp=comp,size=size,density=dens))
equation
print("LES_INFO "+printComponent(comp)+"\tsize|"+intString(size)+"\tdens|"+realString(dens)+"\n\t");
dumpCompInfo(allOps);
print("\n");
then ();
s = "LES_INFO "+printComponent(comp)+"\tsize|"+intString(size)+"\tdens|"+realString(dens)+"\n\t"+ printCompInfo(allOps)+"\n";
then s;
case(BackendDAE.TORN_ANALYSE(tornEqs=tornEqs, otherEqs=otherEqs,comp=comp,tornSize=size))
equation
if BackendDAEUtil.isLinearTornSystem(comp) then s = "linear"; else s = "nonlinear"; end if;
print(s+"TORN_INFO "+printComponent(comp)+"\tsize|"+intString(size)+"\n\t");
dumpCompInfo(tornEqs);
dumpCompInfo(otherEqs);
print("\n");
then ();
s = s +" TORN_INFO "+printComponent(comp)+"\tsize|"+intString(size)+"\n";
s = s + "\tthe torn eqs:\t"+ printCompInfo(tornEqs);
s = s + "\tthe other eqs:\t" + printCompInfo(otherEqs) +"\n";
then s;
else
equation
print("Dont know this compInfo\n");
then ();
then "Dont know this compInfo\n";
end matchcontinue;
end dumpCompInfo;
end printCompInfo;

annotation(__OpenModelica_Interface="backend");
end BackendDump;

0 comments on commit 4ff428c

Please sign in to comment.