Accessing a global per-atom vector across All MPI ranks

Dear Community,

I have a situation where I want the “number of neighbors of a group of atoms” accessible to all MPI ranks. I compute the number of neighbors of a specific group in the input script as follows.

compute c2 mygroup coord/atom cutoff 1.0

I have written a fix which uses “compute_peratom” but this only calculates the number of neighbors of atoms for current MPI rank only. The number of neighbors of ghost atoms is not available. Some attributes of atoms (the static ones like charge, mass etc) are accessible to all MPI ranks but I want to the same for a dynamic attribute.

Thank you
Sathish

So you have to copy that to suitable arrays and add MPI calls of your own to your fix to communicate the information in the way you want.

Thank you Dr. Kohlmeyer.

How about fix property/atom which updates whenever neighborlists are built?

Please see 4.8. Notes for developers and code maintainers — LAMMPS documentation
This applies to the latest development code and a future LAMMPS version which is not yet released.