Repository navigation
Improve the speed of imaged distance calculations. Check for duplicate atom names in residues. - #1198
Merged
Merged
Conversation
…s speed about 8% (measured with RDF action). Improve speed of nonortho calcs by using Dist_Imaged routines.
…tter for nonortho.
…ll the time. Use Dcalc for BY_SITE
… includes missing revision bumps from previous PRs: 7.12.4 : TIMatch 7.12.3 : Inline common distance routines 7.12.2 : Optimize two-mask radial calculation for orthogonal cells 7.12.1 : Optimize radial calculation for orthogonal cells
…ermine if atom is unique
added 2 commits
October 16, 2026 14:48
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Version 7.12.5. Note that this revision increase also takes into account missing revision bumps from previous PRs:
7.12.4 : TIMatch #1193
7.12.3 : Inline common distance routines #1197
7.12.2 : Optimize two-mask radial calculation for orthogonal cells #1196
7.12.1 : Optimize radial calculation for orthogonal cells #1195
Inspired by the previous pull requests which have improved the speed of the
radialcommand with orthogonal shells, I have refactored some of the distance calculations to further improve speed inradialfor non-orthogonal cells and for other commands using imaged distance calculations in general.Most benchmarks have remained at the previous performance (0.98x - 1.00x speedup). However, several benchmarks have improved from this PR:
In particular the non-orthogonal imaging in the
radialcommand has been sped up almost 2x.A new class
Dcalchas been created which is intended to be used when multiple distances will be calculated in a single frame. Currently it is only used byradialbut probably should be put anywhere multiple distances are being calculated. For non-orthogonal images, it uses the same logic employed inDist_Imaged.cppto cut down the number of images that need to be checked.The
DIST2_ImageNonOrtho()functions now just call the improved distance routine for non-orthogonal cells fromDist_Imaged.cpp(Cpptraj::Dist2_Imaged_Cart()). The results are identical.This PR also adds a check for duplicate atom names in residues when topologies are loaded/created since this can lead to unexpected behavior (e.g. typically one expects the mask
:1@CAto select a single atom.