Global array/vector versus local array/vector

Hello everyone,

I wanted to ask a question out of curiosity as I am reading some stuff in the manual: given that data of different styles (i.e., global, per-atom, local and per-grid) can be of different kinds (i.e., scalar, vector or arrays), what would be the difference between, say, a global array and a local array? I’ve read that "A global datum is one or more system-wide values" and that "Local datums are calculated by each processor based on the atoms it owns". For example, the compute bond/local command can yield a local array (assuming I specify more than one value along the command) with each line corresponding to the info for a specific bond, while the com/chunk command for example would yield a global array where each line corresponds to a chunk and the columns are the x, y and z coordinates. I dont grasp the difference so much. Is it a matter of a local array containing info about several “things” that are of the same type (like, in my example, bond types) while in the case of global arrays the entries the lines correspond to are considered to be a “single entity” on its own?

EDIT: could I say that the difference is simply that local arrays are quantities that it makes sense to build an histogram based on them while for global arrays it wouldnt?

A global array is synchronized across all MPI ranks and thus can be accessed in equal and atom style variables. A local array is only accessible on the same MPI rank. That is why we have dump style local.

Ahhh, I see! Thanks a lot !