DCDReporter performance

The functionality of OpenMM will (eventually) include everything that one would need to run modern molecular simulation.
POST REPLY
User avatar
Benjamin Trendelkamp-Schroer
Posts: 12
Joined: Fri Feb 24, 2012 11:49 am

DCDReporter performance

Post by Benjamin Trendelkamp-Schroer » Thu Feb 21, 2013 9:02 am

Hi,

I have tried o find out the fastest way to record simulation data using OpenMM-5.0.

I am runnning an explicit solvent, PME, simulation of Alanine-Dipeptide, with integration time step dt=2fs. I have tried to benchmark (in a very crude approach using the python time module) the data reporting performance. I have performed simulations for a total of t=100ps/200ps. I am runnning on GeForceGtX580 using the python interface.

100ps:
i) Perfroming simulation.step(n), n=50000 : 35.5s
ii) With dcd reporter : 57.8s
iii) for i in range(1000):
n=50
simulation.step(n),
copying positions from context => 42.8s

200ps:
i) Perfroming simulation.step(n), n=100000 : 68.8s
ii) With dcd reporter : 108.8 s
iii) for i in range(2000):
n=50
simulation.step(n),
copying positions from context => 83.6s

It seems that it is more efficient to directly copy positions from context using

Code: Select all

 simulation.context.getState(getPositions=True).getPositions() 
than using the DCDReporter.

Is that to be expected?

Thanks,

Ben

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

Re: DCDReporter performance

Post by Peter Eastman » Thu Feb 21, 2013 11:02 am

Hi Ben,

What do you do with the positions after you call getPositions()? If you're just saving them in memory, that will definitely be faster than writing them out to disk. But of course, you'll be limited in how much you can store, and it doesn't let you load the trajectory into any other program. What do you plan to do with your trajectory?

In any case, saving every 50th step will definitely slow things down. Usually people save states less frequently than that.

Peter

User avatar
Benjamin Trendelkamp-Schroer
Posts: 12
Joined: Fri Feb 24, 2012 11:49 am

Re: DCDReporter performance

Post by Benjamin Trendelkamp-Schroer » Mon Feb 25, 2013 4:16 am

Hi Peter,

I am computing torsion angles on the fly using python and numpy and store them in a python list before I call step() again. Since the system is very small/fast I use a relatively small time step to write out coordinates and compute angles.

I was just puzzled that this is faster than using the dcd writer.

POST REPLY