Error in parallel GCMC simulation

Thanks, Steve. I recompiled the 22Feb18 version.

After some tests, I think it’s not the version’s problem. If I remain writing:

fix 2 gas gcmc 1 10 10 0 54341 473.0 -10.0 0.5 mol water pressure 10.0

, neighbor list wouldn’t be rightly constructed in paralleling process. So Bond and Angle Error appear and the energy and pressure went ridiculous. By changing this line to:
fix 2 gas gcmc 1 10 0 0 54341 473.0 -10.0 0.5 mol water pressure 10.0

, not involving mc moves, no strange thing happen.
I add fix nvt in replacement of mc moves and the whole process works fine then.
The below are my final input file.

units real
atom_style full
boundary p p p

pair_style lj/cut/coul/long 10.0
pair_modify mix arithmetic
bond_style hybrid harmonic morse
angle_style harmonic

read_data lmp.data
units real
atom_style full
boundary p p p

pair_style lj/cut/coul/long 10.0
pair_modify mix arithmetic
bond_style hybrid harmonic morse
angle_style harmonic

read_data lmp.data
kspace_style pppm 1e-5

neighbor 2.0 bin
neigh_modify every 1 delay 0 check yes

molecule water H2O.txt
group gas type 4 5
group brucite type 1 2 3
group atommc type 1 4 5
timestep 1.0

restart 1000 restart1 restart2
compute_modify thermo_temp dynamic yes

thermo 1
thermo_style custom step atoms temp press etotal
dump 1 gas xyz 1 h2o.xyz
dump_modify 1 element o h mg o h sort id
dump 2 brucite xyz 1000 brucite.xyz
dump_modify 2 element o h mg o h sort id

fix 1 all nvt temp 300.0 300.0 50.0
fix 2 gas gcmc 10 10 0 0 54341 473.0 -10.0 0.5 mol water pressure 10.0
run 10000
unfix 1
unfix 2

It might be this bug https://github.com/lammps/lammps/issues/467

If you run on multiple cores, a rejected rotation / translation is not properly reverted if it involved moving a particle to a different processor I think.

Aidan, will you take a look?

Best,
Anders

Thanks, Anders. I understand what you mean. But I’m not familiar with lammps original code to prove.
By the way, if I want to write some code for a MC method and use lammps existing code frame, how could I start? Could you give me some advice?

Sincerely,
Mengzi

You could write an MC code that calls LAMMPS thru its library

interface to perform energy checks or dynamics. See the examples/COUPLE
directory for non-MC examples of this. Or we’re about

a client/server communication option in LAMMPS that would let

a stand-alone MC code communicate with LAMMPS. MC/MD will

be one of the (toy) examples in that release.

Steve