|
FhSim
3.1.0
Marine systems simulation
|
| ID | 0167 |
| Class | KNOWN-LIMITATION |
| Severity | 1 |
| Status | ready |
Models: —
Found: 2026-10-25 implementation of r2-run-status (follow-up of FHSIM-0160)
Ruling (owner, 2026-10-25): a model stop in an FMU reports terminated. FMI 2: fmi2DoStep returns fmi2Discard and fmi2GetBooleanStatus(fmi2Terminated) is true. FMI 3: terminateSimulation = true. A separate later change.
FhsimSlaveCoreStep.cpp DoStep: after FHSIM-0160 a model stop ends the engine step early without an exception, so fpSimulate answers true with reached < requested; ThrowIfContextFailed_ finds no recorded exception and the step is reported as a short step (Discard, with the warning "FhSim failed to perform step...").
A master sees a Discard and may retry the step; the engine does not step further, so the retry reaches the same time. The master is not told that the model wants the simulation to end.
Detect the stop in the DLL context (a flag set where FhSim::Step returns after SimulationStopRequested) and report it through the FMI terminate status in the FMI 2 and FMI 3 wrappers.
An FMU of a model that calls Exit; the step answers the terminate status.
Masters differ in how they treat the terminate status.