Unverified Commit b6e79d4a authored by peastman's avatar peastman Committed by GitHub
Browse files

Merge pull request #2287 from peastman/groups

Improved performance of interaction groups on CPU
parents 7ada5dd0 b26b74c0
......@@ -173,10 +173,9 @@ void CpuCustomNonbondedForce::threadComputeForce(ThreadPool& threads, int thread
if (useInteractionGroups) {
// The user has specified interaction groups, so compute only the requested interactions.
while (true) {
int i = atomicCounter++;
if (i >= groupInteractions.size())
break;
int start = threadIndex*groupInteractions.size()/numThreads;
int end = (threadIndex+1)*groupInteractions.size()/numThreads;
for (int i = start; i < end; i++) {
int atom1 = groupInteractions[i].first;
int atom2 = groupInteractions[i].second;
for (int j = 0; j < (int) paramNames.size(); j++) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment