Skip to content

Commit

Permalink
Reduce max density for sparse solver
Browse files Browse the repository at this point in the history
  • Loading branch information
phannebohm authored and AnHeuermann committed Nov 18, 2021
1 parent 2ca59e4 commit 16b841b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions OMCompiler/SimulationRuntime/c/simulation/solver/model_help.c
Expand Up @@ -58,9 +58,9 @@
#endif

int maxEventIterations = 20;
double linearSparseSolverMaxDensity = 0.2;
double linearSparseSolverMaxDensity = DEFAULT_FLAG_LSS_MAX_DENSITY;
int linearSparseSolverMinSize = DEFAULT_FLAG_LSS_MIN_SIZE;
double nonlinearSparseSolverMaxDensity = 0.2;
double nonlinearSparseSolverMaxDensity = DEFAULT_FLAG_NLS_MAX_DENSITY;
int nonlinearSparseSolverMinSize = DEFAULT_FLAG_NLS_MIN_SIZE;
double maxStepFactor = 1e12;
double newtonXTol = 1e-12;
Expand Down
8 changes: 4 additions & 4 deletions OMCompiler/SimulationRuntime/c/util/simulation_options.c
Expand Up @@ -219,7 +219,7 @@ const char *FLAG_DESC[FLAG_MAX+1] = {
/* FLAG_LS */ "value specifies the linear solver method (default: lapack, totalpivot (fallback))",
/* FLAG_LS_IPOPT */ "value specifies the linear solver method for ipopt",
/* FLAG_LSS */ "value specifies the linear sparse solver method (default: umfpack)",
/* FLAG_LSS_MAX_DENSITY */ "[double (default 0.2)] value specifies the maximum density for using a linear sparse solver",
/* FLAG_LSS_MAX_DENSITY */ "[double (default " EXPANDSTRING(DEFAULT_FLAG_LSS_MAX_DENSITY) ")] value specifies the maximum density for using a linear sparse solver",
/* FLAG_LSS_MIN_SIZE */ "[int (default " EXPANDSTRING(DEFAULT_FLAG_LSS_MIN_SIZE) ")] value specifies the minimum system size for using a linear sparse solver",
/* FLAG_LV */ "[string list] value specifies the logging level",
/* FLAG_LV_TIME */ "[double list] specifying time interval to allow loging in",
Expand All @@ -235,7 +235,7 @@ const char *FLAG_DESC[FLAG_MAX+1] = {
/* FLAG_NLS */ "value specifies the nonlinear solver",
/* FLAG_NLS_INFO */ "outputs detailed information about solving process of non-linear systems into csv files.",
/* FLAG_NLS_LS */ "value specifies the linear solver used by the non-linear solver",
/* FLAG_NLS_MAX_DENSITY */ "[double (default 0.2)] value specifies the maximum density for using a non-linear sparse solver",
/* FLAG_NLS_MAX_DENSITY */ "[double (default " EXPANDSTRING(DEFAULT_FLAG_NLS_MAX_DENSITY) ")] value specifies the maximum density for using a non-linear sparse solver",
/* FLAG_NLS_MIN_SIZE */ "[int (default " EXPANDSTRING(DEFAULT_FLAG_NLS_MIN_SIZE) ")] value specifies the minimum system size for using a non-linear sparse solver",
/* FLAG_NOEMIT */ "do not emit any results to the result file",
/* FLAG_NOEQUIDISTANT_GRID */ "stores results not in equidistant time grid as given by stepSize or numberOfIntervals, instead the variable step size of dassl or ida integrator.",
Expand Down Expand Up @@ -437,7 +437,7 @@ const char *FLAG_DETAILED_DESC[FLAG_MAX+1] = {
" Value specifies the linear sparse solver method",
/* FLAG_LSS_MAX_DENSITY */
" Value specifies the maximum density for using a linear sparse solver.\n"
" The value is a Double with default value 0.2.",
" The value is a Double with default value " EXPANDSTRING(DEFAULT_FLAG_LSS_MAX_DENSITY) ".",
/* FLAG_LSS_MIN_SIZE */
" Value specifies the minimum system size for using a linear sparse solver.\n"
" The value is an Integer with default value " EXPANDSTRING(DEFAULT_FLAG_LSS_MIN_SIZE) ".",
Expand Down Expand Up @@ -486,7 +486,7 @@ const char *FLAG_DETAILED_DESC[FLAG_MAX+1] = {
" Value specifies the linear solver used by the non-linear solver:",
/* FLAG_NLS_MAX_DENSITY */
" Value specifies the maximum density for using a non-linear sparse solver.\n"
" The value is a Double with default value 0.2.",
" The value is a Double with default value " EXPANDSTRING(DEFAULT_FLAG_NLS_MAX_DENSITY) ".",
/* FLAG_NLS_MIN_SIZE */
" Value specifies the minimum system size for using a non-linear sparse solver.\n"
" The value is an Integer with default value " EXPANDSTRING(DEFAULT_FLAG_NLS_MIN_SIZE) ".",
Expand Down
2 changes: 2 additions & 0 deletions OMCompiler/SimulationRuntime/c/util/simulation_options.h
Expand Up @@ -40,7 +40,9 @@
#define EXPANDSTRING(s) EXPANDSTRINGHELPER(s)
#define EXPANDSTRINGHELPER(s) #s

#define DEFAULT_FLAG_LSS_MAX_DENSITY 0.2
#define DEFAULT_FLAG_LSS_MIN_SIZE 1000
#define DEFAULT_FLAG_NLS_MAX_DENSITY 0.1
#define DEFAULT_FLAG_NLS_MIN_SIZE 1000

enum _FLAG
Expand Down

0 comments on commit 16b841b

Please sign in to comment.