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

Improve libdcd cython #3888

Merged
merged 42 commits into from
Nov 29, 2022
Merged

Conversation

hmacdope
Copy link
Member

@hmacdope hmacdope commented Oct 27, 2022

Fixes #3882 #3923

Improves the cython in the DCD reader to be more compiled.

Changes made in this Pull Request:

  • Improves the cython in the DCD reader.

PR Checklist

  • Tests?
  • Docs?
  • CHANGELOG updated?
  • Issue raised/referenced?

@@ -191,7 +191,7 @@ def _read_next_timestep(self, ts=None):
if ts is None:
# use a copy to avoid that ts always points to the same reference
# removing this breaks lammps reader
ts = self.ts.copy()
ts = self.ts.copy() # why is this copy required ??
Copy link
Member Author

Choose a reason for hiding this comment

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

@orbeckst @MDAnalysis/coredevs does anyone know specifically why this copy is required? None of the other readers use this pattern and it is ~30% overhead but removing it breaks a bunch of tests. I will keep working on it but if anyone has a quick answer would be appreciated.

Copy link
Member Author

@hmacdope hmacdope Oct 27, 2022

Choose a reason for hiding this comment

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

I will keep working on it in the meantime but the behaviour seems to be inconsistent with the other readers.

Copy link
Member Author

Choose a reason for hiding this comment

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

I am going to move discussion to an issue.

Copy link
Member Author

Choose a reason for hiding this comment

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

Moved to #3889

@hmacdope hmacdope added the CZI-performance performance track of CZIEOSS4 grant label Oct 27, 2022
@codecov
Copy link

codecov bot commented Oct 27, 2022

Codecov Report

Base: 94.36% // Head: 94.39% // Increases project coverage by +0.03% 🎉

Coverage data is based on head (64ad08a) compared to base (497f45e).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3888      +/-   ##
===========================================
+ Coverage    94.36%   94.39%   +0.03%     
===========================================
  Files          194      194              
  Lines        25109    25146      +37     
  Branches      3398     3398              
===========================================
+ Hits         23694    23737      +43     
+ Misses        1366     1360       -6     
  Partials        49       49              
Impacted Files Coverage Δ
package/MDAnalysis/coordinates/DCD.py 100.00% <100.00%> (ø)
package/MDAnalysis/lib/formats/libdcd.pyx 91.11% <100.00%> (+2.58%) ⬆️
package/MDAnalysis/coordinates/base.py 94.78% <0.00%> (+0.17%) ⬆️
MDAnalysisTests/coordinates/base.py 94.42% <0.00%> (+0.17%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Member

@orbeckst orbeckst left a comment

Choose a reason for hiding this comment

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

Looking fine. Just minor question and

  • docs (versionchanged)
  • Changelog update

thanks.

package/MDAnalysis/coordinates/DCD.py Show resolved Hide resolved
package/CHANGELOG Outdated Show resolved Hide resolved
@orbeckst
Copy link
Member

orbeckst commented Oct 28, 2022

@hmacdope for my first review I only saw one set of changes. You clearly have a change log entry. For other things I just added comments. (Sorry for bad typing, reviewing from phone is not ideal)

package/setup.cfg Outdated Show resolved Hide resolved
testsuite/MDAnalysisTests/coordinates/base.py Outdated Show resolved Hide resolved
package/MDAnalysis/coordinates/DCD.py Outdated Show resolved Hide resolved
package/setup.cfg Outdated Show resolved Hide resolved
@hmacdope hmacdope added this to the Release 3.0 milestone Oct 28, 2022
Copy link
Member

@richardjgowers richardjgowers left a comment

Choose a reason for hiding this comment

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

@hmacdope can probably use a shared scratch buffer. You can raise an issue about deprecating that timeseries helper method

Copy link
Member

@orbeckst orbeckst left a comment

Choose a reason for hiding this comment

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

only minimal doc/changelog updates — please do them but I'll approve as to not hold up

package/CHANGELOG Outdated Show resolved Hide resolved
package/MDAnalysis/coordinates/DCD.py Outdated Show resolved Hide resolved
@hmacdope
Copy link
Member Author

@hmacdope can probably use a shared scratch buffer. You can raise an issue about deprecating that timeseries helper method

Performance improvement of ~ 12% with use of shared scratch buffer

image

@hmacdope
Copy link
Member Author

Windows C++ compiler seems to be complaining about libdcd, I'll revert it back to compiling as C sometime tommorow.

@hmacdope
Copy link
Member Author

hmacdope commented Nov 24, 2022

@MDAnalysis/coredevs I think we are good to roll here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

Improve deprecation warning for DCDReader copying timestep Improve DCD reader typing and performance.
5 participants