Error about parallel computing when modify the fix_addforce.cpp

Dear Steve,

I add a piece of code,listing below.And no error return.So the atom may be a ghost atom.And But I can’t understand “Unless you insure those forces are communicated
back to the proc that owns the atom” ,in other words,what I do to insure those forces are communicated back to the proc that owns the atom.Could you give me some advice?

if (index == -1) error->all(FLERR, “index”);
if (j3 == -1) error->all(FLERR, “j3”);
if (j4 == -1) error->all(FLERR, “j4”);
if (j5 == -1) error->all(FLERR, “j5”);
if (j7 == -1) error->all(FLERR, “j7”);
if (j8 == -1) error->all(FLERR, “j8”);
if (j9 == -1) error->all(FLERR, “j9”);
if (j10 == -1) error->all(FLERR, “j10”);

Best Wishes!

Sincerely yours,
Chen Wang

You need to examine other fixes in LAMMPS that do

similar things. There are comm->reverse and comm->forward

calls for doing communication of atom properties.

You also can’t do error->all() when only one processor will

hit the error. The code will hang. You need error->one().

Steve