Skip to content

Commit

Permalink
- flag for usage of countOperations
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@15354 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Jens Frenkel committed Feb 27, 2013
1 parent 2f25bc6 commit c9369ef
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
10 changes: 9 additions & 1 deletion Compiler/BackEnd/BackendDAEOptimize.mo
Original file line number Diff line number Diff line change
Expand Up @@ -5737,7 +5737,15 @@ public function countOperations "function countOperations
input BackendDAE.BackendDAE inDAE;
output BackendDAE.BackendDAE outDAE;
algorithm
(outDAE,_) := BackendDAEUtil.mapEqSystemAndFold(inDAE,countOperations0,false);
outDAE := matchcontinue(inDAE)
case (_)
equation
true = Flags.isSet(Flags.COUNT_OPERATIONS);
(outDAE,_) = BackendDAEUtil.mapEqSystemAndFold(inDAE,countOperations0,false);
then
outDAE;
else then inDAE;
end matchcontinue;
end countOperations;

protected function countOperations0 "function countOperations0
Expand Down
7 changes: 5 additions & 2 deletions Compiler/Util/Flags.mo
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,8 @@ constant DebugFlag ON_RELAXATION = DEBUG_FLAG(113, "onRelaxation",
Util.gettext("perform O(n) Relaxation"));
constant DebugFlag SHORT_OUTPUT = DEBUG_FLAG(114, "shortOutput",
Util.gettext("Enables short output of the simulate() command. Useful for tools like OMNotebook."));
constant DebugFlag COUNT_OPERATIONS = DEBUG_FLAG(115, "countOperations",
Util.gettext("count operations"));

// This is a list of all debug flags, to keep track of which flags are used. A
// flag can not be used unless it's in this list, and the list is checked at
Expand Down Expand Up @@ -512,7 +514,8 @@ constant list<DebugFlag> allDebugFlags = {
DUMP_INLINE_SOLVER,
DUMP_ENCAPSULATEWHENCONDITIONS,
ON_RELAXATION,
SHORT_OUTPUT
SHORT_OUTPUT,
COUNT_OPERATIONS
};

// CONFIGURATION FLAGS
Expand Down Expand Up @@ -631,7 +634,7 @@ constant ConfigFlag POST_OPT_MODULES = CONFIG_FLAG(16, "postOptModules",
"removeSimpleEquations",
"encapsulateWhenConditions", // must called after remove simple equations
"tearingSystem", // must be the last one, otherwise the torn systems are lost when throw away the matching information
// "countOperations",
"countOperations",
"removeUnusedFunctions",
"inputDerivativesUsed",
"detectJacobianSparsePattern",
Expand Down

0 comments on commit c9369ef

Please sign in to comment.