[lammps-users] Exchanging per-atom array

Hi everybody,

Some weeks ago I sent you all a message asking how to send/receive per-atom arrays between processors (it’s a 3d array of dimensions “number of local atoms” x “dimension” x “specific size”). As it is written on the manual concerning migration of information between processors, I tried to use grow_arrays, copy_arrays, pack_exchange, unpack_exchange methods and add_callbacks, as some fixes use them, however it didn’t work. Also, I have tried to see if lammps accesses the (un)pack_exchange functions, but it doesn’t.

Looking at some fixes I found that some use pack_comm and unpack_comm. Still, I couldn’t manage communication between processors.

I would like to know if there is something I’m missing.

Regards,

Alexandre

Hi everybody,

Some weeks ago I sent you all a message asking how to send/receive per-atom
arrays between processors (it's a 3d array of dimensions "number of local
atoms" x "dimension" x "specific size"). As it is written on the manual
concerning migration of information between processors, I tried to use
grow_arrays, copy_arrays, pack_exchange, unpack_exchange methods and
add_callbacks, as some fixes use them, however it didn't work. Also, I have
tried to see if lammps accesses the (un)pack_exchange functions, but it
doesn't.

"it didn't work" is an unsatisfactory description. it obviously works for the
dump classes and fixes that collect information from all processes.
e.g. i wrote the imd fix and am using it regularly and it work just fine,
even though it requires all coordinates of the group it operates on always
to be available on the rank 0 processor and in the same order.

Looking at some fixes I found that some use pack_comm and unpack_comm.
Still, I couldn't manage communication between processors.

I would like to know if there is something I'm missing.

how should anybody know??
the amount of help you can get, primarily depends
on how well you describe your problem.

cheers,
    axel.

OK, I will try another question then: how does LAMMPS knows when an atom is going to change between processors, so that LAMMPS can communicate atom’s properties between processors. Does it reads the position at a moment and predicts that the atom will go to another region pertaining to other processor, or are there other rules for that?

OK, I will try another question then: how does LAMMPS knows when an atom is
going to change between processors, so that LAMMPS can communicate atom's
properties between processors. Does it reads the position at a moment and
predicts that the atom will go to another region pertaining to other
processor, or are there other rules for that?

have a look at routines in the Comm class.

handling of atoms passing from one domain to another
is processed in Comm::exchange().

which atom properties are communicated depends on
the atom style and they are copied into a buffer with the
corresponding AtomVecXXX::pack_exchange() method
which will also loop over pack_exchange() methods
of any defined fixes.

at least this is what i could find out after digging around
the sources for a few minutes with grep... :wink:

cheers,
    axel.

And this happens only when re-neighboring is taking place,
e.g. every few timesteps. One thing you will
want to make sure in your new fix is that you set the
callbacks to the atom class that invoke things like
grow_arrays, etc when reneighboring occurs.

But if you are doing any debugging, you should know
whether those routines are getting called or not.

Steve