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

DirectCR-RSSA #346

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open

DirectCR-RSSA #346

wants to merge 20 commits into from

Conversation

Vilin97
Copy link
Contributor

@Vilin97 Vilin97 commented Sep 11, 2023

A new spatial SSA called DirectCRRSSA uses RSSA-style sampling to sample the site+jump. It is about 20% faster than DirectCRDirect, at least on the problem in the test/spatial/ABC.jl (5 sites in a line, 3 species, 2 reactions).

using BenchmarkTools
@btime solve(jump_problems[1], SSAStepper()) # NSM with a `CartesianGrid`, 52ms
@btime solve(jump_problems[2], SSAStepper()) # NSM with a `Graph`, 49ms
@btime solve(jump_problems[3], SSAStepper()) # DirectCRDirect with  a `CartesianGrid`, 51ms
@btime solve(jump_problems[4], SSAStepper()) # DirectCRRSSA with a `CartesianGrid`, 42ms

@github-actions
Copy link
Contributor

Pull Request Test Coverage Report for Build 6141985002

  • 172 of 181 (95.03%) changed or added relevant lines in 8 files are covered.
  • 12 unchanged lines in 5 files lost coverage.
  • Overall coverage decreased (-0.1%) to 89.759%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/spatial/bracketing.jl 35 38 92.11%
src/spatial/rssacrdirect.jl 105 111 94.59%
Files with Coverage Reduction New Missed Lines %
src/aggregators/prioritytable.jl 1 86.86%
src/extended_jump_array.jl 1 80.52%
src/coupling.jl 2 78.18%
src/spatial/spatial_massaction_jump.jl 3 85.45%
src/spatial/directcrdirect.jl 5 87.65%
Totals Coverage Status
Change from base Build 6133295964: -0.1%
Covered Lines: 2419
Relevant Lines: 2695

💛 - Coveralls

spatial_system)
@inbounds for spec in species
update_hop_rate!(hop_rates, spec, u, site, spatial_system)
function update_hop_rates!(hop_rates::AbstractHopRates, species_vec, u, site, spatial_system)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

If species_vec is a single species, the function reduces to updating a single hop rate. So I deleted update_hop_rate!.

@Vilin97 Vilin97 marked this pull request as ready for review September 12, 2023 01:29
@Vilin97 Vilin97 changed the title [WIP] CR-RSSA DirectCR-RSSA Sep 12, 2023
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There was a very hard-to-find bug in the ordering of arguments in generate_jumps!. I fixed it here and in NSM.jl.

@coveralls
Copy link

coveralls commented Sep 12, 2023

Pull Request Test Coverage Report for Build 6180696485

  • 155 of 161 (96.27%) changed or added relevant lines in 8 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.3%) to 90.175%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/spatial/bracketing.jl 23 24 95.83%
src/spatial/directcrrssa.jl 106 111 95.5%
Totals Coverage Status
Change from base Build 6167199515: 0.3%
Covered Lines: 2423
Relevant Lines: 2687

💛 - Coveralls

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.

None yet

2 participants