Skip to content

Commit

Permalink
- added config flag to deactivate tearing: +noTearing
Browse files Browse the repository at this point in the history
 - added debug flag to deactivate tearing of mixed system: +d=noMixedTearing


git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@13602 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Willi Braun committed Oct 24, 2012
1 parent 01bffef commit 3c9ddcb
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 9 deletions.
13 changes: 9 additions & 4 deletions Compiler/BackEnd/BackendDAEOptimize.mo
Original file line number Diff line number Diff line change
Expand Up @@ -9226,6 +9226,7 @@ public function tearingSystemNew "function tearingSystem
input BackendDAE.BackendDAE inDAE;
output BackendDAE.BackendDAE outDAE;
algorithm
false := Flags.getConfigBool(Flags.NO_TEARING);
(outDAE,_) := BackendDAEUtil.mapEqSystemAndFold(inDAE,tearingSystemNew0,false);
end tearingSystemNew;

Expand Down Expand Up @@ -9285,11 +9286,15 @@ algorithm
(acc,b1);
case (_,_,(comp as BackendDAE.MIXEDEQUATIONSYSTEM(condSystem=comp1,disc_eqns=eindex,disc_vars=vindx))::comps,_,_)
equation
// only mixed part
//(_,_) = tearingSystemNew1_1(isyst,ishared,eindex,vindx,NONE(),BackendDAE.JAC_NO_ANALYTIC());
true = Flags.isSet(Flags.NO_MIXED_TEARING);
// only continues part
//(comp1::{},true) = tearingSystemNew1(isyst,ishared,{comp1},false,{});
//(acc,b1) = tearingSystemNew1(isyst,ishared,comps,true,BackendDAE.MIXEDEQUATIONSYSTEM(comp1,eindex,vindx)::iAcc);
(comp1::{},true) = tearingSystemNew1(isyst,ishared,{comp1},false,{});
(acc,b1) = tearingSystemNew1(isyst,ishared,comps,true,BackendDAE.MIXEDEQUATIONSYSTEM(comp1,eindex,vindx)::iAcc);
then
(acc,b1);
case (_,_,(comp as BackendDAE.MIXEDEQUATIONSYSTEM(condSystem=comp1,disc_eqns=eindex,disc_vars=vindx))::comps,_,_)
equation
false = Flags.isSet(Flags.NO_MIXED_TEARING);
// mixed and continues part
(eindex,vindx) = BackendDAETransform.getEquationAndSolvedVarIndxes(comp);
(comp1,true) = tearingSystemNew1_1(isyst,ishared,eindex,vindx,NONE(),BackendDAE.JAC_NO_ANALYTIC());
Expand Down
19 changes: 14 additions & 5 deletions Compiler/Util/Flags.mo
Original file line number Diff line number Diff line change
Expand Up @@ -364,8 +364,10 @@ constant DebugFlag UNCERTAINTIES = DEBUG_FLAG(99, "uncertainties",
constant DebugFlag DUMP_DAE= DEBUG_FLAG(100, "daeunparser",
Util.gettext("Enables dumping of the DAE"));
constant DebugFlag SHOW_START_ORIGIN = DEBUG_FLAG(101, "showStartOrigin",
Util.gettext("Enables dumping of the DAE startOrigin attribute of the variables"));

Util.gettext("Enables dumping of the DAE startOrigin attribute of the variables"));
// The flags mixedTearing are only needed as long tearing of mixed system in not default.
constant DebugFlag NO_MIXED_TEARING = DEBUG_FLAG(102, "noMixedTearing",
Util.gettext("Disables tearing of mixed system."));

// 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 @@ -472,7 +474,8 @@ constant list<DebugFlag> allDebugFlags = {
SEMILINEAR,
UNCERTAINTIES,
DUMP_DAE,
SHOW_START_ORIGIN
SHOW_START_ORIGIN,
NO_MIXED_TEARING
};

// CONFIGURATION FLAGS
Expand Down Expand Up @@ -591,7 +594,7 @@ constant ConfigFlag POST_OPT_MODULES = CONFIG_FLAG(16, "postOptModules",
"removeUnusedFunctions",
"simplifyTimeIndepFuncCalls",
"inputDerivativesUsed",
// "detectJacobianSparsePattern",
// "detectJacobianSparsePattern",
"optimizeInitialSystem"
}),
SOME(STRING_DESC_OPTION({
Expand Down Expand Up @@ -699,6 +702,11 @@ constant ConfigFlag LOCALE_FLAG = CONFIG_FLAG(41, "locale",
constant ConfigFlag DEFAULT_OPENCL_DEVICE = CONFIG_FLAG(42, "defaultOCLDevice",
SOME("o"), EXTERNAL(), INT_FLAG(0), NONE(),
Util.gettext("Sets the default OpenCL device to be used for parallel execution."));
// The flag noTearing is just for easy activation and deactivation
// of the tearing optimazation module.
constant ConfigFlag NO_TEARING = CONFIG_FLAG(43, "noTearing",
NONE(), EXTERNAL(), BOOL_FLAG(false),NONE(),
Util.gettext("Disables tearing at all."));

// This is a list of all configuration flags. A flag can not be used unless it's
// in this list, and the list is checked at initialization so that all flags are
Expand Down Expand Up @@ -745,7 +753,8 @@ constant list<ConfigFlag> allConfigFlags = {
REDUCTION_METHOD,
PLOT_SILENT,
LOCALE_FLAG,
DEFAULT_OPENCL_DEVICE
DEFAULT_OPENCL_DEVICE,
NO_TEARING
};

public function new
Expand Down

0 comments on commit 3c9ddcb

Please sign in to comment.