Skip to content

Commit 65041cb

Browse files
committed
- fix a debug-message
- add some additional TRACE information git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@20765 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
1 parent 419d793 commit 65041cb

File tree

4 files changed

+32
-3
lines changed

4 files changed

+32
-3
lines changed

SimulationRuntime/c/simulation/options.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ int checkCommandLineArguments(int argc, char **argv)
6868
debugStreamPrint(LOG_STDOUT, 0, "%s", argv[i]);
6969
messageClose(LOG_STDOUT);
7070

71-
debugStreamPrint(LOG_STDOUT, 0, "interpreted command line options");
71+
debugStreamPrint(LOG_STDOUT, 1, "interpreted command line options");
7272
#endif
7373

7474
for(i=1; i<argc; ++i)
@@ -125,11 +125,19 @@ int checkCommandLineArguments(int argc, char **argv)
125125
}
126126
}
127127

128-
if(!found) {
128+
if(!found)
129+
{
130+
#ifdef USE_DEBUG_OUTPUT
131+
messageClose(LOG_STDOUT);
132+
#endif
129133
warningStreamPrint(LOG_STDOUT, 0, "invalid command line option: %s", argv[i]);
130134
return 1;
131135
}
132136
}
137+
138+
#ifdef USE_DEBUG_OUTPUT
139+
messageClose(LOG_STDOUT);
140+
#endif
133141

134142
return 0;
135143
}

SimulationRuntime/c/simulation/simulation_runtime.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,8 @@ void initializeOutputFilter(MODEL_DATA *modelData, modelica_string variableFilte
425425
*/
426426
int startNonInteractiveSimulation(int argc, char**argv, DATA* data)
427427
{
428+
TRACE_PUSH
429+
428430
int retVal = -1;
429431
int measureSimTime = 0;
430432

@@ -585,6 +587,7 @@ int startNonInteractiveSimulation(int argc, char**argv, DATA* data)
585587
retVal = printModelInfoJSON(data, jsonInfo.c_str(), result_file_cstr.c_str()) && retVal;
586588
}
587589

590+
TRACE_POP
588591
return retVal;
589592
}
590593

@@ -654,9 +657,14 @@ int callSolver(DATA* simData, string result_file_cstr, string init_initMethod,
654657
long i;
655658
long solverID = S_UNKNOWN;
656659
const char* outVars = (outputVariablesAtEnd.size() == 0) ? NULL : outputVariablesAtEnd.c_str();
660+
661+
TRACE_PUSH
657662

658663
if(initializeResultData(simData, result_file_cstr, cpuTime))
664+
{
665+
TRACE_POP
659666
return -1;
667+
}
660668

661669
if(std::string("") == simData->simulationInfo.solverMethod)
662670
solverID = S_DASSL;
@@ -697,6 +705,7 @@ int callSolver(DATA* simData, string result_file_cstr, string init_initMethod,
697705

698706
sim_result.free(&sim_result, simData);
699707

708+
TRACE_POP
700709
return retVal;
701710
}
702711

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -984,13 +984,19 @@ int initialization(DATA *data, const char* pInitMethod, const char* pOptiMethod,
984984
int optiMethod = IOM_NELDER_MEAD_EX; /* default method */
985985
int retVal = -1;
986986
int i;
987+
988+
TRACE_PUSH
987989

988990
infoStreamPrint(LOG_INIT, 0, "### START INITIALIZATION ###");
989991

990992
/* import start values from extern mat-file */
991-
if(pInitFile && strcmp(pInitFile, "")) {
993+
if(pInitFile && strcmp(pInitFile, ""))
994+
{
992995
if(importStartValues(data, pInitFile, initTime))
996+
{
997+
TRACE_POP
993998
return 1;
999+
}
9941000
}
9951001

9961002
/* set up all variables and parameters with their start-values */
@@ -1099,5 +1105,6 @@ int initialization(DATA *data, const char* pInitMethod, const char* pOptiMethod,
10991105
data->callback->function_updateRelations(data, 1);
11001106

11011107
/* valid system for the first time! */
1108+
TRACE_POP
11021109
return retVal;
11031110
}

SimulationRuntime/c/simulation/solver/solver_main.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,8 @@ int solver_main(DATA* data, const char* init_initMethod,
523523
SOLVER_INFO solverInfo;
524524
SIMULATION_INFO *simInfo = &(data->simulationInfo);
525525

526+
TRACE_PUSH
527+
526528
solverInfo.solverMethod = solverID;
527529

528530
/* do some solver specific checks */
@@ -545,12 +547,14 @@ int solver_main(DATA* data, const char* init_initMethod,
545547
case S_LOBATTO4:
546548
case S_LOBATTO6:
547549
warningStreamPrint(LOG_STDOUT, 0, "Sundial/kinsol is needed but not available. Please choose other solver.");
550+
TRACE_POP
548551
return 1;
549552
#endif
550553

551554
#ifndef WITH_IPOPT
552555
case S_OPTIMIZATION:
553556
warningStreamPrint(LOG_STDOUT, 0, "Ipopt is needed but not available.");
557+
TRACE_POP
554558
return 1;
555559
#endif
556560

@@ -590,6 +594,7 @@ int solver_main(DATA* data, const char* init_initMethod,
590594
/* free SolverInfo memory */
591595
freeSolverData(data, &solverInfo);
592596

597+
TRACE_POP
593598
return retVal;
594599
}
595600

0 commit comments

Comments
 (0)