From: John Stone (
Date: Tue May 04 2021 - 15:44:24 CDT

  Josh's suggestion to use the "parallel" commands is correct,
but I would warn you that I/O is one of the things that tends
not to parallelize much. It is pretty easy for a well-written
program to become I/O bound on modern hardware.

If all you're doing is splitting out a DCD file into thousands of PDBs
with a relatively inexpensive atom selection operation, then
the most important thing will be to ensure that you're writing
those PDBs onto files contained on a very fast storage system.

I would expect that VMD should be able to write those files
at a rate that approaches your disk's maximum write speed,
even with a single process and without MPI.

One question I would ask is why you're having to write the PDB
files in the first place? Maybe it would be more efficient
to teach other software tool(s) to read the DCD file directly
rather than processing PDBs? What are you doing with the resulting
PDB files?

In my mind, it wouldn't make much sense to go through the trouble of compiling
VMD for MPI just to emit a zillion PDB files due to a slow or poorly
written analysis tool. I would seriously question using PDB files
for anything important since they also truncate your coordinate precision...

  John Stone

On Tue, May 04, 2021 at 07:48:00PM +0000, Vermaas, Josh wrote:
> Hi Kelly,
> You've seen the tutorial on this, right?
> [1]
> I think you could do something like the following:
> proc saveframe { frameno } {
> animate write pdb $frameno.pdb beg $frameno end $frameno
> }
> mol new ../../Aldolase-HMR.prmtop
> mol addfile ../../ waitfor all
> set lastframe [expr { [molinfo top get numframes] - 1}]
> parallel for 0 $lastframe saveframe
> That being said, I haven't tested this.
> -Josh
> On 5/4/21 1:45 PM, Mcguire, Kelly wrote:
> I have a DCD file with 5000 frames. I have a script that saves each
> frame as a PDB (shown below). This takes quite a bit of time to finish
> as you can imagine. Is there a way to run this in parallel with MPI (I
> don't have much experience with this) or on multiple CPUs on a node
> with 24 CPUs or multiple threads to speed up the process? I will need
> to do this with multiple DCD files in the future. Thanks!
> mol new ../../Aldolase-HMR.prmtop
> mol addfile ../../ waitfor all
> for {set i 1} {$i < 4999} {incr i} {
> [atomselect top all frame $i] writepdb $i.pdb
> }
> Dr. Kelly McGuire
> Postdoc
> Chemistry/Biochemistry Department
> Natural Science Building, 4104A, 4106A, 4017
> --
> Josh Vermaas
> Assistant Professor, MSU-DOE Plant Research Lab and Department of Biochemisty and Molecular Biology
> [2]
> [3]
> References
> Visible links
> 1.
> 2.
> 3.;!!DZ3fjg!vQgve-QSUmAmZgspjTMEFdEMumzWC-pU4NBpatiTiASxnX3U_IG4H5RrSFLLfXPuFA$

NIH Center for Macromolecular Modeling and Bioinformatics
Beckman Institute for Advanced Science and Technology
University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801           Phone: 217-244-3349