Commit b26b74c0 authored by Peter Eastman's avatar Peter Eastman
Browse files

Improved performance of interaction groups on CPU

parent 0ee983bc
...@@ -173,10 +173,9 @@ void CpuCustomNonbondedForce::threadComputeForce(ThreadPool& threads, int thread ...@@ -173,10 +173,9 @@ void CpuCustomNonbondedForce::threadComputeForce(ThreadPool& threads, int thread
if (useInteractionGroups) { if (useInteractionGroups) {
// The user has specified interaction groups, so compute only the requested interactions. // The user has specified interaction groups, so compute only the requested interactions.
while (true) { int start = threadIndex*groupInteractions.size()/numThreads;
int i = atomicCounter++; int end = (threadIndex+1)*groupInteractions.size()/numThreads;
if (i >= groupInteractions.size()) for (int i = start; i < end; i++) {
break;
int atom1 = groupInteractions[i].first; int atom1 = groupInteractions[i].first;
int atom2 = groupInteractions[i].second; int atom2 = groupInteractions[i].second;
for (int j = 0; j < (int) paramNames.size(); j++) { 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