parallel calculation problems in fix-gcmc

Dear lammps users and developers,

I am using the following script (see below) to run fix-nvt and fix-gcmc.

If I run only fix-nvt, it works well, no matter I use mpirun or use only one processor.

However, if fix-gcmc is turn on, there is no problem if only one processor is used (i.e., not parallel calculation).

When I use “mpirun -np N lmp_mpi …” (n larger than 1), the following problems may come cout.

problem 01: WARNING: Neighbor exclusions used with KSpace solver may give inconsistent Coulombic energies (…/neighbor.cpp:445)

Actually this problem always comes out with fix-gcmc. When I use the same run script (see below), if fix-gcmc is turned off, this warning disappears. If fix-gcmc is turned on, this warning shows up, no matter I use mpirun or one-processor. So, I am pretty sure this warning is caused by fix-gcmc, but I have not found the reason.

problem 02: WARNING: System is not charge neutral, net charge = 1.6952 (…/kspace.cpp:297)

This problem shows up only when I run fix-gcmc with mpirun. Sometimes it shows up, sometimes not. I am sure my initial configuration is neutral, but some unknown reason make the atoms neutral. I guess, it is due to the lost of O-atoms of SPCE water.

problem 03: ERROR: Lost atoms: original 2301 current 2297 (…/thermo.cpp:395)

This problem may come out together with problem 02, also with using shake command.

If I use only one processor, it is safe to use shake command. But if I use mpirun, I have to give up shake because it always cause the lose of atoms.

The fix-gcmc has been developed for years, and I believe the code is correct.

Maybe some parameters I use are incorrect. But there are not so many parameters in my script. Could you tell me which to tune?

By the way, even I use only one processor, I can finish the simulation safely, but the chemical value for the pure water system seems depends on the initial configuration of the system. Actually this is another topic and I posted it before, But for me, this is not a old problem, because I have not fixed it. For the SPCE water system, I can have different final density with the same chemical potential input. If somebody can perform a test for SPCE water at 298 K with density 1.0 Kg/m^3 and show me the value of chemical potential, I will be very very very appreciated. I have been working on this problem too long time,

The run script is as below:================================================

units real
atom_style full

boundary p p p
pair_style lj/cut/coul/long 9.8 9.8
pair_modify tail yes
bond_style harmonic
angle_style harmonic

special_bonds lj/coul 0 0 0.5
kspace_style pppm 0.00001

read_restart ddrst.rst2

neighbor 3.0 bin
neigh_modify every 1 delay 0 check yes

group water type 1 2
molecule hho …/00model/hho.txt offset 0 0 0 0 0

info group
log log.out
timestep 1.0

fix fixshake all shake 0.0001 20 0 b 1 a 1
fix fixnvt all nvt temp 300 300 50.0
fix fixmomentum all momentum 1 linear 1 1 1
#fix fixrecenter all recenter INIT INIT INIT

fix fixgcmc water gcmc 2 10 2 0 2345 300 -4.0 0.5 mol hho maxangle 90 full_energy

thermo 2
thermo_style custom step time atoms temp press lx density

restart 50 ddrst.rst1 ddrst.rst2

dump dumptrj all atom 100 all.trj
dump_modify dumptrj image yes scale yes

run 1000000

unfix fixshake
unfix fixnvt
unfix fixmomentum
unfix fixgcmc
undump dumptrj

Best,

Yongbiao

Dear lammps users and developers,

   I am using the following script (see below) to run fix-nvt and fix-gcmc.

   If I run only fix-nvt, it works well, no matter I use mpirun or use only
one processor.

   However, if fix-gcmc is turn on, there is no problem if only one
processor is used (i.e., not parallel calculation).
When I use "mpirun -np N lmp_mpi ...." (n larger than 1), the following
problems may come cout.

problem 01: WARNING: Neighbor exclusions used with KSpace solver may give
inconsistent Coulombic energies (../neighbor.cpp:445)

Actually this problem always comes out with fix-gcmc. When I use the same
run script (see below), if fix-gcmc is turned off, this warning disappears.
If fix-gcmc is turned on, this warning shows up, no matter I use mpirun or
one-processor. So, I am pretty sure this warning is caused by fix-gcmc, but
I have not found the reason.

