faster trajectory writing?

The functionality of OpenMM will (eventually) include everything that one would need to run modern molecular simulation.
POST REPLY
User avatar
Daniel Konstantinovsky
Posts: 77
Joined: Tue Jun 11, 2019 12:21 pm

faster trajectory writing?

Post by Daniel Konstantinovsky » Mon Aug 05, 2019 4:05 pm

Hello,

I'm running some MD where I need to save frames _very_ frequently. Using DCDReporter(), it seems that file writing is the performance bottleneck in my case, which isn't ideal. Do you have any general tips on how I could speed this up? I can't speed up my cluster's file system, but maybe there's something within OpenMM?

Thank you!!

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

Re: faster trajectory writing?

Post by Peter Eastman » Mon Aug 05, 2019 4:33 pm

How frequently is very frequently? Every step? Every 10 steps?

One thought is to make the writing asynchronous. Create a version of DCDReporter that stores the State into a list, then has a separate thread asynchronously pulling states out of the list and writing them to the file.

The fact that the DCD writer is implemented in Python also means it's not that fast. I think MDTraj includes a DCDReporter that's implemented in C, so that might be a lot faster. That would be a good first thing to try.

User avatar
Daniel Konstantinovsky
Posts: 77
Joined: Tue Jun 11, 2019 12:21 pm

Re: faster trajectory writing?

Post by Daniel Konstantinovsky » Tue Aug 06, 2019 12:26 pm

Thank you! I will try MDTraj's method first. It looks like the heavy stuff is in Cython, so hopefully this will be enough.

POST REPLY