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

Sometimes simulator::set_xxx() is called while simulator::do_step() is still in progress #213

Closed
kyllingstad opened this issue Mar 15, 2019 · 0 comments · Fixed by #214
Closed
Assignees
Labels
bug Something isn't working

Comments

@kyllingstad
Copy link
Member

In fixed_step_algorithm::impl::do_step() we loop over all simulators and call their individual do_step() functions, storing the resulting future<step_result> objects in a container. We then loop over all simulators again, call get() on the aforementioned futures, and transfer their outgoing values.

However, in the process of transferring, we not only call the current simulator's get_xxx() functions, we also call other simulators' set_xxx() functions. We can't do that, because we may not have gotten around to calling future<step_result>.get() for some of those simulators yet, and then we don't know that their do_step() has completed.

The solution is to get all the step_results before transferring variables. Also, some asserts should be sprinkled around slave_simulator to prevent this from going unnoticed in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant