Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Events are evaluated in multiple LPs #38

Closed
joaquinffernandez opened this issue Feb 10, 2020 · 0 comments
Closed

Events are evaluated in multiple LPs #38

joaquinffernandez opened this issue Feb 10, 2020 · 0 comments
Assignees
Labels

Comments

@joaquinffernandez
Copy link
Collaborator

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.

Original issue: https://github.com/CIFASIS/qss-solver-engine/issues/34

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant