[lammps-users] Problem with running in parallel

Hello everyone,

I am simulating a system of polymer and salt (Litfsi salt ion) using GAFF. I started with a small system comprising 5 polymer chains and 2 salt ions. The simulation works fine with a single processor. However, I encounter the error (i.e., Bond atoms 255 279 missing on proc 802 at step 2693 ) as the simulation is running in parallel. The input script is given below;

Could you please take a look at the script and advise me if there is something wrong with that?

@@@input [email protected]@@

units real
atom_style full
dimension 3
boundary p p p
read_data Data-Lammps-Small.dat

bond_style harmonic
angle_style harmonic

pair_style lj/cut/coul/long 10.0 10.0 # 10.0
special_bonds lj 0.0 0.0 0.5 coul 0.0 0.0 0.0

#pair_modify tail yes
pair_modify mix arithmetic
kspace_style ewald 1e-8
#kspace_modify gewald 3.0

###pair coeffs

pair_coeff 1 1 0.1094001 3.3996700 #c-c
pair_coeff 2 2 0.0610000 3.1181500 # F-F
pair_coeff 3 3 0.0157000 2.4713500 # H-H
pair_coeff 4 4 0.0183000 2.0259000 # LI-LI
pair_coeff 5 5 0.1700000 3.2500000 # N-N
pair_coeff 6 6 0.1700000 3.2500000 # N1-N1
pair_coeff 7 7 0.1700000 3.2500000 # N2-N2
pair_coeff 8 8 0.1700000 3.2500000 # N3-N3
pair_coeff 9 9 0.1700000 3.2500000 # N4-N4
pair_coeff 10 10 0.1700000 3.2500000 # N5-N5
pair_coeff 11 11 0.1700000 3.00001 # O-O
pair_coeff 12 12 0.2100000 2.9599200 # O1-O1
pair_coeff 13 13 0.2100000 2.9599200 # O2-O2
pair_coeff 14 14 0.2100000 2.9599200 # O3-O3
pair_coeff 15 15 0.2100000 2.9599200 # O4-O4
pair_coeff 16 16 0.2100000 2.9599200 # O5-O5
pair_coeff 17 17 0.2500000 3.5635900 # S-S

##bond coeffs
bond_coeff 1 299.99 1.5000 # C-C
bond_coeff 2 299.79 1.3497 # C-F
bond_coeff 3 299.99 1.111 # C-H
bond_coeff 4 299.9 1.430 # C-N1
bond_coeff 5 299.9 1.430 # C-N2
bond_coeff 6 299.9 1.430 # C-N3
bond_coeff 7 299.9 1.430 # C-N4
bond_coeff 8 299.9 1.430 # C-N5
bond_coeff 9 299.9 1.430 # C-O1
bond_coeff 10 299.9 1.430 # C-O2
bond_coeff 11 299.9 1.430 # C-O3
bond_coeff 12 299.9 1.430 # C-O4
bond_coeff 13 299.9 1.430 # C-O5
bond_coeff 14 299.60 1.8087 # C-S
bond_coeff 15 299.9 0.997 # H-N2
bond_coeff 16 299.9 0.997 # H-N3
bond_coeff 17 299.9 0.997 # H-N4
bond_coeff 18 299.9 0.997 # H-N5
bond_coeff 19 299.000 0.99000 # H-O5
bond_coeff 20 289.9 0.997 # Li-N
bond_coeff 21 284.20 1.6720 # N-S
bond_coeff 22 308.6 1.4533 # O-S

##angle coeffs

