Skip to content

Commit

Permalink
- change execStat usage a bit to get a better overview
Browse files Browse the repository at this point in the history
  • Loading branch information
Willi Braun authored and OpenModelica-Hudson committed Jun 18, 2015
1 parent c9cd590 commit 69e3810
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 10 deletions.
7 changes: 4 additions & 3 deletions Compiler/BackEnd/BackendDAEUtil.mo
Expand Up @@ -6905,6 +6905,7 @@ algorithm

// transformation phase (matching and sorting using index reduction method)
sode := causalizeDAE(optdae, NONE(), matchingAlgorithm, daeHandler, true);
SimCodeUtil.execStat("matching and sorting");

if Flags.isSet(Flags.GRAPHML) then
HpcOmTaskGraph.dumpBipartiteGraph(sode, fileNamePrefix);
Expand Down Expand Up @@ -7036,15 +7037,15 @@ algorithm
BackendDAE.DAE(systs,shared) := inDAE;
// reduce index
(systs,shared,args,causalized) := mapCausalizeDAE(systs,shared,inMatchingOptions,matchingAlgorithm,stateDeselection,{},{},false);
SimCodeUtil.execStat("matching");
//SimCodeUtil.execStat("matching");
// do late inline
outDAE := if dolateinline then BackendInline.lateInlineFunction(BackendDAE.DAE(systs,shared)) else BackendDAE.DAE(systs,shared);
// do state selection
BackendDAE.DAE(systs,shared) := stateDeselectionDAE(causalized,outDAE,args,stateDeselection);
// sort assigned equations to blt form
systs := mapSortEqnsDAE(systs,shared,{});
outDAE := BackendDAE.DAE(systs,shared);
SimCodeUtil.execStat("sorting");
//SimCodeUtil.execStat("sorting");
end causalizeDAE;

protected function mapCausalizeDAE "
Expand Down Expand Up @@ -7164,7 +7165,7 @@ algorithm
equation
// do state selection
outDAE = sDfunc(BackendDAE.DAE(systs,shared),args);
SimCodeUtil.execStat("transformDAE -> state selection " + methodstr);
//SimCodeUtil.execStat("transformDAE -> state selection " + methodstr);
then
outDAE;
else inDAE;
Expand Down
8 changes: 4 additions & 4 deletions Compiler/BackEnd/SymbolicJacobian.mo
Expand Up @@ -1722,14 +1722,14 @@ algorithm
seedlst = List.map1(comref_vars, createSeedVars, inName);
s1 = intString(listLength(inVars));

SimCodeUtil.execStat("analytical Jacobians -> starting to generate the jacobian. DiffVars:" + s + " diffed equations: " + s1);
//SimCodeUtil.execStat("analytical Jacobians -> starting to generate the jacobian. DiffVars:" + s + " diffed equations: " + s1);

// Differentiate the ODE system w.r.t states for jacobian
(backendDAE as BackendDAE.DAE(shared=shared), funcs) = generateSymbolicJacobian(reduceDAE, inDiffVars, inDifferentiatedVars, BackendVariable.listVar1(seedlst), inStateVars, inInputVars, inParameterVars, inName);
if Flags.isSet(Flags.JAC_DUMP2) then
print("analytical Jacobians -> generated equations for Jacobian " + inName + " time: " + realString(clock()) + "\n");
end if;
SimCodeUtil.execStat("analytical Jacobians -> generated jacobian equations");
//SimCodeUtil.execStat("analytical Jacobians -> generated jacobian equations");

knvars1 = BackendVariable.daeKnVars(shared);
knvarsTmp = BackendVariable.varList(knvars1);
Expand All @@ -1753,11 +1753,11 @@ algorithm
end if;
knvars = BackendVariable.listVar1(knvarsTmp);
backendDAE = BackendDAEUtil.addBackendDAEKnVars(knvars,backendDAE);
SimCodeUtil.execStat("analytical Jacobians -> generated optimized jacobians");
//SimCodeUtil.execStat("analytical Jacobians -> generated optimized jacobians");

// generate sparse pattern
(sparsepattern,colsColors) = generateSparsePattern(reduceDAE, inDiffVars, diffedVars);
SimCodeUtil.execStat("analytical Jacobians -> generated generateSparsePattern");
//SimCodeUtil.execStat("analytical Jacobians -> generated generateSparsePattern");
then
((backendDAE, inName, inDiffVars, diffedVars, inVars), sparsepattern, colsColors, funcs);
else
Expand Down
6 changes: 5 additions & 1 deletion Compiler/SimCode/SimCodeUtil.mo
Expand Up @@ -15057,7 +15057,11 @@ algorithm
gcStr = GC.profStatsStr(GC.getProfStats(), head="");
timeStr = System.snprintff("%.4g",20,t);
totalTimeStr = System.snprintff("%.4g",20,total);
Error.addMessage(Error.EXEC_STAT,{name,timeStr,totalTimeStr,gcStr});
if Flags.isSet(Flags.GC_PROF) then
Error.addMessage(Error.EXEC_STAT_GC,{name,timeStr,totalTimeStr,gcStr});
else
Error.addMessage(Error.EXEC_STAT,{name,timeStr,totalTimeStr});
end if;
System.realtimeTick(ClockIndexes.RT_CLOCK_EXECSTAT);
then ();
end match;
Expand Down
7 changes: 5 additions & 2 deletions Compiler/Util/Error.mo
Expand Up @@ -771,8 +771,6 @@ public constant Message INVALID_FLAG_TYPE_STRINGS = MESSAGE(545, SCRIPTING(), ER
Util.gettext("Invalid type of flag %s, expected one of %s but got %s."));
public constant Message FUNCTION_RETURN_EXT_OBJ = MESSAGE(546, TRANSLATION(), ERROR(),
Util.gettext("Function %s returns an external object, but the only function allowed to return this object is %s."));
public constant Message EXEC_STAT = MESSAGE(547, TRANSLATION(), NOTIFICATION(),
Util.gettext("Performance of %s: time %s/%s, GC stats:%s"));
public constant Message NON_STANDARD_OPERATOR = MESSAGE(547, TRANSLATION(), WARNING(),
Util.gettext("Usage of non-standard operator (not specified in the Modelica specification): %s. Functionality might be partially supported but is not guaranteed."));
public constant Message CONNECT_ARRAY_SIZE_ZERO = MESSAGE(548, TRANSLATION(), WARNING(),
Expand Down Expand Up @@ -823,6 +821,11 @@ public constant Message SUBCLOCK_CONFLICT = MESSAGE(570, TRANSLATION(), ERROR(),
Util.gettext("Partition have different sub-clocks."));
public constant Message CLOCK_CONFLICT = MESSAGE(571, TRANSLATION(), ERROR(),
Util.gettext("Partition have different base clocks."));
public constant Message EXEC_STAT = MESSAGE(572, TRANSLATION(), NOTIFICATION(),
Util.gettext("Performance of %s: time %s/%s"));
public constant Message EXEC_STAT_GC = MESSAGE(573, TRANSLATION(), NOTIFICATION(),
Util.gettext("Performance of %s: time %s/%s, GC stats:%s"));


public constant Message MATCH_SHADOWING = MESSAGE(5001, TRANSLATION(), ERROR(),
Util.gettext("Local variable '%s' shadows another variable."));
Expand Down

0 comments on commit 69e3810

Please sign in to comment.