Repository navigation
Inline common distance routines - #1197
Merged
Merged
Conversation
Contributor
|
That's funny, I actually have a branch I'm working on that implements something similar. I'll just merge this for now in the meantime. |
Contributor
|
@whahnsr If you would like me to add your name and affiliation to the cpptraj README, let me know. |
Contributor
Author
|
Hello Daniel,
Yes I would very much like to get copies of the cpptraj README.
My real name is Werner Hahn, and I am an independent consultant.
Most of my previous career was devoted to optimizing and porting software
to all kinds of platforms.
I got a PhD in Chemical Engineering from the University of Arizona in 1979
(yes I am old).
The highlights of my works was in Reservoir Simulation with Exxon and Saudi
Aramco. I did porting and optimization with Kendall Square Research and
Hewlett Packard.
I decided to keep busy in retirement by running around GitHub and finding
packages where developers welcome outside development of their packages. I
came across cpptraj and hopefully contributed a little bit to the
development of the program. I did this with help from ChatGpt that can read
code and analyze it infinitely faster than I can. But the final decision of
what to do and how much to do was always mine.
Looking forward to keeping in touch with cpptraj,
Werner
…On Wed, Oct 14, 2026 at 11:47 AM Daniel R. Roe ***@***.***> wrote:
*drroe* left a comment (Amber-MD/cpptraj#1197)
<#1197 (comment)>
@whahnsr <https://github.com/whahnsr> If you would like me to add your
name and affiliation to the cpptraj README, let me know.
—
Reply to this email directly, view it on GitHub
<#1197?email_source=notifications&email_token=CPA2VLUVSU4VUOEZKZYSS3T5T7C35A5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTMMJXGU3TONJSGEZ2M4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJLDGN5XXIZLSL5RWY2LDNM#issuecomment-6175775213>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/CPA2VLW6G57RUEG5UHDFSYT5T7C35AVCNFSNUABEKJSXA33TNF2G64TZHMZDOOBSHAYDSNZ3JFZXG5LFHM2TQNBQGY3TQNJYGSQXMAQ>
.
Triage notifications, keep track of coding agent tasks and review pull
requests on the go with GitHub Mobile for iOS
<https://github.com/notifications/mobile/ios/CPA2VLS5PJC23G72LD3MPAD5T7C35A5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTMMJXGU3TONJSGEZ2M4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJKTGN5XXIZLSL5UW64Y>
and Android
<https://github.com/notifications/mobile/android/CPA2VLXWYJ77UGCIFLU5W6L5T7C35A5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTMMJXGU3TONJSGEZ2M4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJLTGN5XXIZLSL5QW4ZDSN5UWI>.
Download it today!
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Contributor
|
I've added some details to the README, see #1203 Let me know if you'd like anything changed. Thanks again for your contributions! -Dan |
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.
Summary
Inline the common pointer-based distance routines in
DistRoutines.h:DIST2()DIST2_ImageOrtho()DIST2_NoImage()For orthogonal imaging, cache the three box lengths and use
std::fabs()for coordinate differences.This follows the suggestion in #1196 to refactor the common distance routines so Actions beyond
Action_Radialcan benefit from the same optimization.Performance
Tested with
Action_MinMaxDistusing the 11,670-atom orthogonal trajectory fromTest_AutoImage.The benchmark evaluates approximately 170 million pair distances over 5 frames.
Five serial runs with
OMP_NUM_THREADS=1:Baseline user times:
1.26, 1.24, 1.25, 1.25, 1.24 s
Baseline mean:
1.248 s
Optimized user times:
0.92, 0.92, 0.93, 0.92, 0.92 s
Optimized mean:
0.922 s
CPU time reduction:
26.1%
Speedup:
approximately 1.35x
Before the change, perf showed:
DIST2_ImageOrtho(): 56.71%DIST2(): 18.07%After inlining, those routines no longer appear as separate hot symbols; their work is folded into the calling
Action_MinMaxDistroutine.Validation
The MinMaxDist benchmark output was byte-for-byte identical between baseline and optimized builds.
Regression tests:
Test_MinMaxDist: 6/6 comparisons passedTest_Distance: 5/5 comparisons passedTest_Radial: 17/17 comparisons passedgit diff --checkreports no whitespace errors.