[lammps-users] question on parallelization

Hello everyone,

I was wondering if it is possible to know how many atoms a given processor owns during a parallel run.

Jaime Sanchez

Hi Jaime,

The variable you're looking for is atom->nlocal.


Thanks Naveen,

I was actually looking for that variable but it only gave me the number of atoms owned for me == 0 (I had that on my fix and didn’t see it).

do you know how I can send information from the processor with me == 0 to the rest of the processors? this is a variable that I’m calculating in the processor with rank 0 but is needed in all the others as well.

Jaime Sanchez


Naveen is right. You should have a different value for atom->nlocal on
each processor that corresponds to the number of atoms that that proc

You can send info from proc 0 to all the other procs using an MPI
broadcast command like this:


Take a look at other places in the code where commands like this
appear for hints on how to implement it correctly.