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

Parallelize matrix simplification #1778

Merged
merged 10 commits into from
Aug 20, 2022
Merged

Parallelize matrix simplification #1778

merged 10 commits into from
Aug 20, 2022

Conversation

dweindl
Copy link
Member

@dweindl dweindl commented Apr 8, 2022

Allow for optional parallelization of sympy matrix simplification using multiprocessing. Number of processes is controlled via environment variable AMICI_IMPORT_NPROCS.

This only helps for larger models and may slow down import of smaller models slightly.

Benchmarking (only code generation; derivatives computed sequentially in both cases):

  • 1 process: 2:26:19 (h:mm:ss) (100%)
  • 4 processes: 1:53:01 (h:mm:ss) (78%)

@codecov
Copy link

codecov bot commented Apr 8, 2022

Codecov Report

Merging #1778 (53b5785) into develop (717851b) will decrease coverage by 10.15%.
The diff coverage is 33.33%.

Impacted file tree graph

@@             Coverage Diff              @@
##           develop    #1778       +/-   ##
============================================
- Coverage    76.33%   66.17%   -10.16%     
============================================
  Files           74       30       -44     
  Lines        12836     4722     -8114     
============================================
- Hits          9798     3125     -6673     
+ Misses        3038     1597     -1441     
Flag Coverage Δ
cpp ?
petab 59.30% <38.88%> (-0.11%) ⬇️
python ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
python/amici/sbml_import.py 89.42% <ø> (-4.40%) ⬇️
python/amici/ode_export.py 88.71% <33.33%> (-4.20%) ⬇️
python/amici/bngl_import.py 0.00% <0.00%> (-100.00%) ⬇️
python/amici/pandas.py 11.62% <0.00%> (-86.63%) ⬇️
python/amici/conserved_quantities_demartino.py 0.00% <0.00%> (-65.56%) ⬇️
python/amici/testing.py 0.00% <0.00%> (-50.00%) ⬇️
python/amici/swig_wrappers.py 59.32% <0.00%> (-35.60%) ⬇️
python/amici/import_utils.py 52.79% <0.00%> (-34.79%) ⬇️
python/amici/pysb_import.py 60.47% <0.00%> (-34.14%) ⬇️
python/amici/numpy.py 65.21% <0.00%> (-17.40%) ⬇️
... and 53 more

@dweindl dweindl force-pushed the feature_parallel_simplify branch from 8e51804 to b80d997 Compare April 28, 2022 13:42
@sonarqubecloud
Copy link

sonarqubecloud bot commented May 5, 2022

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

41.2% 41.2% Coverage
0.0% 0.0% Duplication

@dweindl dweindl requested a review from FFroehlich August 20, 2022 15:12
@dweindl dweindl marked this pull request as ready for review August 20, 2022 15:12
Copy link
Member

@FFroehlich FFroehlich left a comment

Choose a reason for hiding this comment

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

Nice! Would be nice to add some documentation on the respective environment variable.

@dweindl dweindl merged commit f4e9f31 into develop Aug 20, 2022
@dweindl dweindl deleted the feature_parallel_simplify branch August 20, 2022 18:16
@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

38.9% 38.9% Coverage
0.0% 0.0% Duplication

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