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

Added checks for nan coordinates in CUDA and OpenCL

parent d1afc976
......@@ -1196,6 +1196,8 @@ void CudaContext::reorderAtomsImpl() {
molPos[i].x *= invNumAtoms;
molPos[i].y *= invNumAtoms;
molPos[i].z *= invNumAtoms;
if (molPos[i].x != molPos[i].x)
throw OpenMMException("Particle coordinate is nan");
}
if (nonbonded->getUsePeriodic()) {
// Move each molecule position into the same box.
......
......@@ -1112,6 +1112,8 @@ void OpenCLContext::reorderAtomsImpl() {
molPos[i].x *= invNumAtoms;
molPos[i].y *= invNumAtoms;
molPos[i].z *= invNumAtoms;
if (molPos[i].x != molPos[i].x)
throw OpenMMException("Particle coordinate is nan");
}
if (nonbonded->getUsePeriodic()) {
// Move each molecule position into the same box.
......
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