ReactionMechanismGenerator / ReactionMechanismSimulator.jl

The amazing Reaction Mechanism Simulator for simulating large chemical kinetic mechanisms
https://reactionmechanismgenerator.github.io/ReactionMechanismSimulator.jl
MIT License
74 stars 33 forks source link

Optimize Threaded Sensitivities #251

Closed mjohnson541 closed 7 months ago

mjohnson541 commented 7 months ago

This PR 1) Keeps us to one deepcopy of Reactor per thread, speeding up solution 2) Greatly improves the speed of combining the solutions into one solution object (in fact this seems to have accidentally been the slowest operation before so I've seen this result in ~4-5x speed up overall) 3) Newer versions of julia do not seem to be happy with multiple threads modifying the same dictionary causing the operation to crash so this PR switches to using a vector instead to store solutions

codecov[bot] commented 7 months ago

Codecov Report

Attention: Patch coverage is 47.91667% with 25 lines in your changes are missing coverage. Please review.

Project coverage is 48.71%. Comparing base (a4ee101) to head (d86a2b8).

Files Patch % Lines
src/ThreadedSensitivities.jl 47.91% 25 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #251 +/- ## ========================================== - Coverage 48.93% 48.71% -0.22% ========================================== Files 31 31 Lines 8301 8313 +12 ========================================== - Hits 4062 4050 -12 - Misses 4239 4263 +24 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.