Add pair list to SPAM pure water calc and properly image distances #539
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.
This PR started out as an enhancement but ended up being a bug fix as well.
The
purewater
calculation for the SPAM action was very time-consuming since it scaled O(N^2). This PR improves the speed of this calculation by using a pair list. Note thatpurewater
is no longer OpenMP parallelized; however, the speedup from the pair list is such that even vs 4 threads with the old code the new code is almost 2x as fast (not taking into account the imaging issue detailed in the next paragraph).In the course of testing the new pair list implementation, inconsistencies with results from the old code revealed that distances were not being imaged. The problem was that the ImagedAction class was being employed but not properly set up in
Action_Spam::Setup
, resulting in the non-imaged distance always being used. Now the minimum imaged distance is actually used throughout Action_Spam and the test results have been updated to reflect this.Also includes general code cleanup of Action_Spam and removal of a test file that should not have been tracked.