Flags

setFlags sets flags of the frontend by name, for the Julia session:

OMFrontend.setFlags(execstat = true)                       # a debug flag: true or false
OMFrontend.setFlags(evalLoopLimit = 10^6, std = "3.6")     # options: a value of their type
OMFrontend.setFlags(allowNonStandardModelica = ["reinitInAlgorithms"])

An unknown name or a value of the wrong type raises an ArgumentError, and then no flag changes. The names are omc's (-d=execstat, --evalLoopLimit=...); only these flags exist in OMFrontend. The tests check one model per flag (test/publicApiTests.jl) and that this page lists each one.

Debug flags

FlagDefaultEffect
evaluateAllParametersfalseEvaluates all parameters, not only structural ones: x = k * time becomes x = 2.0 * time.
nfEvalConstArgFuncstrueEvaluates functions called with constant arguments: f(2) becomes its value.
inlineFunctionstrueInlines functions with annotation(Inline = true).
nfAPIfalseThe instantiation for graphical editors (omc's API): array bindings stay bindings, a Boolean is accepted as a Real, DynamicSelect(static, dynamic) becomes static.
nfAPIDynamicSelectfalseWith nfAPI: keeps DynamicSelect(static, dynamic).
execstatfalsePrints the time and the allocations of each phase: Execstat <phase> -> time: ... and <phase>: <s> seconds (...).
failtracefalsePrints the function calls that could not be evaluated: - NFSimplifyExp.simplifyCall failed to evaluate h(2.0).
cgraphfalsePrints the connection graph of overconstrained connectors: - addConnection(a.r, b.r), the roots, the broken connections.
nfDumpFlatfalseWrites the flat model after each phase to <temp>/OMJL/<pid>_<time>/frontend/flat/<model>_<phase>.mo (also enableDumpDebug).

Each translation sets nfScalarize, nfExpandOperations and nfExpandFuncArgs from instantiate's argument scalarize, and nfSeparateInstantiation from instantiateSCodeToFM's argument separateInstantiation; setFlags refuses them.

Options

FlagDefaultEffect
std"latest"The Modelica version: "1.x", "2.x", "3.0" to "3.6", "latest", "experimental". "experimental" allows promote.
flowThreshold1.0e-7The smallest flow rate in the mixing equations of inStream: OMCPositiveMax(-m, flowThreshold).
evalLoopLimit100000The most loop iterations in the evaluation of a function call; beyond it the call stays in the model.
evalRecursionLimit256The deepest recursion in the evaluation of a function call; beyond it the call stays in the model.
allowNonStandardModelica[]Non-standard Modelica to accept: "nonStdEnumerationAsIntegers", "nonStdTopLevelOuter", "reinitInAlgorithms", "implicitParameterStartAttribute", "illegalConditionalContext".
ignoreCommandLineOptionsAnnotationfalseIgnores a class's __OpenModelica_commandLineOptions annotation (which sets options, such as --allowNonStandardModelica=..., for that class).
loadMissingLibrariestrueLoads the Modelica Standard Library when a model refers to Modelica without loading it.

Environment variables

Read when OMFrontend loads.

VariableDefaultEffect
OMFRONTEND_PARALLEL_INSTtrueInstantiates sibling components in parallel when Julia has threads.
OMFRONTEND_CACHE_INSTtrueInstantiates a class once for its identical scalar components, within one translation.
OMFRONTEND_NO_PRECOMPILE_WORKLOADunsetSet: precompilation runs no models (OM.jl sets it; its own workload runs the frontend).