Commit 1e2606ec authored by Peter Eastman's avatar Peter Eastman
Browse files

Fixed bug in parallel nonbonded force

parent 1a21cf08
......@@ -375,6 +375,8 @@ void OpenCLNonbondedUtilities::setTileRange(int startTileIndex, int numTiles) {
findInteractingBlocksKernel.setArg<cl_uint>(10, startTileIndex);
findInteractingBlocksKernel.setArg<cl_uint>(11, startTileIndex+numTiles);
}
else
forceKernel.setArg<cl_uint>(9, numTiles);
}
cl::Kernel OpenCLNonbondedUtilities::createInteractionKernel(const string& source, const vector<ParameterInfo>& params, const vector<ParameterInfo>& arguments, bool useExclusions, bool isSymmetric) const {
......
......@@ -676,7 +676,7 @@ void testDispersionCorrection() {
ASSERT_EQUAL_TOL(expected, energy1-energy2, 1e-4);
}
void testParallelComputation() {
void testParallelComputation(bool useCutoff) {
OpenCLPlatform platform;
System system;
const int numParticles = 200;
......@@ -685,6 +685,8 @@ void testParallelComputation() {
NonbondedForce* force = new NonbondedForce();
for (int i = 0; i < numParticles; i++)
force->addParticle(i%2-0.5, 0.5, 1.0);
if (useCutoff)
force->setNonbondedMethod(NonbondedForce::CutoffNonPeriodic);
system.addForce(force);
OpenMM_SFMT::SFMT sfmt;
init_gen_rand(0, sfmt);
......@@ -725,7 +727,8 @@ int main() {
testBlockInteractions(false);
testBlockInteractions(true);
testDispersionCorrection();
testParallelComputation();
testParallelComputation(false);
testParallelComputation(true);
}
catch(const exception& e) {
cout << "exception: " << e.what() << endl;
......
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