-
Notifications
You must be signed in to change notification settings - Fork 7
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
Fast interactions #84
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… results in large speedups, especially for CPU only code. Also, when doing interactions, iterate through the infectious agents first, which is also faster, since most agents will be susceptible and fewer will be infectious. This requires atomic multiply for the prob_ptr for GPUs.
…ed extra AOS attribute from agents
…'t bin smaller than a community, but doing infectious then susceptible still helps performance
…od? Work or home?
… work, home, school and nborhood. Much simpler code now.
…on-group in nborhood interactions.
Switched binning policy from GPU to Serial, in order to preserve reproducibility for a given random seed. Commented out the generic interaction model, which is never used.
…that is the only place it is used and it will be replaced soon.
…duction, and only do it once.
Save the DenseBins for interactions to member of the interaction model. Have an option to reuse without rebuilding. This is disabled at the moment because Redistribute changes the ordering of particles.
…ation and slow. Currently this only switches between a serial and a GPU binning policy.
… home (school is not yet done). These implemenations count the number of infected in each category, and so avoid the n-squared computation.
…nteractions-bin-by-workgroup branch.
…e needed for contact tracing. The default is fast interactions, and the choice of implemenation is controlled by a #define.
Hi @stevenhofmeyr - thanks! I've tried this out and it works great. This also supersedes #82, so I'll merge this and then close that one as well. |
atmyers
approved these changes
Sep 27, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implements very fast interactions by counting the number of infected agents in each group, and using that number as the exponent to calculate the probability. This means it only has to traverse the list of agents once, instead of doing the n^2 approach used in binning. The downside is that it may be more difficult to do contact tracing. For this reason, it also integrates the binning approach used in branch
interactions-bin-by-workgroup
, keeping it as a compile time option.