[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.

thanks
Jaime Sanchez

Hi Jaime,

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

Naveen

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.

thanks
Jaime Sanchez

Jaime,

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
owns.

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

    MPI_Bcast(&n,1,MPI_INT,0,world);

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

Paul