Particle coordinate is Nan

The functionality of OpenMM will (eventually) include everything that one would need to run modern molecular simulation.
POST REPLY
User avatar
Jacky Ao
Posts: 3
Joined: Fri Jun 02, 2017 7:53 am

Particle coordinate is Nan

Post by Jacky Ao » Wed Jun 07, 2017 11:42 pm

Hi all,

I was trying to run a very simple simulation including 256 water molecules in a PBC box using .prmtop and .inpcrd files by only changing the simulateAmber.py file in the example folder. It worked fine under CPU platform in every machine I use, but it showed error when I was trying to run on OpenCL platform on my windows local desktop while it ran successfully in my windows laptop. Below is the error message.

Error Message:
Traceback (most recent call last):
File "simulateAmber.py", line 19, in <module>
simulation.step(10000)
File "C:\Miniconda3\lib\site-packages\simtk\openmm\app\simulation.py", line 132, in step
self._simulate(endStep=self.currentStep+steps)
File "C:\Miniconda3\lib\site-packages\simtk\openmm\app\simulation.py", line 194, in _simulate
self.integrator.step(10) # Only take 10 steps at a time, to give Python more chances to respond to a control-c.
File "C:\Miniconda3\lib\site-packages\simtk\openmm\openmm.py", line 14646, in step
return _openmm.LangevinIntegrator_step(self, steps)
Exception: Particle coordinate is nan
The error happened at the same step in the simulation every time. I had tried to changed different parameters and it only affect the step that the error occurred. I have also tried 1000 water molecules in a PBC box using .prmtop and .inpcrd file also. It has the same problem as when simulating 256 water molecules case when I used the windows local desktop in office. I have also checked the installation. Both of them can run the simulateAmber.py with the original .prmtop and .inpcrd file provided in the example folder, and it also can run non-PBC water droplet simulation on OpenCL platform successfully on the local desktop in office, so I personally do not think the error is caused by failed installation and guess it might be the problem of different GPU used.

Below are some information of the two computers.
My laptop:
GPU used: NVIDIA GeForce 840M
Way of installing OpenMM: Via Anaconda 4.4.0
OpenMM version: OpenMM 7.1.1

Windows local desktop in office:
GPU used: AMD Radeon(TM) R5 340X
Way of installing OpenMM: Via Miniconda 4.3.21
OpenMM version: OpenMM 7.1.1
Since our group will buy some GPUs for running larger system and OpenMM is one of our potential MD engine we will use because of its great performance on GPU acceleration, therefore I would like to know whether it is the hardware problem or sometime else. Thank you very much.

Attached are the .prmtop and .inpcrd files I had used for test, and I just modify the input filename in simulateAmber.py for running the simulation.
Attachments
1000w.7z
(32.26 KiB) Downloaded 3 times
256w.7z
(10.27 KiB) Downloaded 1 time

User avatar
Peter Eastman
Posts: 2541
Joined: Thu Aug 09, 2007 1:25 pm

Re: Particle coordinate is Nan

Post by Peter Eastman » Thu Jun 08, 2017 12:01 pm

Is it possible your starting coordinates are a bad configuration with very large forces? If so, that could explain the behavior. The script does a local energy minimization to try to fix that, but if the initial state is bad enough, it sometimes won't succeed. And because of differences in how they handle numerics, the OpenCL platform has more trouble dealing with very large forces than the CPU platform does.

Try starting with the CPU platform. Let it do the energy minimization and maybe around 100 time steps to make sure it's running successfully. Now save that conformation and use it as your starting structure with the OpenCL platform. Does that work?

Peter

User avatar
Jacky Ao
Posts: 3
Joined: Fri Jun 02, 2017 7:53 am

Re: Particle coordinate is Nan

Post by Jacky Ao » Thu Jun 08, 2017 10:06 pm

That works. Thank you so much.

User avatar
Simon Stockes
Posts: 1
Joined: Mon Jun 05, 2017 3:30 am

Re: Particle coordinate is Nan

Post by Simon Stockes » Fri Jun 30, 2017 7:27 am

CPU first run was ok, but For me it does not work with OpenCL after:

pdb = PDBFile('input_cpu.pdb')
...
platform = Platform.getPlatformByName(platform_name)
properties = {'OpenCLPrecision': 'single'}
simulation = Simulation(pdb.topology, system, integrator,platform,properties)
...

Eros:examples stockes$ python simulatePdb.py
Traceback (most recent call last):
File "simulatePdb.py", line 18, in <module>
simulation.minimizeEnergy()
File "/Applications/anaconda/lib/python3.6/site-packages/simtk/openmm/app/simulation.py", line 128, in minimizeEnergy
mm.LocalEnergyMinimizer.minimize(self.context, tolerance, maxIterations)
File "/Applications/anaconda/lib/python3.6/site-packages/simtk/openmm/openmm.py", line 14846, in minimize
return _openmm.LocalEnergyMinimizer_minimize(context, tolerance, maxIterations)
Exception: Particle coordinate is nan


Any solution ?
Will OpenMM run normally in MD if I have these problem with the minimizer ?

Simon.

User avatar
Peter Eastman
Posts: 2541
Joined: Thu Aug 09, 2007 1:25 pm

Re: Particle coordinate is Nan

Post by Peter Eastman » Fri Jun 30, 2017 2:51 pm

It's possible your problem is different from the one Jacky reported. Can you give more detail? What exactly are you doing? If you can provide the complete script and input files, that would be great.

POST REPLY