angle_coeff 1 50.30 119.70 # C-C-C
angle_coeff 2 50.30 119.70 # C-C-H
angle_coeff 3 71.29 126.01 # C-C-N1
angle_coeff 4 71.29 126.01 # C-C-N3
angle_coeff 5 71.29 126.01 # C-C-N4
angle_coeff 6 71.29 126.01 # C-C-N5
angle_coeff 7 36.183 110.10 # C-C-O1
angle_coeff 8 36.183 110.10 # C-C-O4
angle_coeff 9 36.183 110.10 # C-C-O5
angle_coeff 10 50.30 119.70 # C-N1-C
angle_coeff 11 70.76 118.18 # C-N2-C
angle_coeff 12 69.999 117.00 # C-N2-H
angle_coeff 13 70.76 118.18 # C-N3-C
angle_coeff 14 69.999 117.00 # C-N3-H
angle_coeff 15 70.76 118.18 # C-N4-C
angle_coeff 16 69.999 117.00 # C-N4-H
angle_coeff 17 70.76 118.18 # C-N5-C
angle_coeff 18 69.999 117.00 # C-N5-H
angle_coeff 19 50.30 120.0 # C-O4-C
angle_coeff 20 50.30 119.70 # C-O5-H
angle_coeff 21 30.64 100.0219 # C-S-N
angle_coeff 22 31.26 100.086 # C-S-O
angle_coeff 23 33.88 100.0736 # F-C-F
angle_coeff 24 30.16 100.096 # F-C-S
angle_coeff 25 37.81 118.92 # H-C-H
angle_coeff 26 47.33 118.36 # H-C-N3
angle_coeff 27 47.33 118.36 # H-C-N4
angle_coeff 28 28.67 109.00 # H-C-O4
angle_coeff 29 28.67 109.00 # H-C-O5
angle_coeff 30 50.30 119.70 # Li-N-S
angle_coeff 31 50.30 119.70 # N-S-O
angle_coeff 32 74.20 109.14 # N1-C-N2
angle_coeff 33 74.20 109.14 # N1-C-N5
angle_coeff 34 50.30 119.70 # N1-C-O1
angle_coeff 35 74.20 109.14 # N2-C-N3
angle_coeff 36 74.20 109.14 # N2-C-N5
angle_coeff 37 50.30 119.70 # N2-C-O2
angle_coeff 38 50.30 119.70 # N3-C-O2
angle_coeff 39 50.30 119.70 # N4-C-O3
angle_coeff 40 50.30 119.70 # N4-C-O4
angle_coeff 41 50.30 119.70 # O-S-O
angle_coeff 42 50.30 119.70 # O3-C-O4
angle_coeff 43 31.49 100.196 # S-N-S

##------------------------Minimization------------------------------

reset_timestep 0 ## reset timestep
thermo 100 ##
thermo_style custom step temp pe vol density press
minimize 1.0e-5 1.0e-7 1000 100000

image.gif

The fact that it doesn’t crash when running in serial, doesn’t mean that that run is correct.
The kind of issue you see is due to atoms moving very fast. When running in parallel that can mean that an atom passes through the “communication cutoff” area before it can migrate to the next subdomain. When you have only one subdomain, that cannot happen.
It is still incorrect and will result in bad simulation data. The most common reasons for this are bad force field parameters or bad choice of simulation settings, e.g. too large a timestep or too short a communication cutoff or a combination of those.
This has been discussed many times on this list, I suggest you look up previous discussions to learn from them.

image.gif

There is no indication in your description that using a more recent version of LAMMPS will change the physics and thus I would expect that same issue to happen.
Please go through the detailed discussions in the mailing list archive. They provide real knowledge. Hope is not a good substitute for that.

image.gif

image.gif

image.gifDear Axel,

Thank you for your valuable advice. Based on the comparison between the simulation results (i.e., density profile) running in lmp_mpi single processor and in parallel, I do not see any significant difference. Perhaps it would not be enough assessment to be certain about my simulation implementation, thus I will go check the discussion as well.

Thank you very much

image.gif

image.gif

image.gifDear Axel,

Thank you very much for your valuable time and advice.

I used moltemplate to generate my system (polymer chain+salt ion) with GAFF. Ending up with “bond missing” error in parallel system, I was thinking that the problem might be due to the bad geometry and/or force field parameters, thus I was thinking to use another software to generate my system, however, before going further, I decided to check my simulation with another LAMMPS version (my first try was LAMMPS Mar20). Hopefully, by switching to a new version (say 29Sep21), my simulation runs perfectly in parallel with no error.

Anyways, thank you for your time and advice.

image.gif

image.gifDear Axel,

Thank you for your valuable advice. Based on the comparison between the simulation results (i.e., density profile) running in lmp_mpi single processor and in parallel, I do not see any significant difference.

there shouldn’t be a difference. if your simulation settings or force field parameters are bad, both simulations would be tainted in the same way. It is only the parallel run will run into lost bond atoms that cannot happen with a serial run since you have only one subdomain.

have you done your due diligence to see if your simulation settings a sane? for example?

  • have you run a test with fix nve and monitored energy conservation?
  • have you looked at the evolution of your potential energy (with frequent thermo output) and seen unexpected spikes?

Perhaps it would not be enough assessment to be certain about my simulation implementation, thus I will go check the discussion as well.

yes, there are many simulations that will continue to run, but are still bogus. sometimes the differences can be rather subtle. in my opinion the best approach is to assume that things are broken and then check each and every possible item for whether the settings are reasonable. that requires investing some effort into learning proper MD bases, and in most cases, that is much easier done with a simpler, well known system.

image.gif

image.gif

Sorry. My mistake. Thanks.

image.gif

image.gif

image.gif