Unexpectedly long communication cutoff requirement

Dear all,

I am running a simulation where moving particles form bonds with stationary particles. I am using the bond style fene/expand with R_0=1, Δ=6, which gives a maximum bond length of 7 (The Lennard-Jones repulsion terms are turned off). To cover the full extent of the bonds, the total neighbor list distance is set to 9. Still, when running the simulation I get the following warning:

Communication cutoff 9 is shorter than a bond length based estimate of 11. This may lead to errors. (src/comm.cpp:727)

If I increase the neighbor list skin, I still get the same warning with the bond length estimate having increased by the same amount, e.g.:

Communication cutoff 10 is shorter than a bond length based estimate of 12. This may lead to errors. (src/comm.cpp:727)

I cannot explain this behavior since in my input script there is no dependence of how the bond coeffs and the neighbor list parameters are set. According to other questions I checked, LAMMPS uses some unspecified heuristic to extract these bond length estimates, but I cannot understand why they would depend on the neighbor list cutoff.

Going on, unless I significantly increase the neighbor list/communication cutoff distance, I get the following error at some point during the run:

Fix bond/create needs ghost atoms from further away (src/MC/fix_bond_create.cpp:792)

Again, this feels weird since the communication distance should be equal to the neighbor list distance, which is larger than the maximum bond length. I don’t see why fix bond/create would need to access atoms further than that. Just to make it clear, I am not getting a “FENE bond too long” warning that would justify such behavior. I found 2-3 posts by other users who faced the same error but I have to admit that I could not really understand the given explanations or could not see how they were relevant to my case.

To sum up, I have two main questions:

  1. Why does LAMMPS calculate such a high bond length estimate that also happens to depend on neighbor list cutoff? Should I be worried that this is due to a mistake on my part?
  2. Why do I have to increase the communication cutoff to values much higher that the maximum bond length in order to avoid the aforementioned error?

Thank you in advance and sorry for the long post

Please share an input script which can show the issue.

Hi @chrisp,

I think I understand what you are saying but your terminology is slightly different from the LAMMPS manual. Even though your post is long it does show that you have tried to work through this on your own as much as possible, and I appreciate that! As @mkanski has said it is helpful if you show us your script, and in addition state your LAMMPS version.

Long story short – it sounds like you have made the communication cutoff too short, so the neighborlist (EDIT) ghost list by fix bond/create is missing important atoms. Try (1) returning the neighborlist skin to its default, (2) setting the communication cutoff to the value recommended by the warning. i.e. use comm_modify cutoff X in your script and not neigh_modify skin Y.

Comm and neighbor cutoffs are different

The comm cutoff is the distance around a processor’s owned volume where a processor will request information about ghost particles from its neighbouring processors. The neighbor cutoff is the distance around a particle where the particle’s neighbor list will list out potential pair interaction neighbours.

It sounds like you have tried to fix an issue with too-short comm cutoffs by increasing the neighbor skin distance.

This is not the best approach and wasting CPU resources. In order to avoid “Bond atom lost” issues, you only need to extend the communication cutoff (i.e. create more “ghost” atoms) instead of also extending the neighbor lists to include more neighbors (that have to be checked whether they are within the cutoff or not during the force computation).

Yes, that is the expected behavior. To expand the communication cutoff you need to issue a comm_modify cutoff command. This can set the communication cutoff independent from the neighbor list cutoff. It must be at least as large as the neighbor list cutoff (i.e. largest pair style cutoff plus neighbor list skin), but it can be set to a larger value.

They don’t. The heuristic takes the largest equilibrium distance returned by the bond style, multiplies it with 1.5 and then add the neighbor list skin distance. This is so that you don’t get into a situation where one atom of a bond is local and the other is a ghost, the bond is somewhat stretched, and the ghost atom would be missing because there are not enough ghost atoms. For angles and dihedrals, the distance is correspondingly longer. The actual value depends on the newton setting for bonds.

Unlike the other message, which is a warning and thus may be ignored, this is an error and stems from the fact that indeed the code cannot find a suitable ghost atom. This is actually considering not only bonds, but also 1-3, and 1-4 special neighbors and thus a longer distance would be required (up to 3x the length of a stretched bond).
Fix bond/create needs to update those since creating a bond changes the assignment of atoms and thus their order in the list.

It is a conservative estimate and does not depend on the neighbor list cutoff.

Because a) bonds can become stretched and thus longer than their equilibrium distance. and b) the equilibrium distance returned by your bond style is particularly long due to the inclusion of the expansion term and thus is a case where the heuristics may be ignored.

Thank you all for you replies. I think most of my questions are sorted but I included an input script that replicates the problem just in case you want to check it out:
error_demonstration.in (3.4 KB)

I would also like to clarify a few details just to make sure I have understood the situation:

This is a weird typo. As mentioned on my original post, the total neighbor list cutoff is set to 9, not 999.

If I have understood the documentation correctly, the communication cutoff is set by default equal to the neighbor list cutoff. In my system there are only 1-2 bonds with a maximum length of 7, so setting the neighbor list (and therefore the communication) cutoff to 9 should cover everything. Obviously this is not the case, could you elaborate on that ?

It is not so much a typo but some side effect from problems the forum software seems to have when quoting formatted/quoted text. I answer a lot of questions, so don’t always notice…

As I already mentioned, the warning can be ignored, but the error from fix bond/create is real. It errors out at the location that you have quoted only if it is looking for the closest periodic copy of a specific atom but cannot find it. Even if you don’t have angles or dihedrals, your special_bond settings do include 1-3 and 1-4 pairs. Perhaps, with setting special_bonds lj/coul 0.0 1.0 1.0 you can avoid it, but I am not certain. This is all precipitated by the equilibrium bond distance for your bond style assuming the full expansion.

You were spot on with the comment about special_bonds. I had only set the lj weighting factors because there are no coulombic interactions in my system, but it looks like they were being accounted for by fix bond/create. Again, thank you for taking the time to look into this problem.