[lammps-users] Questions on using fix bond/create/angle with mpirun

Dear All,

I am using the following fix for my simulation:

fix 2 Rea2 bond/create/angle 100 1 14 4.0 5 aconstrain 160 180 prob 1 25784 iparam 1 15 jparam 1 13 atype 6

for creating bonds with the constrain of angles.

I am sure that each of the type 1 and type 14 atom is bonded with another atom.
For example: atom1(type 1) bonds with atoms2(type 7), atom3(type 14) bond with atom4(type 8).
So, for the bond forming between atom1 and atom3. It requires meeting all the following criteria that :

  1. distance meeting atom1 and atom3 within 4 Angs.
  2. Angle1 (atom2-atom1-atom3) within the range of [160,180]
  3. Angle2 (atom2-atom3-atom4) within the range of [160,180]

However, when I check my simulation trajectory, it will create a bond when only angle1 is meet the criteria, and it can not find angle2 when I use mpirun with more than 4 cores. I am using the cpu chip of AMD EPYC7702.

I modified the debug code provided by Jacob https://github.com/lammps/lammps/pull/2206
on the latest stable version of Lammps which is LAMMPS (30 Nov 2020).
I can get the following information,

case I
i is 192, j is 1011
bond/create/angle: angle1 no J is 1.632267

which means the i atom find at least 1 neighbor in nspecial, however the j atom didn’t. (refers to fix_bond_create_angle.cpp in src of lammps)
However my i or j atoms always bond with another atom, it should always give me :

case II
i is 512, j is 716
bond/create/angle: angle1 is 1.880515, angle2 is 2.361167

When I use only 1 core to run the simulation, it seems everything is correct, and they can always find out both angle1 and angle2. So I am wondering if this is a problem created by using multiple processors for running the simulation, which the special lists didn’t communicate well between processors. But I can not afford for using only 1 CPU to run my simulation.

Is there any way that can help solve this issue other than using only 1 CPU?

Thanks

Toby

You may have to increase your communication cutoff ( https://docs.lammps.org/comm_modify.html )
so that all atoms that need to be checked for are available for cases where one or both of the new bonds cross sub-domain boundaries.
With a single processor those atoms can always be found since all atoms are present.

This looks like you need to continue the discussion with the person who contributed this code and is copied on this email.