In implementing more of CHARMM's functionality through the CHARMM/OpenMM interface we have recently run into problems with some code that was written to provide the CHARMM resd restraints through CHARMM/OpenMM. The implementation uses the CustomCompoundBondForce and throws errors by producing NANs as the energy output for a test system on CUDA, though it works and give the correct answers for OpenCL and Reference platforms. We have recently implemented the XmlSerializer into the CHARMM/OpenMM interface, and this provides a convenient way for us to export these examples to illustrate the failure through the OpenMM python API. In the dropbox file https://dl.dropboxusercontent.com/u/158 ... -23-14.tgz the files necessary to run this example through the OpenMM python API can be found (this is because there is no space to append the file to this message as an attachment since the a message saying "attachment quota has been reached). The failure is clearly illustrated. Any advice on what the problem might be would be appreciated.
I note that I was testing under OpenMM5.2. It appears that the treatment of integrators and contexts are slightly different under the 6.0 version I just downloaded and the following code is required:
Code: Select all
from simtk.openmm.app import *
from simtk.openmm import *
from simtk.unit import *
from sys import stdout
plats = ['OpenCL', 'CUDA', 'Reference']
pdb = PDBFile('omm_resdtest_3.pdb')
f = open("omm_resdtest_3.xml", "r").read()
system = XmlSerializer.deserialize(f)
print "************TEST 3******************"
for w in plats:
pltfrm = Platform.getPlatformByName(w)
integrator = LangevinIntegrator(300*kelvin, 1/picosecond, 0.002*picoseconds)
context = Context(system,integrator,pltfrm)
context.setPositions(pdb.positions)
state = context.getState(getEnergy=True)
potential = state.getPotentialEnergy()
platform = Platform.getName(context.getPlatform())
print platform, potential
del context, platform, pltfrm, integrator
del system, f, pdb
pdb = PDBFile('omm_resdtest_4a.pdb')
f = open("omm_resdtest_4a.xml", "r").read()
system = XmlSerializer.deserialize(f)
print "************TEST 4a******************"
for w in plats:
pltfrm = Platform.getPlatformByName(w)
integrator = LangevinIntegrator(300*kelvin, 1/picosecond, 0.002*picoseconds)
context = Context(system,integrator,pltfrm)
context.setPositions(pdb.positions)
state = context.getState(getEnergy=True)
potential = state.getPotentialEnergy()
platform = Platform.getName(context.getPlatform())
print platform, potential
del context, platform, pltfrm, integrator
del system, f, pdb
pdb = PDBFile('omm_resdtest_4b.pdb')
f = open("omm_resdtest_4b.xml", "r").read()
system = XmlSerializer.deserialize(f)
print "************TEST 4b******************"
for w in plats:
pltfrm = Platform.getPlatformByName(w)
integrator = LangevinIntegrator(300*kelvin, 1/picosecond, 0.002*picoseconds)
context = Context(system,integrator,pltfrm)
context.setPositions(pdb.positions)
state = context.getState(getEnergy=True)
potential = state.getPotentialEnergy()
platform = Platform.getName(context.getPlatform())
print platform, potential
del context, platform, pltfrm, integrator
Charles Brooks