Skip to content

Commit 27d4fab

Browse files
ptaeuberOpenModelica-Hudson
authored andcommitted
Fix init message for FMI
Belonging to [master]: - OpenModelica/OMCompiler#1979 - OpenModelica/OpenModelica-testsuite#762
1 parent bb335c6 commit 27d4fab

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

SimulationRuntime/c/simulation/solver/initialization/initialization.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,6 @@ static int symbolic_initialization(DATA *data, threadData_t *threadData)
186186
long i;
187187
MODEL_DATA *mData = data->modelData;
188188
int solveWithGlobalHomotopy = data->callback->useHomotopy == 0 || (data->callback->useHomotopy != 2 && init_lambda_steps < 2) ? 0 : 1;
189-
data->simulationInfo->homotopyUsed = 0;
190189

191190
#if !defined(OMC_NDELAY_EXPRESSIONS) || OMC_NDELAY_EXPRESSIONS>0
192191
/* initial sample and delay before initial the system */
@@ -309,9 +308,6 @@ static int symbolic_initialization(DATA *data, threadData_t *threadData)
309308
/* check for over-determined systems */
310309
retVal = data->callback->functionRemovedInitialEquations(data, threadData);
311310

312-
if (!retVal)
313-
infoStreamPrint(LOG_SUCCESS, 0, "The initialization finished successfully %s homotopy method.", data->simulationInfo->homotopyUsed ? "with" : "without");
314-
315311
TRACE_POP
316312
return retVal;
317313
}
@@ -568,6 +564,8 @@ int initialization(DATA *data, threadData_t *threadData, const char* pInitMethod
568564
int retVal = -1;
569565
int i;
570566

567+
data->simulationInfo->homotopyUsed = 0;
568+
571569
infoStreamPrint(LOG_INIT, 0, "### START INITIALIZATION ###");
572570

573571
setAllParamsToStart(data);

SimulationRuntime/c/simulation/solver/solver_main.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,8 @@ int initializeModel(DATA* data, threadData_t *threadData, const char* init_initM
465465
simInfo->stopTime = simInfo->startTime;
466466
retValue = -1;
467467
}
468+
if (!retValue)
469+
infoStreamPrint(LOG_SUCCESS, 0, "The initialization finished successfully %s homotopy method.", data->simulationInfo->homotopyUsed ? "with" : "without");
468470

469471
success = 1;
470472
#if !defined(OMC_EMCC)

0 commit comments

Comments
 (0)