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

Properly clear state counters and data for reuse #1367

Merged
merged 1 commit into from
Aug 16, 2024

Conversation

amandalund
Copy link
Contributor

This fixes an unsual case for celer-sim when multiple events are run one at a time on a single stream and max_steps is specified (unlikely to be done in practice, but how we run our CPU app test). Because the core state counters, track status, and vacancies are not reset between events, stale state data is reused in the next event. This adds a helper method to reset the state data, as well as:

  • Add a generic function to fill a collection with a sequence
  • Move track shuffle utils to global/detail
  • Remove unecessary initialization from the sim state

@amandalund amandalund added bug Something isn't working app Application front ends labels Aug 16, 2024
@amandalund amandalund requested review from sethrj and esseivaju August 16, 2024 04:04
* Add a helper method to reset state data
* Add a generic function to fill a collection with a sequence
* Move track shuffle util to global/detail
Copy link
Member

@sethrj sethrj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch, thanks for the refactoring!

@sethrj sethrj merged commit 1e4aa73 into celeritas-project:develop Aug 16, 2024
29 checks passed
@amandalund amandalund deleted the fix-state-reuse branch August 16, 2024 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app Application front ends bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants