Problem in parallel run - compute property/atom

Hello all,

I am neutralizing my system by deleting some atoms to get the total charge as zero. When I am running this calculation in serial, I am getting zero as my total charge. But when I am running the same in parallel version, the total charge is not zero. I am using compute property/atom command for getting the charge of each atom and adding them to the get the total charge of the system. The commands I have used is given below:

compute char all property/atom q

compute totchar all reduce sum c_char

How to fix this problem?

Thanks in advance

Are you deleting the atoms as a pre-processing step, so that both the serial and parallel runs are
reading in the same data file? Or are you deleting them in the LAMMPS run itself?
Which might be operating differently in serial versus parallel. I.e. the problem is not with the
compute reduce command.

Steve

Hello Steve,

Thanks for the suggestion. So if I delete atoms and then run the simulation, will I get the same results in serial and parallel version?

It depends on how you are deleting the atoms, whether serial will agree with parallel.
After your delete_atoms command you can put a statement like this,
to see immediately what the remaining charge is:

print “total charge $(charge(all))”

Steve