{"action":"created","issue":{"url":"https://api.github.com/repos/pandegroup/openmm/issues/1476","repository_url":"https://api.github.com/repos/pandegroup/openmm","labels_url":"https://api.github.com/repos/pandegroup/openmm/issues/1476/labels{/name}","comments_url":"https://api.github.com/repos/pandegroup/openmm/issues/1476/comments","events_url":"https://api.github.com/repos/pandegroup/openmm/issues/1476/events","html_url":"https://github.com/pandegroup/openmm/issues/1476","id":152469056,"number":1476,"title":"CPU and CUDA produce different energy values","user":{"login":"isjoung","id":7530585,"avatar_url":"https://avatars.githubusercontent.com/u/7530585?v=3","gravatar_id":"","url":"https://api.github.com/users/isjoung","html_url":"https://github.com/isjoung","followers_url":"https://api.github.com/users/isjoung/followers","following_url":"https://api.github.com/users/isjoung/following{/other_user}","gists_url":"https://api.github.com/users/isjoung/gists{/gist_id}","starred_url":"https://api.github.com/users/isjoung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/isjoung/subscriptions","organizations_url":"https://api.github.com/users/isjoung/orgs","repos_url":"https://api.github.com/users/isjoung/repos","events_url":"https://api.github.com/users/isjoung/events{/privacy}","received_events_url":"https://api.github.com/users/isjoung/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-05-02T01:34:55Z","updated_at":"2016-05-03T00:04:00Z","closed_at":null,"body":"This is a branched issue from #1434.\r\n\r\n This is the test code.\r\n\r\n```python\r\nfrom __future__ import print_function\r\nfrom simtk.openmm import app\r\nimport simtk.openmm as mm\r\nfrom simtk import unit\r\nimport cPickle\r\nimport parmed as pmd\r\n\r\nplatform_name = 'CPU'\r\n#platform_name = 'CUDA'\r\n\r\nwith open('input.dat','rb') as f:\r\n    system, prmtop, inpcrd = cPickle.load(f)\r\nprmtop.DFIRE_FORCE_GROUP = 13\r\n\r\nintegrator = mm.LangevinIntegrator(300.0*unit.kelvin, 1.0/unit.picoseconds, 2.0*unit.femtoseconds)\r\nplatform = mm.Platform.getPlatformByName(platform_name)\r\nsimulation = app.Simulation(prmtop.topology, system, integrator, platform)\r\ncontext = simulation.context\r\ncontext.setPositions(inpcrd.positions)\r\n\r\ndene_dict = pmd.openmm.energy_decomposition(prmtop, context)\r\nprint(dene_dict)\r\n```\r\n\r\nCPU result:\r\n{'angle': nan, 'dfire': 3797.767595666509, 'nonbonded': 56336477937418.76, 'bond': 26636613518.118565, 'total': nan, 'dihedral': 2858.1764757513142}\r\n\r\nCUDA result:\r\n{'angle': 104374.10686638913, 'dfire': -6.71629646532508e+36, 'nonbonded': 56336477937205.82, \r\n'bond': 26636612264.855366, 'total': nan, 'dihedral': nan}\r\n\r\nThree terms are different depending on platform: angle, dfire, dihedral\r\n\r\nThe input data can be downloaded from: \r\nhttps://drive.google.com/file/d/0B2y-WOTYohWabExyV1NtSHVlU2c/view?usp=sharing\r\n"},"comment":{"url":"https://api.github.com/repos/pandegroup/openmm/issues/comments/216400124","html_url":"https://github.com/pandegroup/openmm/issues/1476#issuecomment-216400124","issue_url":"https://api.github.com/repos/pandegroup/openmm/issues/1476","id":216400124,"user":{"login":"isjoung","id":7530585,"avatar_url":"https://avatars.githubusercontent.com/u/7530585?v=3","gravatar_id":"","url":"https://api.github.com/users/isjoung","html_url":"https://github.com/isjoung","followers_url":"https://api.github.com/users/isjoung/followers","following_url":"https://api.github.com/users/isjoung/following{/other_user}","gists_url":"https://api.github.com/users/isjoung/gists{/gist_id}","starred_url":"https://api.github.com/users/isjoung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/isjoung/subscriptions","organizations_url":"https://api.github.com/users/isjoung/orgs","repos_url":"https://api.github.com/users/isjoung/repos","events_url":"https://api.github.com/users/isjoung/events{/privacy}","received_events_url":"https://api.github.com/users/isjoung/received_events","type":"User","site_admin":false},"created_at":"2016-05-03T00:03:59Z","updated_at":"2016-05-03T00:03:59Z","body":"I also tried to remove one more `Force` then I get\r\n\r\nCPU:\r\n{'total': 3797.767595666509, 'dfire': 3797.767595666509, 'bond': 0.0}\r\n\r\nCUDA:\r\n{'total': 3797.714389047698, 'dfire': 3797.714389047698, 'bond': 0.0}\r\n\r\nRemoving one more,\r\n\r\nCPU:\r\n{'total': 3797.767595666509, 'dfire': 3797.767595666509}\r\n\r\nCUDA:\r\n{'total': 3797.714389047698, 'dfire': 3797.714389047698}\r\n\r\n-1e-36 is probably related to some kind of overflow. It is still odd that other energy components affect the energy value.\r\n\r\nImportant thing is this. I understand that accurate energy evaluation with this extremely messy coordinates is meaningless, but it should not give a number like -1e-36. As I said, I got the coordinates by energy minimization. If very high energy state suddenly changes to very low energy state, essentially energy minimization (or refining conformations) is impossible whatever method you may use."}}