Skip to content

Commit

Permalink
maxSizeLinearTearing=200 as default
Browse files Browse the repository at this point in the history
  • Loading branch information
ptaeuber authored and OpenModelica-Hudson committed Oct 11, 2017
1 parent 624b9a6 commit ccd5c42
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 9 deletions.
8 changes: 2 additions & 6 deletions Compiler/BackEnd/Tearing.mo
Expand Up @@ -312,9 +312,7 @@ algorithm
true = BackendDAEUtil.getLinearfromJacType(jacType);
maxSize = Flags.getConfigInt(Flags.MAX_SIZE_LINEAR_TEARING);
if intGt(listLength(vindx),maxSize) then
if debugFlag then
Error.addMessage(Error.MAX_TEARING_SIZE, {intString(strongComponentIndexOut), intString(listLength(vindx)),"linear",intString(maxSize)});
end if;
Error.addMessage(Error.MAX_TEARING_SIZE, {intString(strongComponentIndexOut), intString(listLength(vindx)),"linear",intString(maxSize)});
fail();
end if;
if listMember(strongComponentIndexOut,Flags.getConfigIntList(Flags.NO_TEARING_FOR_COMPONENT)) then
Expand All @@ -341,9 +339,7 @@ algorithm
false = BackendDAEUtil.getLinearfromJacType(jacType);
maxSize = Flags.getConfigInt(Flags.MAX_SIZE_NONLINEAR_TEARING);
if intGt(listLength(vindx),maxSize) then
if debugFlag then
Error.addMessage(Error.MAX_TEARING_SIZE, {intString(strongComponentIndexOut), intString(listLength(vindx)),"nonlinear",intString(maxSize)});
end if;
Error.addMessage(Error.MAX_TEARING_SIZE, {intString(strongComponentIndexOut), intString(listLength(vindx)),"nonlinear",intString(maxSize)});
fail();
end if;
if listMember(strongComponentIndexOut,Flags.getConfigIntList(Flags.NO_TEARING_FOR_COMPONENT)) then
Expand Down
2 changes: 1 addition & 1 deletion Compiler/Util/Flags.mo
Expand Up @@ -1286,7 +1286,7 @@ constant ConfigFlag INST_CACHE_SIZE = CONFIG_FLAG(90, "instCacheSize",
NONE(), EXTERNAL(), INT_FLAG(25343), NONE(),
Util.gettext("Sets the size of the internal hash table used for instantiation caching."));
constant ConfigFlag MAX_SIZE_LINEAR_TEARING = CONFIG_FLAG(91, "maxSizeLinearTearing",
NONE(), EXTERNAL(), INT_FLAG(4000), NONE(),
NONE(), EXTERNAL(), INT_FLAG(200), NONE(),
Util.gettext("Sets the maximum system size for tearing of linear systems (default 4000)."));
constant ConfigFlag MAX_SIZE_NONLINEAR_TEARING = CONFIG_FLAG(92, "maxSizeNonlinearTearing",
NONE(), EXTERNAL(), INT_FLAG(10000), NONE(),
Expand Down
2 changes: 1 addition & 1 deletion SimulationRuntime/c/simulation/solver/linearSystem.c
Expand Up @@ -114,7 +114,7 @@ int initializeLinearSystems(DATA *data, threadData_t *threadData)
if(nnz/(double)(size*size)<=linearSparseSolverMaxDensity && size>=linearSparseSolverMinSize)
{
linsys[i].useSparseSolver = 1;
infoStreamPrint(LOG_STDOUT, 0, "Using sparse solver for linear system %d,\nbecause density of %.2f remains under threshold of %.2f and size of %d exceeds threshold of %d.\nThe maximum density and the minimal system size for using sparse solvers can be specified\nusing the runtime flags '<-lssMaxDensity=value>' and '<-lssMinSize=value>'.", i, nnz/(double)(size*size), linearSparseSolverMaxDensity, size, linearSparseSolverMinSize);
infoStreamPrint(LOG_STDOUT, 0, "Using sparse solver for linear system %d,\nbecause density of %.3f remains under threshold of %.3f and size of %d exceeds threshold of %d.\nThe maximum density and the minimal system size for using sparse solvers can be specified\nusing the runtime flags '<-lssMaxDensity=value>' and '<-lssMinSize=value>'.", i, nnz/(double)(size*size), linearSparseSolverMaxDensity, size, linearSparseSolverMinSize);
}

/* allocate more system data */
Expand Down
2 changes: 1 addition & 1 deletion SimulationRuntime/c/simulation/solver/model_help.c
Expand Up @@ -52,7 +52,7 @@

int maxEventIterations = 20;
double linearSparseSolverMaxDensity = 0.2;
int linearSparseSolverMinSize = 4001;
int linearSparseSolverMinSize = 201;
double nonlinearSparseSolverMaxDensity = 0.2;
int nonlinearSparseSolverMinSize = 10001;
double maxStepFactor = 1e12;
Expand Down

0 comments on commit ccd5c42

Please sign in to comment.