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

Fast interactions #84

Merged
merged 41 commits into from
Sep 27, 2024
Merged

Fast interactions #84

merged 41 commits into from
Sep 27, 2024

Conversation

stevenhofmeyr
Copy link
Collaborator

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.

stevenhofmeyr and others added 30 commits September 5, 2024 14:27
… 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.
…'t bin smaller than a community, but doing infectious then susceptible still helps performance
… work, home, school and nborhood. Much simpler code now.
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.
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.
@atmyers
Copy link
Member

atmyers commented Sep 27, 2024

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 atmyers merged commit 334a416 into development Sep 27, 2024
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants