RDF issue in latest 11 Sep 15 version

Hi lammps users,

I recently installed 11 Sep 15 version on Lammps (parallel MPI version). Previously I was using 15May15 version of Lammps. I am getting some problem while calculating Radial distribution function from 11 Sept 15 Version.
The same input without any change is working fine with 15 May 15 version.

(Please see the attached pdf for comparision)

I am using following command to get rdfs

compute myRDF all rdf 1000
fix 7 all ave/time 1 25000 25000 c_myRDF file tmp.rdf mode vector

I never faced this issue before with any previous versions of Lammps. I wonder if it is because of some bug with recent version.

The problem under consideration utilizes Yukawa pair potential.
The trajectories of particles look fine as I am getting expected results during particle trajectories using the equilibrated restart data.

Please suggest in case I am making some mistake.


two_version_rdfs-nup.pdf (51.7 KB)

Interesting. It appears that the g® is flipped and improperly normalized. However, using a similar command works fine for the melt example in my case with the 11 September version. Are you sure it is not an error in your plotting script?

Hi Stefan,

It’s not a plotting script error as I can see it clearly in rdf output file from LAMMPS directly.
Also, the same input I have been using since long (with many old versions of lammps) and always got correct result.
No input file mistake can lead to (-Ve) values of rdf in any case (At least hard to imagine for me).

Also, I used the same makefile to install 11Sep 15 version on same cluster I am using since long back.
I am working on a small script which can reproduce this error and will post it soon.

At different instances, I am also getting correct rdfs using 11 Sep 15 version using Coul/long pair potential. But at least once,
I got weird rdf values.

Just have a look over a section of output …

Can you send your full input script and data files (if any)?

The coordination number looks fine, this is a bit strange.

Axel recently made some change to the stats in compute rdf

for some corner case I’m not remembering. Possibly

that is affecting this?


Axel recently made some change to the stats in compute rdf
for some corner case I'm not remembering. Possibly
that is affecting this?

​i am suspecting this as well. however, as stefan already mentioned, i
cannot track this down without an usable example that demonstrates the
issue. i have been testing the change quite thoroughly with several typical
systems and not seen anything like the reported behavior. since the change
made to LAMMPS covers a corner case and the LAMMPS code before was doing
the right thing for most regular scenarios already, i suggest​ that we roll
the change back and i try to debug what is causing the reported problem and
we only re-apply the change, if the issue is found and fixed.



here is the patch that rolls back compute rdf to the state before september 3rd 2015.


lammps-compute-rdf-patch-undo.diff.gz (1.91 KB)

Hi Axel and others,

I apologizes for delay. Here am attaching a minimal input file (and obtained rdf file) which is producing error on my cluster.
The input file is meant only to give the mentioned error in rdf so most of fixes and other stuffs have been removed
step by step checking their impact.

The debugging suggest that … rdf is becoming -ve if I increase number of particles in simulation more than the 245000 particles for present input file. For lesser particles, rdf values look positive.

After Axel’s patch I have not yet got any such error with any number of particles but still I don’t know what has gone wrong.

I work with even much more particles quite many times but never faced such error in past with any other versions. Also, I can’t say that I have tried all past versions of lammps source.


in.yuk (817 Bytes)

tmp.rdf (31 KB)

I’ll post Axel’s “undo” patch later today …


I'll post Axel's "undo" patch later today ...


i have identified the cause for the negative graphs (32-bit integer​
overflow when computing the normalization factors) and refactored the code
a bit to avoid this issue. please find updated versions of the compute rdf
sources in the attachment.


compute_rdf.cpp.gz (2.96 KB)

compute_rdf.h.gz (944 Bytes)