Skip to content

Commit

Permalink
Fix help for default min size for sparse solvers (#6793)
Browse files Browse the repository at this point in the history
  • Loading branch information
sjoelund committed Oct 2, 2020
1 parent 6bc82f9 commit 389c4e4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions OMCompiler/SimulationRuntime/c/simulation/solver/model_help.c
Expand Up @@ -58,9 +58,9 @@

int maxEventIterations = 20;
double linearSparseSolverMaxDensity = 0.2;
int linearSparseSolverMinSize = 201;
int linearSparseSolverMinSize = DEFAULT_FLAG_LSS_MIN_SIZE;
double nonlinearSparseSolverMaxDensity = 0.2;
int nonlinearSparseSolverMinSize = 10001;
int nonlinearSparseSolverMinSize = DEFAULT_FLAG_NLS_MIN_SIZE;
double maxStepFactor = 1e12;
double newtonXTol = 1e-12;
double newtonFTol = 1e-12;
Expand Down
4 changes: 2 additions & 2 deletions OMCompiler/SimulationRuntime/c/util/simulation_options.c
Expand Up @@ -217,7 +217,7 @@ const char *FLAG_DESC[FLAG_MAX+1] = {
/* 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_MIN_SIZE */ "[int (default 4001)] value specifies the minimum system size 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",
/* FLAG_MAX_BISECTION_ITERATIONS */ "[int (default 0)] value specifies the maximum number of bisection iterations for state event detection or zero for default behavior",
Expand All @@ -233,7 +233,7 @@ const char *FLAG_DESC[FLAG_MAX+1] = {
/* 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_MIN_SIZE */ "[int (default 10001)] value specifies the minimum system size 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.",
/* FLAG_NOEQUIDISTANT_OUT_FREQ*/ "value controls the output frequency in noEquidistantTimeGrid mode",
Expand Down
6 changes: 6 additions & 0 deletions OMCompiler/SimulationRuntime/c/util/simulation_options.h
Expand Up @@ -37,6 +37,12 @@
extern "C" {
#endif

#define EXPANDSTRING(s) EXPANDSTRINGHELPER(s)
#define EXPANDSTRINGHELPER(s) #s

#define DEFAULT_FLAG_LSS_MIN_SIZE 201
#define DEFAULT_FLAG_NLS_MIN_SIZE 10001

enum _FLAG
{
FLAG_UNKNOWN = 0,
Expand Down

0 comments on commit 389c4e4

Please sign in to comment.