Skip to content

Commit

Permalink
[cRuntime] fix total simulation time measurement
Browse files Browse the repository at this point in the history
Belonging to [master]:
  - OpenModelica/OMCompiler#2724
  • Loading branch information
Willi Braun authored and OpenModelica-Hudson committed Oct 16, 2018
1 parent fb2861e commit ecd1fed
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion SimulationRuntime/c/simulation/simulation_info_json.c
Expand Up @@ -375,7 +375,7 @@ void modelInfoInit(MODEL_DATA_XML* xml)
#if !defined(OMC_NO_FILESYSTEM)
omc_mmap_read mmap_reader = {0};
#endif
rt_tick(0);
//rt_tick(0);
#if !defined(OMC_NO_FILESYSTEM)
if (!xml->infoXMLData) {
const char *filename;
Expand Down
1 change: 1 addition & 0 deletions SimulationRuntime/c/simulation/simulation_runtime.cpp
Expand Up @@ -416,6 +416,7 @@ int startNonInteractiveSimulation(int argc, char**argv, DATA* data, threadData_t
rt_measure_overhead(SIM_TIMER_TOTAL);
rt_clear(SIM_TIMER_TOTAL);
rt_tick(SIM_TIMER_TOTAL);
rt_clear(SIM_TIMER_PREINIT);
rt_tick(SIM_TIMER_PREINIT);
rt_clear(SIM_TIMER_OUTPUT);
rt_clear(SIM_TIMER_EVENT);
Expand Down
3 changes: 1 addition & 2 deletions SimulationRuntime/c/simulation/solver/solver_main.c
Expand Up @@ -439,7 +439,6 @@ int initializeModel(DATA* data, threadData_t *threadData, const char* init_initM
{
rt_accumulate(SIM_TIMER_PREINIT);
rt_tick(SIM_TIMER_INIT);
rt_tick(SIM_TIMER_TOTAL);
}

copyStartValuestoInitValues(data);
Expand Down Expand Up @@ -549,7 +548,7 @@ int finishSimulation(DATA* data, threadData_t *threadData, SOLVER_INFO* solverIn
infoStreamPrint(LOG_STATS, 1, "timer");
infoStreamPrint(LOG_STATS, 0, "%12gs reading init.xml", rt_accumulated(SIM_TIMER_INIT_XML));
infoStreamPrint(LOG_STATS, 0, "%12gs reading info.xml", rt_accumulated(SIM_TIMER_INFO_XML));
infoStreamPrint(LOG_STATS, 0, "%12gs pre-initialization", rt_accumulated(SIM_TIMER_PREINIT));
infoStreamPrint(LOG_STATS, 0, "%12gs [%5.1f%%] pre-initialization", rt_accumulated(SIM_TIMER_PREINIT), rt_accumulated(SIM_TIMER_PREINIT)/rt_accumulated(SIM_TIMER_TOTAL)*100.0);
infoStreamPrint(LOG_STATS, 0, "%12gs [%5.1f%%] initialization", rt_accumulated(SIM_TIMER_INIT), rt_accumulated(SIM_TIMER_INIT)/rt_accumulated(SIM_TIMER_TOTAL)*100.0);
infoStreamPrint(LOG_STATS, 0, "%12gs [%5.1f%%] steps", rt_accumulated(SIM_TIMER_STEP), rt_accumulated(SIM_TIMER_STEP)/rt_accumulated(SIM_TIMER_TOTAL)*100.0);
infoStreamPrint(LOG_STATS, 0, "%12gs [%5.1f%%] creating output-file", rt_accumulated(SIM_TIMER_OUTPUT), rt_accumulated(SIM_TIMER_OUTPUT)/rt_accumulated(SIM_TIMER_TOTAL)*100.0);
Expand Down

0 comments on commit ecd1fed

Please sign in to comment.