Logging

Logging

ModiaMath.LoggingModule.
module ModiaMath.Logger

Log model evaluations.

Main developer

Martin Otter, DLR - Institute of System Dynamics and Control

source
mutable struct Logger - Log model evaluations
source
mutable struct SimulationStatistics - Collect statistics of the last simulation run.

The following data is stored in this structure:

  • structureOfDAE: Structure of DAE
  • cpuTimeInitialization: CPU-time for initialization
  • cpuTimeIntegration: CPU-time for integration
  • startTime: start time of the integration
  • stopTime: stop time of the integration
  • interval: communication interval of the integration
  • tolerance: relative tolerance used for the integration
  • nEquations: number of equations (length of y and of yp)
  • nConstraints: number of constraint equations
  • nResults: number of time points stored in result data structure
  • nSteps: number of (successful) steps
  • nResidues: number of calls to compute residues (includes residue calls for Jacobian)
  • nZeroCrossing: number of calls to compute zero crossings
  • nJac: number of calls to compute Jacobian
  • nTimeEvents: number of time events
  • nRestartEvents: number of events with integrator restart
  • nErrTestFails: number of fails of error tests
  • h0: stepsize used at the first step
  • hMin: minimum integration stepsize
  • hMax: maximum integration stepsize
  • orderMax: maximum integration order
  • sparseSolver = true: if sparse solver used, otherwise dense solver
  • nGroups: if sparseSolver, number of column groups to compute Jacobian (e.g. if nEquations=100, nGroups=5, then 5+1=6 model evaluations are needed to compute the Jacobian numerically, instead of 101 model evaluations without taking the sparseness structure into account).
source
ModiaMath.isLogEvents(obj)

Return true, if logger settings require to print event messages of the model (obj must be of type ModiaMath.SimulationState, ModiaMath.AbstractSimulationModel, or ModiaMath.Logger).

source
ModiaMath.isLogInfos(obj)

Return true, if logger settings require to print info messages of the model (obj must be of type ModiaMath.SimulationState, ModiaMath.AbstractSimulationModel, or ModiaMath.Logger).

source
ModiaMath.isLogProgress(logger::ModiaMath.Logger)

Return true, if logger settings require to print progress messages of the model

source
ModiaMath.isLogStatistics(logger::ModiaMath.Logger)

Return true, if logger settings require to print statistics messages of the model.

source
ModiaMath.isLogWarnings(obj)

Return true, if logger settings require to print warning messages of the model (obj must be of type ModiaMath.SimulationState, ModiaMath.AbstractSimulationModel, or ModiaMath.Logger).

source
ModiaMath.logOff!(obj)

Disable logging on obj (of type ModiaMath.SimulationState, ModiaMath.AbstractSimulationModel, or ModiaMath.Logger)

source
ModiaMath.logOn!(obj)

Enable logging on obj (of type ModiaMath.SimulationState, ModiaMath.AbstractSimulationModel, or ModiaMath.Logger)

source
ModiaMath.setLogCategories!(obj, categories; reinit=true)

Set log categories on obj (of type ModiaMath.SimulationState, ModiaMath.AbstractSimulationModel, or ModiaMath.Logger) as vector of symbols, e.g. setLogCategories!(simulationModel, [:LogProgess]). Supported categories:

  • :LogStatistics, print statistics information at end of simulation
  • :LogProgress, print progress information during simulation
  • :LogInfos, print information messages of the model
  • :LogWarnings, print warning messages of the model
  • :LogEvents, log events of the model

If option reinit=true, all previous set categories are reinitialized to be no longer present. If reinit=false, previously set categories are not changed.

source