Page 1 of 1

DCDReporter performance

Posted: Thu Feb 21, 2013 9:02 am
by trendelkamp
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

Re: DCDReporter performance

Posted: Thu Feb 21, 2013 11:02 am
by peastman
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

Re: DCDReporter performance

Posted: Mon Feb 25, 2013 4:16 am
by trendelkamp
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.