[lammps-users] dump xyz command

Hello group,

I've noticed that the dump xyz command doesn't order the atoms (ie the
coordinates are basically in random order). I guess this doesn't
matter for non-bonded systems, but this seems like a bug for anything more
complicated (ie proteins). The reason I'm asking is that I am currently
generating huge trajectory files and would like to adapt the compressed
trajectory file format used by gromacs, but to be useful the coordinates
need to be properly ordered (ie the compression won't work with the tag


Hi Naveen. When running LAMMPS on more than 1
processor, the dump command does not write out in
numerical order. This is a parallel efficiency issue
since it would be much more costly to send all of the
coordinates to a single processor and have that single
processor order them and print them. So here's my
recommendation: use pizza.py in a post-processing step
to order the atoms.


The modules in pizza.py may need some adjustment to
deal with the xyz headers, but another alternative for
protein that may be better is to do a normal LAMMPS
dump and then convert to pdb format with pizza.py.
There's already a converter for this. There are also
other pdb format converters (i.e. in the LAMMPS
tools/ch2lmp directory).

The down side to this approach is that you have to do
a post-processing step. But I don't see a good way to
avoid this and get the atoms in the proper order.



If you have trouble getting pizza.py to work on your machine,
as I have, you can also use the "dump ... custom" command. Here is
my 'dump' of water molecules:

dump 1 water custom 500 mysystem.h2o tag type x y z ix iy iz

I then use a python script (see dump2xyz.py below) to read in the
header, sort the atoms using 'tag', and print out an .xyz file that
can be read directly into VMD.

I am a little surprised that 'tag type x y z ix iy iz' is not the
default 'dump' format.


Just a couple of additional notes. The reason that dumping things
in numeric order is hard is that it would require a "global sort", with
lots of communication. So instead, dump just tries to dump things
as quickly as possible and leaves the rest to post-processing.

Since xyz format doesn't have atom IDs, that means doing a post-process
sort is a bit difficult!

So I'd suggest what Ken is advocating. Dump in the normal LAMMPS
format and run a script to reformat/reorder however you like.

Pizza.py is hard to fully install (wish I knew enough Python to fix that),
but all you need are the "dump" and "xyz" tools:

pizza -t dump xyz


      I encountered a quite bizare phenomena when simulating a short
bead-spring polymer chain at very low temperature. It first seems to
equilibrate well enough for like 3million steps. But after that, its energy
and size both increase dramatically. I could not figure out the reason. So I
attach the data file and input file as below. Hope someone can help me out.
     Thank you very much.

    1. The data file is generated by performing a self-avoiding-walk on a FCC
    2. My lammps was built from March 07 version.
    3. This seems to only happen when chain is short and temperature is very


sim_1_2_.bs (937 Bytes)

sim_1_2_.data (12.2 KB)