You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When simulating in parallel mode using the linear scheduler, events can get evaluated in multiple LPs despite being owned by a single one. For certain models this situation may happen throughout the whole simulation, thus not only degrading performance but also possibly leading to unexpected behavior.
Steps to reproduce the bug
Compile the built-in bbal_downstairs model in parallel mode with debug flags enabled, setting Parallel to TRUE (using two LPs) and choosing the linear scheduler.
Open a debugger and place a breakpoint in the function MOD_zeroCrossing when the argument i equals 0 (i.e., the first event).
Run the simulation and continue each time the breakpoint is hit. Among the first five hits you should see that both threads are evaluating this event.
Software in use
QSS Solver v3.2 compiled from source (checked out in February, 2018)
Compiler: gcc 5.4.0
OS: Ubuntu 16.04 LTS
Other comments
When initializing the data structures for a given LP, those events assigned to it are properly evaluated (see here).
However, the remaining events are left uninitialized; their corresponding next times equal zero. Thus, they will be eventually scheduled and processed in the main integration loop.
Considering this, a proposed fix is to add an else clause to this if statement and set the nextEventTime to INF.
When simulating in parallel mode using the linear scheduler, events can get evaluated in multiple LPs despite being owned by a single one. For certain models this situation may happen throughout the whole simulation, thus not only degrading performance but also possibly leading to unexpected behavior.
Original issue: https://github.com/CIFASIS/qss-solver-engine/issues/34
The text was updated successfully, but these errors were encountered: