Opened 6 years ago
Closed 5 years ago
#5755 closed defect (fixed)
SimulationResult does not contain promised variables when simulation fails
| Reported by: | Owned by: | Martin Sjölund | |
|---|---|---|---|
| Priority: | normal | Milestone: | NeedsInput |
| Component: | Scripts | Version: | v1.14.0 |
| Keywords: | Cc: | Martin Sjölund |
Description
The simulate script function promises to output a record that is formatted as the following:
record SimulationResult String resultFile; String simulationOptions; String messages; Real timeFrontend; Real timeBackend; Real timeSimCode; Real timeTemplates; Real timeCompile; Real timeSimulation; Real timeTotal; end SimulationResult;
However, some variables may be missing if simulation fails; then, querying such variables, makes scripts end prematurely.
Change History (7)
comment:1 by , 6 years ago
| Cc: | added |
|---|---|
| Component: | *unknown* → Run-time |
| Milestone: | Future → 2.0.0 |
| Owner: | changed from to |
comment:2 by , 6 years ago
This should be an easy fix, we just need some try/catch blocks I think, but without looking at the code you never know.
comment:3 by , 6 years ago
Adrian, it's things like the times are missing. You don't even need to use try/catch blocks.
Our scripts check for empty filename and if so, skips checking other variables.
comment:4 by , 5 years ago
Do you have an example where this happens? I only find cases that work properly, even in OMNotebook which has a special implementation for simulation results.
comment:5 by , 5 years ago
Sorry guys, I didn't save the models that was causing troubles and right now, after some months I cannot find a way to reproduce the issue...
comment:6 by , 5 years ago
| Milestone: | 2.0.0 → NeedsInput |
|---|---|
| Owner: | changed from to |
| Status: | new → assigned |
Ah, I just found an example when thinking of one more thing:
loadString("model M equation assert(time < 0.5, \"abc\"); end M;");getErrorString(); r:=simulate(M);getErrorString(); x := r.timeSimulation;
Only if the simulation itself fails, time for simulation and total time (only) are missing. If translation fails, all variables are there.
comment:7 by , 5 years ago
| Component: | Run-time → Scripts |
|---|---|
| Resolution: | → fixed |
| Status: | assigned → closed |

This is a serious issue, because it's hard to debug a model which fails if one cannot see the results. I'll mark it as a blocker for 2.0.0, maybe we can do something about it while we work on the debugger