Skip to content
This repository has been archived by the owner on May 18, 2019. It is now read-only.

Commit

Permalink
Correct logging for FMUs and IDA
Browse files Browse the repository at this point in the history
  • Loading branch information
rfranke authored and OpenModelica-Hudson committed Nov 14, 2016
1 parent b6a7a6d commit a4e7088
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion SimulationRuntime/cpp/Include/FMU/FMUWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ class FMUWrapper : public IFMUInterface
virtual fmiStatus initialize(fmiBoolean toleranceControlled, fmiReal relativeTolerance, fmiEventInfo& eventInfo)
{
//LOGGER_WRITE("Initialize",LC_OTHER,LL_DEBUG);
Logger::write("Initializing memory and variables", LC_MOD, LL_DEBUG);
Logger::write("Initializing memory and variables", LC_MODEL, LL_DEBUG);
_model->initializeMemory();
_model->initializeFreeVariables();
_model->initializeBoundVariables();
Expand Down
4 changes: 2 additions & 2 deletions SimulationRuntime/cpp/Include/FMU2/FMU2Wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ void FMU2Logger::writeInternal(string msg, LogCategory cat, LogLevel lvl,
case LC_NLS:
category = logNonlinearSystems;
break;
case LC_EVT:
case LC_EVENTS:
category = logEvents;
break;
}
Expand Down Expand Up @@ -160,7 +160,7 @@ fmi2Status FMU2Wrapper::setDebugLogging(fmi2Boolean loggingOn,
_logCategories &= ~(1 << j);
switch (j) {
case logEvents:
_logger->set(LC_EVT, loggingOn? LL_DEBUG: LL_ERROR);
_logger->set(LC_EVENTS, loggingOn? LL_DEBUG: LL_ERROR);
break;
case logNonlinearSystems:
_logger->set(LC_NLS, loggingOn? LL_DEBUG: LL_ERROR);
Expand Down
12 changes: 6 additions & 6 deletions SimulationRuntime/cpp/Solver/IDA/IDA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1073,12 +1073,12 @@ void Ida::writeSimulationInfo()

flag = IDAGetNonlinSolvStats(_idaMem, &nni, &ncfn);

LOGGER_WRITE("Cvode: number steps = " + to_string(nst), LC_SOLVER, LL_INFO);
LOGGER_WRITE("Cvode: function evaluations 'f' = " + to_string(nfe), LC_SOLVER, LL_INFO);
LOGGER_WRITE("Cvode: error test failures 'netf' = " + to_string(netfS), LC_SOLVER, LL_INFO);
LOGGER_WRITE("Cvode: linear solver setups 'nsetups' = " + to_string(nsetups), LC_SOLVER, LL_INFO);
LOGGER_WRITE("Cvode: nonlinear iterations 'nni' = " + to_string(nni), LC_SOLVER, LL_INFO);
LOGGER_WRITE("Cvode: convergence failures 'ncfn' = " + to_string(ncfn), LC_SOLVER, LL_INFO);
LOGGER_WRITE("IDA: number steps = " + to_string(nst), LC_SOLVER, LL_INFO);
LOGGER_WRITE("IDA: function evaluations 'f' = " + to_string(nfe), LC_SOLVER, LL_INFO);
LOGGER_WRITE("IDA: error test failures 'netf' = " + to_string(netfS), LC_SOLVER, LL_INFO);
LOGGER_WRITE("IDA: linear solver setups 'nsetups' = " + to_string(nsetups), LC_SOLVER, LL_INFO);
LOGGER_WRITE("IDA: nonlinear iterations 'nni' = " + to_string(nni), LC_SOLVER, LL_INFO);
LOGGER_WRITE("IDA: convergence failures 'ncfn' = " + to_string(ncfn), LC_SOLVER, LL_INFO);
}

int Ida::check_flag(void *flagvalue, const char *funcname, int opt)
Expand Down

0 comments on commit a4e7088

Please sign in to comment.