didn't you ask already about where messages like these are coming from?

0 atoms in group FixGCMC:gcmc_exclusion_group:fixgcmc
0 atoms in group FixGCMC:rotation_gas_atoms:fixgcmc

well, it doesn't take much of a genius to infer that the first of
these is used internally in fix gcmc and that it is used to define
neighbor list exclusions, hence the warning.

problem 02: WARNING: System is not charge neutral, net charge = 1.6952
(../kspace.cpp:297)

This problem shows up only when I run fix-gcmc with mpirun. Sometimes it
shows up, sometimes not. I am sure my initial configuration is neutral, but
some unknown reason make the atoms neutral. I guess, it is due to the lost
of O-atoms of SPCE water.

you can verify your guess *extremely* easily by recording a trajectory
and checking. if your initial system is neutral and the molecule you
insert/remove is neutral, then this should not happen, and is a sign
of a simulation gone bad. the fact, that it doesn't occur in serial,
doesn't mean that the serial calculation is more correct. certain
kinds of problems in LAMMPS only manifest themselves so drastically,
if you run in parallel.

problem 03: ERROR: Lost atoms: original 2301 current 2297
(../thermo.cpp:395)

This problem may come out together with problem 02, also with using shake
command.

If I use only one processor, it is safe to use shake command. But if I use
mpirun, I have to give up shake because it always cause the lose of atoms.

that is nonsense. either fix shake works, or it doesn't. most
certainly, you won't have an SPC/E water, if you don't use fix shake.
so without your simulation is *definitely* bogus.

The fix-gcmc has been developed for years, and I believe the code is
correct.

Maybe some parameters I use are incorrect. But there are not so many
parameters in my script. Could you tell me which to tune?

well, there is a ton of information still missing here. e.g. the
version of LAMMPS, and the exact contents of your molecule file. what
is highly suspicious is the high frequency of gcmc move attempts. does
your simulation actually maintain a somewhat reasonable temperature?
from what you describe above, i would suspect that your molecule file
is not containing the correct information for fix shake and/or for
exclusions.

By the way, even I use only one processor, I can finish the simulation
safely, but the chemical value for the pure water system seems depends on

it is very basic MD knowledge, that a completed simulation doesn't
automatically mean that this simulation is correct and meaningful.

the initial configuration of the system. Actually this is another topic and
I posted it before, But for me, this is not a old problem, because I have
not fixed it. For the SPCE water system, I can have different final density
with the same chemical potential input. If somebody can perform a test for
SPCE water at 298 K with density 1.0 Kg/m^3 and show me the value of
chemical potential, I will be very very very appreciated. I have been
working on this problem too long time,

....and did you talk to your adviser about this. it appears to me,
that your major problem is not so much a LAMMPS problem, but how to
conduct proper scientific research in MD simulations and that you need
more tutoring and training in this. with MD it is not simply that
there are some "magic" correct parameters and then everything is
automatically correct. but, as i mentioned in a previous e-mail, many
details matter and each one of them can have a significant impact on
your results (or not). this is not something that somebody from remote
can quickly assess (outside of "your simulation is obviously wrong"),
but something that you have to approach by yourself in steps, where
you start from a simulation that you have properly validated to be
correct and gradually introduce new features and test them. rather
than working on water, for example, you should start with an atomic
liquid and make sure that you master that, before moving to a more
complex system. this is how you teach yourself something and this is
how scientific discovery works. again, that is not something that you
can be told from a few e-mails on a mailing list and it is not at all
a LAMMPS issue, but is something that *you* have to learn *first*.
again, this is the duty of your adviser to make certain that you are
properly prepared for the work you are doing, not our job here.

axel.

GCMC simulations are inherently complicated, regardless of what code
you are using. Combining it with MD in LAMMPS is even more
complicated. I suggest starting out with Lennard-Jones. Until you can
reliably use fix gcmc to generate correct equilibrated liquid and
vapor states for LJ, you are wasting your time and ours trying to do
SPC/E water with SHAKE. It is just too complicated for you to deal
with until you are more experienced.